Skip to content

Commit

Permalink
fix: minimal image build
Browse files Browse the repository at this point in the history
  • Loading branch information
moshloop committed Oct 17, 2023
1 parent 06aad36 commit d2e6759
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions build/minimal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ WORKDIR /app

ARG NAME
ARG VERSION
ENV IMAGE_TYPE=minimal
ENV IMAGE_TYPE=full

COPY go.mod /app/go.mod
COPY go.sum /app/go.sum
Expand All @@ -20,11 +20,6 @@ RUN apt-get update && \
rm -Rf /usr/share/doc && rm -Rf /usr/share/man && \
apt-get clean

COPY --from=builder /app/.bin/canary-checker /app

# Install alexellis/arkade as root
RUN curl -sLS https://get.arkade.dev | sh

RUN mkdir -p /etc/apt/keyrings && \
curl -sLS https://packages.microsoft.com/keys/microsoft.asc | \
gpg --dearmor | tee /etc/apt/keyrings/microsoft.gpg > /dev/null && \
Expand All @@ -35,6 +30,13 @@ RUN mkdir -p /etc/apt/keyrings && \
apt-get install -y azure-cli && \
apt-get clean

RUN apt-get update && apt-get upgrade -y && \
rm -Rf /var/lib/apt/lists/* && \
apt-get clean

# Install alexellis/arkade as root
RUN curl -sLS https://get.arkade.dev | sh

RUN mkdir /opt/database && groupadd --gid 1000 canary && \
useradd canary --uid 1000 -g canary -m -d /var/lib/canary && \
chown -R 1000:1000 /opt/database && chown -R 1000:1000 /app
Expand All @@ -52,11 +54,13 @@ RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2
rm awscliv2.zip

# Install GCP CLI
RUN curl -sL -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-441.0.0-linux-x86_64.tar.gz && \
tar -xf google-cloud-cli-441.0.0-linux-x86_64.tar.gz && \
ENV GCLOUD_VERSION=441.0.0
RUN curl -sL -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-${GCLOUD_VERSION}-linux-x86_64.tar.gz && \
tar -xf google-cloud-cli-${GCLOUD_VERSION}-linux-x86_64.tar.gz && \
ln -sf /app/google-cloud-sdk/bin/gcloud ${HOME}/bin/gcloud && \
rm google-cloud-cli-441.0.0-linux-x86_64.tar.gz
rm google-cloud-cli-${GCLOUD_VERSION}-linux-x86_64.tar.gz

RUN /app/canary-checker go-offline
COPY --from=builder /app/.bin/canary-checker /app

RUN /app/canary-checker go-offline
ENTRYPOINT ["/app/canary-checker"]

0 comments on commit d2e6759

Please sign in to comment.