github.com/fastly/cli@v1.7.2-0.20240304164155-9d0f1d77c3bf/Dockerfile-rust (about)

     1  FROM rust:latest
     2  LABEL maintainer="Fastly OSS <oss@fastly.com>"
     3  
     4  ENV RUST_TOOLCHAIN=stable
     5  RUN rustup toolchain install ${RUST_TOOLCHAIN} \
     6    && rustup target add wasm32-wasi --toolchain ${RUST_TOOLCHAIN} \
     7    && apt-get update && apt-get install -y curl jq && apt-get -y clean && rm -rf /var/lib/apt/lists/* \
     8    && export FASTLY_CLI_VERSION=$(curl -s https://api.github.com/repos/fastly/cli/releases/latest | jq -r .tag_name | cut -d 'v' -f 2) \
     9              GOARCH=$(dpkg --print-architecture) \
    10    && 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 \
    11    && curl -sL "https://github.com/fastly/cli/releases/download/v${FASTLY_CLI_VERSION}/fastly_v${FASTLY_CLI_VERSION}_SHA256SUMS" -o sha256sums \
    12    && dlsha=$(shasum -a 256 fastly.tar.gz | cut -d " " -f 1) && expected=$(cat sha256sums | awk -v pat="$dlsha" '$0~pat' | cut -d " " -f 1) \
    13    && if [ "$dlsha" != "$expected" ]; then echo "shasums don't match" && exit 1; fi \
    14    && tar -xzf fastly.tar.gz --directory /usr/bin && rm -f sha256sums fastly.tar.gz \
    15    && useradd -ms /bin/bash fastly
    16  
    17  USER fastly
    18  
    19  WORKDIR /app
    20  ENTRYPOINT ["/usr/bin/fastly"]
    21  CMD ["--help"]
    22  
    23  # docker build -t fastly/cli/rust . -f ./Dockerfile-rust
    24  # docker run -v $PWD:/app -it -p 7676:7676 fastly/cli/rust compute serve --addr="0.0.0.0:7676"