![]() This is only necessary if you have set up one or more inbound Jenkins agents on other machines, which in turn interact with your jenkins-blueocean container, known as the Jenkins "controller". ( Optional ) Maps port 50000 of the current container to port 50000 on the host machine. The first number represents the port on the host, while the last represents the container’s port.įor example, to access Jenkins on your host machine through port 49000, enter -p 49000:8080 for this option. Maps, or publishes, port 8080 of the current container to port 8080 on the host machine. Specifies the environment variables used by docker, docker-compose, and other Docker tools to connect to the Docker daemon from the previous step. The Docker daemon is now available to this Jenkins container through the hostname docker. If you do not specify this option, then the running Docker log for this container is displayed in the terminal window.Ĭonnects this container to the jenkins network previously defined. ( Optional ) Runs the current container in the background, known as "detached" mode, and outputs the container ID. If it is manually stopped, it is restarted only when Docker daemon restarts or the container itself is manually restarted. ( Optional ) Specifies the Docker container name for this instance of the Docker image.Īlways restart the container if it stops. Refer to the Docker storage drivers documentation for supported options. The storage driver for the Docker volume. This is useful for executing docker commands on the host machine to control this inner Docker daemon.ĭownload this image before running, by using the command: docker image pull docker:dind. ( Optional ) Exposes the Docker daemon port on the host machine. This allows for other Docker containers controlled by this Docker container’s Docker daemon to mount data from Jenkins. Maps the /var/jenkins_home directory inside the container to the Docker volume named jenkins-data. Maps the /certs/client directory inside the container to a Docker volume named jenkins-docker-certs as created above. This environment variable controls the root directory where Docker TLS certificates are managed. Makes the Docker in Docker container available as the hostname docker within the jenkins network.Įnables the use of TLS in the Docker server.ĭue to the use of a privileged container, this is recommended, though it requires the use of the shared volume described below. This corresponds with the network created in the earlier step. This requirement may be relaxed with newer Linux kernel versions. ![]() Running Docker in Docker currently requires privileged access to function properly. You can stop this instance by running docker stop jenkins-docker. ( Optional ) Runs the Docker container in the background. ( Optional ) Automatically removes the Docker container (the instance of the Docker image) when it is shut down. ( Optional ) Specifies the Docker container name to use for running the image.īy default, Docker generates a unique name for the container.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |