Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.4.8-alpine3.23
FROM ruby:3.4.8-alpine3.23 AS builder

ARG TERRAFYING_VERSION=0.0.0
ENV TERRAFORM_VERSION=1.2.8
Expand All @@ -12,13 +12,22 @@ RUN wget -O terraform.zip https://releases.hashicorp.com/terraform/${TERRAFORM_V
COPY pkg /tmp

RUN apk add --update --no-cache --virtual .terra-builddeps build-base ruby-dev \
&& apk add --update --no-cache --virtual .terra-rundeps git bash \
&& gem install /tmp/terrafying-components-${TERRAFYING_VERSION}.gem \
&& install -d /terra \
&& gem install --install-dir /usr/local/bundle /tmp/terrafying-components-${TERRAFYING_VERSION}.gem \
&& install -d -o 65532 -g 65532 /terra \
&& apk del .terra-builddeps \
&& rm -rf /var/cache/apk/*

FROM dhi.io/ruby:3.4-alpine3.23

ENV GEM_HOME=/usr/local/bundle
ENV GEM_PATH=/usr/local/bundle
ENV PATH=/usr/local/bundle/bin:$PATH

COPY --from=builder /usr/bin/terraform /usr/bin/terraform
COPY --from=builder /usr/local/bundle /usr/local/bundle
COPY --from=builder --chown=65532:65532 /terra /terra

WORKDIR /terra

ENTRYPOINT []
CMD ["/bin/bash"]
CMD ["ruby"]
Loading