Skip to content

Commit

Permalink
chore: upgrade azcopy to v10.26
Browse files Browse the repository at this point in the history
  • Loading branch information
meysam81 committed Sep 2, 2024
1 parent 0fc94c3 commit 00dce44
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 21 deletions.
56 changes: 37 additions & 19 deletions Dockerfile
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

View workflow job for this annotation

GitHub Actions / build-tag / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

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

View workflow job for this annotation

GitHub Actions / build-tag / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

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" ]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ SAS_TOKEN="XXXXXXX"
docker run --rm \
--name azcopy \
-v /path/to/data/dir:/data-dir:ro \
ghcr.io/licenseware/docker-azcopy:v10.23.0 \
copy "/data-dir" "https://$STORAGE_ACCOUNT_NAME.blob.core.windows.net/$CONTAINER_NAME/data-dir$SAS_TOKEN" --recursive
ghcr.io/licenseware/docker-azcopy:v10.26.0 \
azcopy copy "/data-dir" "https://$STORAGE_ACCOUNT_NAME.blob.core.windows.net/$CONTAINER_NAME/data-dir$SAS_TOKEN" --recursive
```

0 comments on commit 00dce44

Please sign in to comment.