From a5bb81b7d16429660a9e7b53efbc71c5af2cbb4c Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker <caarlos0@gmail.com> Date: Wed, 6 Jun 2018 10:44:52 -0300 Subject: [PATCH] docs: improve docker docs closes #694 --- www/content/ci.md | 5 +++++ www/content/docker.md | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/www/content/ci.md b/www/content/ci.md index aa73cff5f..05ac62875 100644 --- a/www/content/ci.md +++ b/www/content/ci.md @@ -38,6 +38,11 @@ install: services: - docker +after_success: +# docker login is required if you want to push docker images. +# DOCKER_PASSWORD should be a secret in your .travis.yml configuration. +- test -n "$TRAVIS_TAG" && docker login -u=myuser -p="$DOCKER_PASSWORD" + # calls goreleaser deploy: - provider: script diff --git a/www/content/docker.md b/www/content/docker.md index 9213bfbfd..f2a90881c 100644 --- a/www/content/docker.md +++ b/www/content/docker.md @@ -32,6 +32,10 @@ ENTRYPOINT ["/mybin"] This configuration will build and push a Docker image named `user/repo:tagname`. +> **Attention**: Note that were are not building any go files in the docker +> build phase, we are merely copying the binary to a `scratch` image and +> setting up the entrypoint. + ## Customization Of course, you can customize a lot of things: @@ -117,10 +121,10 @@ dockers: This will build and publish the following images: -- myuser/myimage:v1.6.4 -- myuser/myimage:v1 -- myuser/myimage:v1.6 -- myuser/myimage:latest +- `myuser/myimage:v1.6.4` +- `myuser/myimage:v1` +- `myuser/myimage:v1.6` +- `myuser/myimage:latest` With these settings you can hopefully push several different docker images with multiple tags.