Skip to content

Commit

Permalink
Stop building packer, use binary provided by their container
Browse files Browse the repository at this point in the history
Thanks to the following issue hashicorp/packer#8846, and the fact that they’ll be removing abiity to use a simple ‘go get’ (hashicorp/packer#8837 (comment)), it makes no sense to try to build it locally anymore.
  • Loading branch information
dominikborkowski committed Mar 18, 2020
1 parent 2231e2d commit 9eb2eec
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ RUN go get github.com/aelsabbahy/goss/cmd/goss@v${GOSS_VER} && \
strip ${GOPATH}/bin/* && \
go clean -cache -modcache

# Build goss, packer, and packer-provisioner-goss with musl
# Build goss and packer-provisioner-goss with musl
FROM golang:1.13-alpine3.10 as build_musl_bins
ARG PACKER_VER=1.5.4
ARG PACKER_PROVISIONER_GOSS_VER=1.0.0
ARG GOSS_VER=0.3.10
ENV GO111MODULE=on
RUN apk --no-cache --upgrade --virtual=build_environment add binutils && \
go get github.com/hashicorp/packer@v${PACKER_VER} && \
go get github.com/YaleUniversity/packer-provisioner-goss@v${PACKER_PROVISIONER_GOSS_VER} && \
go get github.com/aelsabbahy/goss/cmd/goss@v${GOSS_VER} && \
strip $GOPATH/bin/* && \
Expand All @@ -29,12 +27,16 @@ LABEL maintainer="Dominik L. Borkowski"

# Get binaries from musl based container
COPY --from=build_musl_bins \
/go/bin/packer /go/bin/goss /go/bin/packer-provisioner-goss /bin/
/go/bin/goss /go/bin/packer-provisioner-goss /bin/

# Get binaries from glibc based container
COPY --from=build_glibc_bins \
/go/bin/goss /bin/goss-glibc

# Get packer binaries from their official container
ARG PACKER_VER=1.5.4
COPY --from=hashicorp/packer:${PACKER_VER} /bin/packer /bin/packer

# Install few essential tools and AWS CLI, then clean up
RUN apk --no-cache --upgrade --virtual=build_environment add \
gcc python3-dev musl-dev libffi-dev openssl-dev && \
Expand Down

0 comments on commit 9eb2eec

Please sign in to comment.