Skip to content

Instantly share code, notes, and snippets.

@yoomlam
Last active May 17, 2023 22:07
Show Gist options
  • Save yoomlam/11a0bf461ff046b8e8b7526cecfe4931 to your computer and use it in GitHub Desktop.
Save yoomlam/11a0bf461ff046b8e8b7526cecfe4931 to your computer and use it in GitHub Desktop.
abd-vro setup
# For M2 Mac
# Install brew
brew install asdf
echo -e "\n. $(brew --prefix asdf)/libexec/asdf.sh" >> ${ZDOTDIR:-~}/.zshrc
asdf plugin-add java
asdf install java adoptopenjdk-17.0.3+7
asdf global java adoptopenjdk-17.0.3+7
asdf current
java --version
asdf plugin-add python
asdf install python 3.10.2
asdf global python 3.10.2
asdf current
python --version
# needed for yarn
asdf plugin add nodejs
asdf install nodejs latest
asdf global nodejs latest
asdf plugin-add yarn
brew install gpg
asdf install yarn latest
asdf global yarn latest
asdf current
yarn --version
brew install gh
gh auth login
gh repo clone department-of-veterans-affairs/abd-vro
gh repo clone department-of-veterans-affairs/abd-vro-dev-secrets
brew install hadolint
hadolint --version
#yarn global add @stoplight/spectral-cli
npm install -g @stoplight/spectral-cli@6.4.0
brew install shellcheck
# https://github.com/tinkink-net/tutorials/blob/master/docs/en/mac/how-to-use-docker-on-m1-mac.md#colima
brew install docker
brew install colima
colima start --arch aarch64 --vm-type=vz --mount-type=virtiofs --cpu 4 --memory 8
colima status
# Consider https://github.com/abiosoft/colima/issues/204
# TODO: try https://github.com/tinkink-net/tutorials/blob/master/docs/en/mac/how-to-use-docker-on-m1-mac.md#orbstack
docker version
# To create an separate Colima profile `vz`
colima -p vz start --arch aarch64 --vm-type=vz --mount-type=virtiofs --cpu 4 --memory 8
docker context list
docker context use colima-vz
brew install docker-buildx
mkdir -p ~/.docker/cli-plugins
ln -sfn $(brew --prefix)/opt/docker-buildx/bin/docker-buildx ~/.docker/cli-plugins/docker-buildx
# Set Buildx as the default builder https://docs.docker.com/build/install-buildx/#set-buildx-as-the-default-builder
docker buildx install
# Pull ARM64 images for Apple Silicon chips
for IMAGE in redis rabbitmq:3-management postgres:14.7-alpine flyway/flyway:9.17-alpine python:3.10-alpine; do
docker pull --platform linux/arm64 $IMAGE
done
# Pull AMD64 images for these images that don't have ARM64 variants
for IMAGE in eclipse-temurin:17-jre-alpine; do
docker pull --platform linux/amd64 $IMAGE
done
export DOCKER_DEFAULT_PLATFORM=linux/amd64
./gradlew docker
# Check image architecture
imageArchs(){
docker images --format "{{.ID}} {{.Repository}} {{.Tag}}" | while read i r t; do
echo "$i\t"`docker image inspect $i |grep "Architecture"`"\t$r\t$t"
done
}
imageArchs
brew install docker-compose
ln -sfn $(brew --prefix)/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment