Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ORAS tool to Linux ImageBuilder images #1311

Merged
merged 3 commits into from
May 25, 2024

Conversation

NikolaMilosavljevic
Copy link
Member

Add ORAS tooling to Linux Image Builder image.

Used instructions from https://oras.land/docs/installation/ with necessary modification for Alpine, to use wget instead of curl.

Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

Comment on lines 39 to 42
RUN mkdir -p oras-install/ \
&& tar -zxf oras_linux.tar.gz -C oras-install/ \
&& mv oras-install/oras /usr/local/bin/ \
&& rm -rf oras_linux.tar.gz oras-install/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This extraction should be done in the build stage above, then we only need one COPY instruction into /usr/local/bin - this reduces the number of layers in the image and lets us cross-build without running the extraction steps under QEMU emulation, or lets us move to a distroless base image in the future (#1060).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed with cbb48eb

@@ -16,6 +16,14 @@ RUN dotnet restore -r linux-musl-$TARGETARCH ./src/Microsoft.DotNet.ImageBuilder
COPY . ./
RUN dotnet publish -r linux-musl-$TARGETARCH ./src/Microsoft.DotNet.ImageBuilder.csproj --self-contained=true --no-restore -o out

# download oras package tarball
WORKDIR /
RUN oras_version=1.1.0 \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An issue should be logged to determine a way to keep this version up-to-date with new releases.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created an issue to track this: #1313

@NikolaMilosavljevic NikolaMilosavljevic merged commit 6a60198 into dotnet:main May 25, 2024
12 checks passed
@lbussell lbussell mentioned this pull request Aug 3, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants