forked from PeterDaveHello/docker-azcopy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
39 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,56 @@ | ||
ARG AZCOPY_VERSION=v10.23.0 | ||
ARG GO_VERSION=1.22 | ||
ARG ALPINE_VERSION=3.19 | ||
ARG AZCOPY_VERSION=v10.26.0 | ||
ARG GO_VERSION=1.23 | ||
ARG ALPINE_VERSION=3.20 | ||
ARG TARGETARCH | ||
|
||
FROM golang:$GO_VERSION-alpine$ALPINE_VERSION as build | ||
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} as build | ||
Check warning on line 6 in Dockerfile GitHub Actions / build-tag / buildThe 'as' keyword should match the case of the 'from' keyword
|
||
|
||
ARG TARGETARCH | ||
ARG AZCOPY_VERSION | ||
|
||
ENV GOARCH=$TARGETARCH GOOS=linux CGO_ENABLED=0 | ||
|
||
WORKDIR /azcopy | ||
ARG AZCOPY_VERSION | ||
RUN apk add --no-cache build-base | ||
RUN wget "https://github.com/Azure/azure-storage-azcopy/archive/$AZCOPY_VERSION.tar.gz" -O src.tgz | ||
RUN tar xf src.tgz --strip 1 \ | ||
&& go build -o azcopy \ | ||
&& ./azcopy --version | ||
|
||
FROM curlimages/curl AS entrypoint | ||
RUN apk add --no-cache build-base && \ | ||
wget -O azcopy.tar.gz https://github.com/Azure/azure-storage-azcopy/archive/${AZCOPY_VERSION}.tar.gz && \ | ||
tar -xzf azcopy.tar.gz --strip-components=1 && \ | ||
go build -o azcopy && \ | ||
./azcopy --version | ||
|
||
FROM busybox AS entrypoint-amd64 | ||
|
||
ARG DUMB_INIT="https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64" | ||
ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 /usr/local/bin/dumb-init | ||
|
||
USER root | ||
RUN curl -L -o /usr/local/bin/dumb-init $DUMB_INIT && \ | ||
chmod +x /usr/local/bin/dumb-init | ||
RUN chmod +x /usr/local/bin/dumb-init | ||
|
||
FROM alpine:$ALPINE_VERSION as release | ||
FROM busybox AS entrypoint-arm64 | ||
|
||
ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_aarch64 /usr/local/bin/dumb-init | ||
|
||
RUN chmod +x /usr/local/bin/dumb-init | ||
|
||
FROM alpine:${ALPINE_VERSION} as release | ||
Check warning on line 33 in Dockerfile GitHub Actions / build-tag / buildThe 'as' keyword should match the case of the 'from' keyword
|
||
|
||
ARG TARGETARCH | ||
ARG AZCOPY_VERSION | ||
|
||
LABEL name="docker-azcopy" | ||
LABEL version="$AZCOPY_VERSION" | ||
LABEL maintainer="Meysam <meysam@licenseware.io>" | ||
|
||
COPY --from=entrypoint /usr/local/bin/dumb-init /usr/local/bin/dumb-init | ||
COPY --from=entrypoint-amd64 /usr/local/bin/dumb-init /usr/local/bin/dumb-init-amd64 | ||
COPY --from=entrypoint-arm64 /usr/local/bin/dumb-init /usr/local/bin/dumb-init-arm64 | ||
|
||
COPY --from=build /azcopy/azcopy /usr/local/bin/ | ||
|
||
RUN apk add --update coreutils && \ | ||
rm -rf /var/cache/apk/* | ||
RUN if [ "$TARGETARCH" = "amd64" ]; then \ | ||
mv /usr/local/bin/dumb-init-amd64 /usr/local/bin/dumb-init; \ | ||
else \ | ||
mv /usr/local/bin/dumb-init-arm64 /usr/local/bin/dumb-init; \ | ||
fi && \ | ||
apk add --update coreutils && \ | ||
rm -rf /var/cache/apk/* | ||
|
||
ENTRYPOINT [ "dumb-init", "--" ] | ||
CMD [ "azcopy", "--help" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters