From 24766319b12300c6e3af73cac34fd92f70cab736 Mon Sep 17 00:00:00 2001 From: mschfh <37435502+mschfh@users.noreply.github.com> Date: Wed, 24 Jun 2026 02:16:12 -0500 Subject: [PATCH] Add Dockerfile-go --- CHANGELOG.md | 1 + Dockerfile-go | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 Dockerfile-go diff --git a/CHANGELOG.md b/CHANGELOG.md index ed78195e5..327f7110b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ### Enhancements: - feat(kvstoreentry/delete): Add support for multiple-key deletion using a key prefix. ([#XXX](https://github.com/fastly/cli/pull/XXX)) +- build(dockerfile-go): add Go Dockerfile alongside the existing Node and Rust ones ([#XXX](https://github.com/fastly/cli/pull/1828)) ### Dependencies: - build(deps): `github.com/nwaples/rardecode/v2` from 2.2.3 to 2.2.5 ([#1825](https://github.com/fastly/cli/pull/1825)) diff --git a/Dockerfile-go b/Dockerfile-go new file mode 100644 index 000000000..3a6affbef --- /dev/null +++ b/Dockerfile-go @@ -0,0 +1,21 @@ +FROM golang:latest +LABEL maintainer="Fastly OSS " + +RUN apt-get update && apt-get install -y curl jq && apt-get -y clean && rm -rf /var/lib/apt/lists/* \ + && export FASTLY_CLI_VERSION=$(curl -s https://api.github.com/repos/fastly/cli/releases/latest | jq -r .tag_name | cut -d 'v' -f 2) \ + GOARCH=$(dpkg --print-architecture) \ + && curl -sL "https://github.com/fastly/cli/releases/download/v${FASTLY_CLI_VERSION}/fastly_v${FASTLY_CLI_VERSION}_linux-$GOARCH.tar.gz" -o fastly.tar.gz \ + && curl -sL "https://github.com/fastly/cli/releases/download/v${FASTLY_CLI_VERSION}/fastly_v${FASTLY_CLI_VERSION}_SHA256SUMS" -o sha256sums \ + && dlsha=$(shasum -a 256 fastly.tar.gz | cut -d " " -f 1) && expected=$(cat sha256sums | awk -v pat="$dlsha" '$0~pat' | cut -d " " -f 1) \ + && if [ "$dlsha" != "$expected" ]; then echo "shasums don't match" && exit 1; fi \ + && tar -xzf fastly.tar.gz --directory /usr/bin && rm -f sha256sums fastly.tar.gz \ + && useradd -ms /bin/bash fastly + +USER fastly + +WORKDIR /app +ENTRYPOINT ["/usr/bin/fastly"] +CMD ["--help"] + +# docker build -t fastly/cli/go . -f ./Dockerfile-go +# docker run -v $PWD:/app -it -p 7676:7676 fastly/cli/go compute serve --addr="0.0.0.0:7676"