- A working Docker installation – https://store.docker.com/editions/community/docker-ce-desktop-mac
- Google Cloud SDK
gcloud
– https://cloud.google.com/sdk/docs/quickstart-macos
- Ensure you have
~/.bin
directory or similar that is in your$PATH
- Install KD:
curl -L $(curl -s https://api.github.com/repos/voormedia/kd/releases/latest | grep browser_download_url | grep darwin_amd64 | cut -d '"' -f 4) -o ~/.bin/kd && chmod +x ~/.bin/kd
- Install Google Cloud credential helper:
curl -L https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v1.4.3/docker-credential-gcr_darwin_amd64-1.4.3.zip | funzip > ~/.bin/docker-credential-gcr && chmod +x ~/.bin/docker-credential-gcr && docker-credential-gcr configure-docker
- Make sure you have a working
go
installation - Build KD from source:
go install github.com/voormedia/kd
- Install Google Cloud credential helper:
curl -L https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v1.4.3/docker-credential-gcr_darwin_amd64-1.4.3.zip | funzip > ~/.bin/docker-credential-gcr && chmod +x ~/.bin/docker-credential-gcr && docker-credential-gcr configure-docker
- Configure the app to run with an application server (e.g. with
puma
for Rails). - Make your app log to stdout/stderr instead of log files. Preferably in Google cloud compatible JSON.
- Make sure your image is small. Use a two-step build process. Use
.dockerignore
to exclude unused files. - See https://github.com/voormedia/docker-base-images/tree/master/_examples for examples.
- Run
kd init
and input the project details. - Review the generated configuration and adjust where necessary.
- Create a PostgreSQL user and database if necessary. Use the same naming conventions as generated by
kd
in step 2. Create a secret from the service account key.
- Use
kd deploy
to deploy to a target.