Here I'm trying to build a terraform image using Alpine with the following Dockerfile, but success. However same used to work until a few months ago, not sure went changed
Dockerfile:
FROM alpine:latest
ARG Test_GID=1002
ARG Test_UID=1002
# Change to root user
USER root
RUN addgroup --gid ${Test_GID:-1002} test
RUN adduser -S -u ${Test_UID:-1002} -D -h "$(pwd)" -G test test
ENV USER=test
ENV TERRAFORM_VERSION=0.15.4
ENV TERRAFORM_SHA256SUM=ddf9fdfdfdsffdsffdd4e7c080da9a106befc1ff9e53b57364622720114e325c
ENV TERRAFORM_DOWNLOAD_URL=https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip
RUN apk --update add python3 py3-pip python3-dev
RUN apk update && \
apk add ansible \
gcc \
libffi \
libffi-dev \
musl-dev \
make \
openssl \
openssl-dev \
curl \
zip \
git \
jq
When I run the command docker image build -t terraform:0.15.5 .
I get below-shown error
CodePudding user response:
there is a problem in your Dockerfile that you copied here I think jenkins
should not be there. Anyway, I tried with the Dockerfile below and build was success, I couldn't reproduce the problem, Are there any other lines in your Dockerfile ?
FROM alpine:latest
ARG Test_GID=1002
ARG Test_UID=1002
# Change to root user
USER root
RUN addgroup --gid ${Test_GID:-1002} test
RUN adduser -S -u ${Test_UID:-1002} -D -h "$(pwd)" -G test test
ENV USER=test
ENV TERRAFORM_VERSION=0.15.4
ENV TERRAFORM_SHA256SUM=ddf9fdfdfdsffdsffdd4e7c080da9a106befc1ff9e53b57364622720114e325c
ENV TERRAFORM_DOWNLOAD_URL=https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip
RUN apk --update add python3 py3-pip python3-dev
RUN apk update && \
apk add ansible \
gcc \
libffi \
libffi-dev \
musl-dev \
make \
openssl \
openssl-dev \
curl \
zip \
git \
jq