Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
288be086
Commit
288be086
authored
Jun 28, 2018
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve documentation of how to build Docker Images with GitLab CI
parent
9ad97abf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
doc/ci/docker/using_docker_build.md
doc/ci/docker/using_docker_build.md
+21
-2
No files found.
doc/ci/docker/using_docker_build.md
View file @
288be086
...
...
@@ -134,9 +134,20 @@ In order to do that, follow the steps:
```yaml
image: docker:stable
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
variables:
# When using dind service we need to instruct docker, to talk with the
# daemon started inside of the service. The daemon is available with
# a network connection instead of the default /var/run/docker.sock socket.
#
# The 'docker' hostname is the alias of the service container as described at
# https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#accessing-the-services
#
# Note that if you're using Kubernetes executor, the variable should be set to
# tcp://localhost:2375 because of how Kubernetes executor connects services
# to the job container
DOCKER_HOST: tcp://docker:2375/
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
DOCKER_DRIVER: overlay2
services:
...
...
@@ -293,6 +304,7 @@ services:
variables
:
CONTAINER_IMAGE
:
registry.gitlab.com/$CI_PROJECT_PATH
DOCKER_HOST
:
tcp://docker:2375
DOCKER_DRIVER
:
overlay2
before_script
:
...
...
@@ -391,6 +403,9 @@ could look like:
image
:
docker:stable
services
:
-
docker:dind
variables
:
DOCKER_HOST
:
tcp://docker:2375
DOCKER_DRIVER
:
overlay2
stage
:
build
script
:
-
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.example.com
...
...
@@ -410,6 +425,8 @@ services:
-
docker:dind
variables
:
DOCKER_HOST
:
tcp://docker:2375
DOCKER_DRIVER
:
overlay2
IMAGE_TAG
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
before_script
:
...
...
@@ -445,6 +462,8 @@ stages:
-
deploy
variables
:
DOCKER_HOST
:
tcp://docker:2375
DOCKER_DRIVER
:
overlay2
CONTAINER_TEST_IMAGE
:
registry.example.com/my-group/my-project/my-image:$CI_COMMIT_REF_NAME
CONTAINER_RELEASE_IMAGE
:
registry.example.com/my-group/my-project/my-image:latest
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment