Skip to content

Instantly share code, notes, and snippets.

@mathew-fleisch
Last active July 7, 2020 13:51
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 mathew-fleisch/5b8219f1e499477ffbd3a7fc297373f4 to your computer and use it in GitHub Desktop.
Save mathew-fleisch/5b8219f1e499477ffbd3a7fc297373f4 to your computer and use it in GitHub Desktop.
Dependency Installer
# Goal: install java11, maven, gradle, kops and terraform in an empty ubuntu docker container
############################# From Host #############################
# Remove previous tests if present
[ -n "$(docker ps -q --filter name=test-dependency-installer)" ] \
&& docker rm -f $(docker ps -q --filter name=test-dependency-installer);
# Spin up empty docker ubuntu container
docker run -dit --name test-dependency-installer ubuntu:latest
docker exec -it $(docker ps -q --filter name=test-dependency-installer) /bin/bash
############################# From Host #############################
############################# In Container #############################
# Bootstrap dependency installer (requires curl)
apt-get update && apt-get install -y curl \
&& curl -s https://s3.amazonaws.com/download.draios.com/dependencies/get-dependency-installer.sh | bash
cd dependency-installer
# Install example-dependencies.yaml
cat example-dependencies.yaml
./installer.sh example-dependencies.yaml
# Note: JAVA_HOME is not set in the installation session.
# Exiting and reentering the container will accomplish the same as:
source /etc/profile.d/jdk.sh
# Verify dependencies were installed
java -version
mvn -version
gradle -version
kops version
terraform -version
############################# In Container #############################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment