-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathDockerfile-node
22 lines (17 loc) · 1.11 KB
/
Dockerfile-node
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM node:latest
LABEL maintainer="Fastly OSS <[email protected]>"
RUN apt-get update && apt-get install -y curl jq
RUN export FASTLY_CLI_VERSION=$(curl --silent https://api.github.com/repos/fastly/cli/releases/latest | jq -r .tag_name | cut -d 'v' -f 2) \
GOARCH=$(dpkg --print-architecture) \
&& curl -vL "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 -vL "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
RUN tar -xzf fastly.tar.gz --directory /usr/bin && rm fastly.tar.gz
RUN adduser fastly
USER fastly
WORKDIR /app
ENTRYPOINT ["/usr/bin/fastly"]
CMD ["--help"]
# docker build -t fastly/cli/node . -f ./Dockerfile-node
# docker run -v $PWD:/app -it -p 7676:7676 fastly/cli/node compute serve --addr="0.0.0.0:7676"