Skip to content

Commit

Permalink
added env var to install extra cargo packages
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrobello committed Feb 17, 2024
1 parent cdf69da commit 408316a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .env-gdc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ fi


export RUST_VERSION

export CARGO_EXTRA
#if [ -z ${CARGO_EXTRA+x} ]; then
# export CARGO_EXTRA="cargo-edit cargo-outdated cargo-audit cargo-info bacon" # extra cargo packages to install
#fi
if [ -n "$LOCALSTACK_API_KEY" ] || [ -n "$LOCALSTACK_AUTH_TOKEN" ]; then
export LS_IMAGE=${LS_IMAGE:="localstack/localstack-pro"} # use pro image if API key is provided
else
Expand Down
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,15 @@ RUN /bin/bash -c 'if [ -n "${GOLANG_VERSION}" ] ; then \
fi; \
fi'


ARG RUST_VERSION
ARG CARGO_EXTRA
RUN /bin/bash -c 'if [ -n "${RUST_VERSION}" ]; then \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain "${RUST_VERSION}"; \
source "$HOME/.cargo/env"; \
rustup completions bash > /etc/bash_completion.d/rustup; \
if [ -n "${CARGO_EXTRA}" ]; then \
cargo install ${CARGO_EXTRA}; \
fi; \
fi'


Expand Down Expand Up @@ -263,6 +266,7 @@ ENV USE_DOT_NET=$USE_DOT_NET
ENV USE_AWS=$USE_AWS
ENV NODE_VERSION=$NODE_VERSION
ENV RUST_VERSION=$RUST_VERSION
ENV CARGO_EXTRA=$CARGO_EXTRA
ENV USE_BITWARDEN=$USE_BITWARDEN
ENV PULUMI_VERSION=$PULUMI_VERSION
ENV TERRAFORM_VERSION=$TERRAFORM_VERSION
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ services:
- USE_AWS # install latest aws cli, ssm plugin, and ecr helper
- NODE_VERSION # install this version of node. blank for none
- RUST_VERSION # install this version of rust. blank for none
- CARGO_EXTRA # extra cargo packages to install
- USE_BITWARDEN # enable bitwarden workflow helpers. will enable NODE_VERSION=18 if not set
- USE_CDK # install aws cdk, terraform and cdk for terraform
- USE_JAVA # install ubuntu:latest openjdk packages
Expand Down Expand Up @@ -122,7 +123,7 @@ services:
- PROXY_URL # http proxy to use. if USE_PROXY_HOST is enabled will be set to http://PROXY_CONTAINER_NAME:8080
- PROXY_URL_SSL # https proxy to use. if USE_PROXY_HOST is enabled will be set to https://PROXY_CONTAINER_NAME:8080
- PROXY_AUTO_EXPORT_ENV # auto export HTTP_PROXY and HTTPS_PROXY vars equal to PROXY_URL
- DEV_CONTAINER=1.10.8 # used to detect if running inside dev container
- DEV_CONTAINER=1.10.9 # used to detect if running inside dev container
volumes:
- /var/run/docker.sock:/var/run/docker.sock # allow container to interact with host docker
- "${GDC_DIR}:/root/gdc-host" # mount gdc folder inside container to get access to compose files
Expand Down
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ These options control what packages / functionality are built into the container
* USE_BITWARDEN=yes - installs Bitwarden cli and enables NODE_VERSION=18 if NODE_VERSION is not already configured.
* PERSIST_BITWARDEN_SESSION=no - persist bitwarden session to /root/persisted volume and autoload it in subsequent logins. Reduces need to enter master password, but is less secure.
* USE_CDK=USE_AWS - installs aws cdk, terraform, cdk for terraform and enables NODE_VERSION=18 if NODE_VERSION is not already configured. Defaults to value of USE_AWS.
* RUST_VERSION<not set> - installs latest rust and cargo if set to stable or a specific version.
* RUST_VERSION=<not set> - installs latest rust and cargo if set to stable or a specific version.
* CARGO_EXTRA=<not set> - if set should be a quoted space separated list of cargo packages you want installed.
* NODE_VERSION=18 - installs NVM and requested node version.
* USE_LOCALSTACK=yes - enables some localstack helpers.
* USE_LOCALSTACK_PRO=yes - enables localstack pro keys / tokens.
Expand Down

0 comments on commit 408316a

Please sign in to comment.