Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,24 @@ WORKDIR /go/src/github.com/Azure/acr-cli
COPY . .
RUN make binaries && mv bin/acr /usr/bin/acr

FROM mcr.microsoft.com/azurelinux/base/core:3.0
RUN tdnf check-update \
&& tdnf --refresh install -y \
ca-certificates-microsoft \
&& tdnf clean all
# Manually copy essential libraries that Go FIPS binaries typically need
RUN mkdir -p /tmp/libs /tmp/linker && \
cp /lib64/libc.so.6 /tmp/libs/ 2>/dev/null || true && \
cp /lib64/libdl.so.2 /tmp/libs/ 2>/dev/null || true && \
cp /lib64/libpthread.so.0 /tmp/libs/ 2>/dev/null || true && \
cp /lib64/librt.so.1 /tmp/libs/ 2>/dev/null || true && \
cp /lib64/libresolv.so.2 /tmp/libs/ 2>/dev/null || true && \
cp /lib64/libssl.so* /tmp/libs/ 2>/dev/null || true && \
cp /lib64/libcrypto.so* /tmp/libs/ 2>/dev/null || true && \
cp /usr/lib64/libssl.so* /tmp/libs/ 2>/dev/null || true && \
cp /usr/lib64/libcrypto.so* /tmp/libs/ 2>/dev/null || true && \
find /lib /lib64 /usr/lib -name "ld-linux*" -exec cp {} /tmp/linker/ \; 2>/dev/null || true

FROM mcr.microsoft.com/azurelinux/distroless/minimal:3.0
# Copy the dynamic linker for the respective platform
COPY --from=acr-cli /tmp/linker/ /lib/
# Copy essential libraries
COPY --from=acr-cli /tmp/libs/ /lib64/
# Copy the binary
COPY --from=acr-cli /usr/bin/acr /usr/bin/acr
ENTRYPOINT [ "/usr/bin/acr" ]
Loading