summaryrefslogtreecommitdiff
path: root/doc/ci/docker
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-30 15:09:15 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-30 15:09:15 +0000
commit536aa3a1f4b96abc4ca34489bf2cbe503afcded7 (patch)
tree88d08f7dfa29a32d6526773c4fe0fefd9f2bc7d1 /doc/ci/docker
parent50ae4065530c4eafbeb7c5ff2c462c48c02947ca (diff)
downloadgitlab-ce-536aa3a1f4b96abc4ca34489bf2cbe503afcded7.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/ci/docker')
-rw-r--r--doc/ci/docker/using_docker_build.md26
-rw-r--r--doc/ci/docker/using_docker_images.md16
-rw-r--r--doc/ci/docker/using_kaniko.md2
3 files changed, 22 insertions, 22 deletions
diff --git a/doc/ci/docker/using_docker_build.md b/doc/ci/docker/using_docker_build.md
index b7d708b152e..2750e61ff96 100644
--- a/doc/ci/docker/using_docker_build.md
+++ b/doc/ci/docker/using_docker_build.md
@@ -16,7 +16,7 @@ One of the new trends in Continuous Integration/Deployment is to:
It's also useful when your application already has the `Dockerfile` that can be
used to create and test an image:
-```bash
+```shell
docker build -t my-image dockerfiles/
docker run my-image /script/to/run/tests
docker tag my-image my-registry:5000/my-image
@@ -48,7 +48,7 @@ GitLab Runner then executes job scripts as the `gitlab-runner` user.
1. During GitLab Runner installation select `shell` as method of executing job scripts or use command:
- ```bash
+ ```shell
sudo gitlab-runner register -n \
--url https://gitlab.com/ \
--registration-token REGISTRATION_TOKEN \
@@ -63,13 +63,13 @@ GitLab Runner then executes job scripts as the `gitlab-runner` user.
1. Add `gitlab-runner` user to `docker` group:
- ```bash
+ ```shell
sudo usermod -aG docker gitlab-runner
```
1. Verify that `gitlab-runner` has access to Docker:
- ```bash
+ ```shell
sudo -u gitlab-runner -H docker info
```
@@ -160,7 +160,7 @@ support this.
1. Register GitLab Runner from the command line to use `docker` and `privileged`
mode:
- ```bash
+ ```shell
sudo gitlab-runner register -n \
--url https://gitlab.com/ \
--registration-token REGISTRATION_TOKEN \
@@ -320,7 +320,7 @@ In order to do that, follow the steps:
1. Register GitLab Runner from the command line to use `docker` and share `/var/run/docker.sock`:
- ```bash
+ ```shell
sudo gitlab-runner register -n \
--url https://gitlab.com/ \
--registration-token REGISTRATION_TOKEN \
@@ -384,7 +384,7 @@ aware of the following implications:
work as expected since volume mounting is done in the context of the host
machine, not the build container. For example:
- ```sh
+ ```shell
docker run --rm -t -i -v $(pwd)/src:/home/app/src test-image:latest run_app_tests
```
@@ -458,13 +458,13 @@ which can be avoided if a different driver is used, for example `overlay2`.
1. Make sure a recent kernel is used, preferably `>= 4.2`.
1. Check whether the `overlay` module is loaded:
- ```sh
+ ```shell
sudo lsmod | grep overlay
```
If you see no result, then it isn't loaded. To load it use:
- ```sh
+ ```shell
sudo modprobe overlay
```
@@ -542,7 +542,7 @@ For all projects, mostly suitable for public ones:
your Docker images and has read/write access to the Registry. This is ephemeral,
so it's only valid for one job. You can use the following example as-is:
- ```sh
+ ```shell
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
```
@@ -557,7 +557,7 @@ For private and internal projects:
Replace the `<username>` and `<access_token>` in the following example:
- ```sh
+ ```shell
docker login -u <username> -p <access_token> $CI_REGISTRY
```
@@ -567,7 +567,7 @@ For private and internal projects:
Once created, you can use the special environment variables, and GitLab CI/CD
will fill them in for you. You can use the following example as-is:
- ```sh
+ ```shell
docker login -u $CI_DEPLOY_USER -p $CI_DEPLOY_PASSWORD $CI_REGISTRY
```
@@ -602,7 +602,7 @@ assuming you have it configured with [TLS enabled](#tls-enabled):
If you forget to set the service alias, the `docker:19.03.1` image won't find the
`dind` service, and an error like the following is thrown:
-```sh
+```shell
$ docker info
error during connect: Get http://docker:2376/v1.39/info: dial tcp: lookup docker on 192.168.0.1:53: no such host
```
diff --git a/doc/ci/docker/using_docker_images.md b/doc/ci/docker/using_docker_images.md
index 8c6069bd939..630beec453c 100644
--- a/doc/ci/docker/using_docker_images.md
+++ b/doc/ci/docker/using_docker_images.md
@@ -28,7 +28,7 @@ to use the `docker` executor.
A one-line example can be seen below:
-```bash
+```shell
sudo gitlab-runner register \
--url "https://gitlab.example.com/" \
--registration-token "PROJECT_REGISTRATION_TOKEN" \
@@ -559,7 +559,7 @@ There are two ways to determine the value of `DOCKER_AUTH_CONFIG`:
- **First way -** Do a `docker login` on your local machine:
- ```bash
+ ```shell
docker login registry.example.com:5000 --username my_username --password my_password
```
@@ -568,7 +568,7 @@ There are two ways to determine the value of `DOCKER_AUTH_CONFIG`:
If you don't need access to the registry from your computer, you
can do a `docker logout`:
- ```bash
+ ```shell
docker logout registry.example.com:5000
```
@@ -579,7 +579,7 @@ There are two ways to determine the value of `DOCKER_AUTH_CONFIG`:
`${username}:${password}` and create the Docker configuration JSON manually.
Open a terminal and execute the following command:
- ```bash
+ ```shell
echo -n "my_username:my_password" | base64
# Example output to copy
@@ -790,7 +790,7 @@ able to run Docker with your regular user account.
First start with creating a file named `build_script`:
-```bash
+```shell
cat <<EOF > build_script
git clone https://gitlab.com/gitlab-org/gitlab-runner.git /builds/gitlab-org/gitlab-runner
cd /builds/gitlab-org/gitlab-runner
@@ -805,7 +805,7 @@ is specific to your project.
Then create some service containers:
-```sh
+```shell
docker run -d --name service-mysql mysql:latest
docker run -d --name service-postgres postgres:latest
```
@@ -817,7 +817,7 @@ respectively. They will both run in the background (`-d`).
Finally, create a build container by executing the `build_script` file we
created earlier:
-```sh
+```shell
docker run --name build -i --link=service-mysql:mysql --link=service-postgres:postgres ruby:2.6 /bin/bash < build_script
```
@@ -829,7 +829,7 @@ piped using STDIN to the bash interpreter which in turn executes the
When you finish testing and no longer need the containers, you can remove them
with:
-```sh
+```shell
docker rm -f -v build service-mysql service-postgres
```
diff --git a/doc/ci/docker/using_kaniko.md b/doc/ci/docker/using_kaniko.md
index 45afd9c6223..dce5cd5b40d 100644
--- a/doc/ci/docker/using_kaniko.md
+++ b/doc/ci/docker/using_kaniko.md
@@ -72,7 +72,7 @@ build:
When trying to push to a Docker registry that uses a certificate that is signed
by a custom CA, you might get the following error:
-```sh
+```shell
$ /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --no-push
INFO[0000] Downloading base image registry.gitlab.example.com/group/docker-image
error building image: getting stage builder for stage 0: Get https://registry.gitlab.example.com/v2/: x509: certificate signed by unknown authority