Skip to content

Instantly share code, notes, and snippets.

@anthonywu
Last active June 4, 2019 05:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anthonywu/3cca55940968833623aae71fe4291cc3 to your computer and use it in GitHub Desktop.
Save anthonywu/3cca55940968833623aae71fe4291cc3 to your computer and use it in GitHub Desktop.
Cloudflare Workers wrangler CLI workspace
FROM ubuntu:bionic-20190515
# rustup: requires curl or wget
# wrangler: cargo install requires gcc, pkg-config and libssl-dev
# wrangler generate: requires git
RUN apt update && \
apt install -qy curl emacs gcc git libssl-dev pkg-config wget && \
apt -y full-upgrade
# wrangler build: requires npm nodejs
# this step is flaky due to dependency conflicts
RUN apt install -qy npm nodejs
RUN apt clean && apt -y autoremove
RUN curl https://sh.rustup.rs -o ./install_rustup.sh && \
chmod +x install_rustup.sh && \
./install_rustup.sh -y && \
rm install_rustup.sh
ENV PATH="$HOME/.cargo/bin:$PATH"
RUN /root/.cargo/bin/cargo install wrangler
COPY bashrc.sh /root/.bashrc
# resources/private/ contains the files that have account and api keys
# see https://workers.cloudflare.com/docs/quickstart/api-keys/
# please create resources/private/wrangler_config.toml with this format:
#
# email = "your_cloudflare_email@example.com"
# api_key = "secretvalue"
# account_id = "secretvalue"
COPY resources/private/wrangler_config.toml /root/.wrangler/config/default.toml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment