From 50d37460d895eb7e48c7f6a2c277b5a3eb1c9379 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Fri, 1 Mar 2024 10:54:06 -0800 Subject: [PATCH] Dockerfile fixes --- .github/workflows/build.yml | 2 +- Dockerfile | 7 +++++-- Makefile | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a671b3cc..08339f78 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -149,7 +149,7 @@ jobs: uses: hashicorp/actions-docker-build@v1 with: smoke_test: | - TEST_VERSION="$(docker run "${IMAGE_NAME}" version | awk '/hcp v/{print $2}')" + TEST_VERSION="$(docker run "${IMAGE_NAME}" hcp version | awk '/hcp v/{print $2}')" if [ "${TEST_VERSION}" != "${{ env.product_version }}" ]; then printf "fail: container smoke test, got=%q want=%q\n" "${TEST_VERSION}" "${{ env.product_version }}" exit 1 diff --git a/Dockerfile b/Dockerfile index dfe3a8fe..726693e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ RUN touch ~/.bashrc && hcp --autocomplete-install CMD ["/bin/bash"] ## DOCKERHUB DOCKERFILE ## -FROM alpine:3.19 as default +FROM alpine:3.19 as release ARG BIN_NAME ARG NAME=hcp @@ -33,11 +33,14 @@ LABEL name="HCP CLI" \ description="The hcp CLI allows interaction with the HashiCorp Cloud Platform using the command-line." COPY dist/$TARGETOS/$TARGETARCH/$BIN_NAME /bin/ +RUN ls -lh /bin RUN apk --no-cache upgrade && apk --no-cache add \ bash \ curl \ jq \ nano \ vim -RUN touch ~/.bashrc && hcp --autocomplete-install +RUN touch ~/.bashrc +RUN echo $PATH +# RUN hcp --autocomplete-install CMD ["/bin/bash"] diff --git a/Makefile b/Makefile index be3b54f4..cd480205 100644 --- a/Makefile +++ b/Makefile @@ -68,7 +68,7 @@ docker-build-dev: build @echo "Successfully built $(IMAGE_TAG_DEV)" crt-build: - go build -o ${BIN_PATH} -trimpath -buildvcs=false \ + CGO_ENABLED=0 go build -o ${BIN_PATH} -trimpath -buildvcs=false \ -ldflags "-X github.com/hashicorp/hcp/version.GitCommit=${PRODUCT_REVISION}" HELP_FORMAT=" \033[36m%-25s\033[0m %s\n"