Skip to content

This is where I keep the Dockerfiles to my Docker image. You can find my Docker images on my dockerhub account: hub.docker.com/u/framaxwlad

Notifications You must be signed in to change notification settings

FBorowiec/docker_images

Repository files navigation

Dockerfile

This is where I keep the Dockerfiles to my Docker image. You can find my Docker images on my dockerhub account: hub.docker.com/u/framaxwlad

My software development image with Ubuntu and Bazel: framaxwlad/ubuntu_dev

docker pull framaxwlad/ubuntu_dev:latest

My Docker image with Ubuntu, Bazel and Jenkins: framaxwlad/jenkins_bazel

docker pull framaxwlad/jenkins_bazel:latest

Building a Dockerfile

This image contains the Bazel build system as well as Jenkins as to experiment with Jenkins functionalities with projects that can be build with Bazel. -t tags the image to the given name.

docker build -f Dockerfile -t framaxwlad/jenkins_bazel .

Running a container of the created Docker image

  • Use the flag --restart unless-stopped to restart the docker everytime until stopped manually.
  • Use the flag --rm to remove the container after stopping.

Prior to executing the container for the first time, chose a folder wher to store the persistent data of the CI:

mkdir ~/jenkins_docker
docker container run -d --rm --name jenkins_ci -p 8080:8080 -p 5000:5000 -v ~/jenkins_docker:/var/lib/jenkins framaxwlad/jenkins_bazel

Docker-compose

Setting-up a docker composition

docker-compose up

Dockerfile validated with:

https://www.fromlatest.io/#/

Useful links:

Future work

Instead of having to create a separate folder and attaching it to the container via -v ~/jenkins_docker:/var/lib/jenkins, I want to be able to mount it directly to a volume created via the docker volume create command:

docker volume create --name=jenkins_docker
sudo chown 1000:1000 /var/lib/docker/volumes/jenkins_docker -R
docker container run -d --rm --name jenkins_ci -p 8080:8080 -p 5000:5000 -v jenkins_docker:/var/lib/jenkins framaxwlad/jenkins_bazel

Where 1000 is the user's ID.

About

This is where I keep the Dockerfiles to my Docker image. You can find my Docker images on my dockerhub account: hub.docker.com/u/framaxwlad

Topics

Resources

Stars

Watchers

Forks