From eada69519dac3222eb7db40400222801e8d739ac Mon Sep 17 00:00:00 2001 From: Dan Pastusek Date: Fri, 14 Aug 2020 15:10:44 -0600 Subject: [PATCH 1/3] add jq / yq --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2ab87f8..dd06613 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,11 +9,16 @@ RUN go build -o /usr/bin/mautrix-whatsapp FROM alpine:3.12 +ARG TARGETARCH=amd64 +ARG YQ_DOWNLOAD_ADDR=https://github.com/mikefarah/yq/releases/download/3.3.2/yq_linux_${TARGETARCH} + ENV UID=1337 \ GID=1337 RUN echo "@edge_community http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories -RUN apk add --no-cache ffmpeg su-exec ca-certificates olm@edge_community +RUN apk add --no-cache ffmpeg su-exec ca-certificates olm@edge_community bash jq curl && \ + curl -sLo yq ${YQ_DOWNLOAD_ADDR} && \ + chmod +x yq && mv yq /usr/bin/yq COPY --from=builder /usr/bin/mautrix-whatsapp /usr/bin/mautrix-whatsapp COPY --from=builder /build/example-config.yaml /opt/mautrix-whatsapp/example-config.yaml From 90049f5f901b3b6567d8c62dee04425383efd0d5 Mon Sep 17 00:00:00 2001 From: Dan Pastusek Date: Fri, 14 Aug 2020 15:38:23 -0600 Subject: [PATCH 2/3] update to use existing DOCKER_ARCH from ci pipeline --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index dd06613..eda3614 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,8 @@ RUN go build -o /usr/bin/mautrix-whatsapp FROM alpine:3.12 -ARG TARGETARCH=amd64 -ARG YQ_DOWNLOAD_ADDR=https://github.com/mikefarah/yq/releases/download/3.3.2/yq_linux_${TARGETARCH} +ARG DOCKER_ARCH=amd64 +ARG YQ_DOWNLOAD_ADDR=https://github.com/mikefarah/yq/releases/download/3.3.2/yq_linux_${DOCKER_ARCH} ENV UID=1337 \ GID=1337 From 5a0930f672ec4491aa17d0ad00768243ad2cec7e Mon Sep 17 00:00:00 2001 From: Dan Pastusek Date: Fri, 14 Aug 2020 15:50:26 -0600 Subject: [PATCH 3/3] revert to TARGETARCH, update CI --- .gitlab-ci.yml | 2 +- Dockerfile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 54b7c33..5d0d592 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,7 +30,7 @@ stages: - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY script: - docker pull $CI_REGISTRY_IMAGE:latest || true - - docker build --pull --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA-$DOCKER_ARCH . --file Dockerfile.ci + - docker build --pull --cache-from $CI_REGISTRY_IMAGE:latest --build-arg TARGETARCH=$DOCKER_ARCH --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA-$DOCKER_ARCH . --file Dockerfile.ci - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA-$DOCKER_ARCH - docker rmi $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA-$DOCKER_ARCH diff --git a/Dockerfile b/Dockerfile index eda3614..dd06613 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,8 @@ RUN go build -o /usr/bin/mautrix-whatsapp FROM alpine:3.12 -ARG DOCKER_ARCH=amd64 -ARG YQ_DOWNLOAD_ADDR=https://github.com/mikefarah/yq/releases/download/3.3.2/yq_linux_${DOCKER_ARCH} +ARG TARGETARCH=amd64 +ARG YQ_DOWNLOAD_ADDR=https://github.com/mikefarah/yq/releases/download/3.3.2/yq_linux_${TARGETARCH} ENV UID=1337 \ GID=1337