[DevOps] Setup home lab in docker

For setting the home lab in local network, there has a home server in home before. However, after move to new country the server cannot be start. So I would like to setup the platform in Docker and migrate to home server once finish.

This article mark down the command that to setup devops platform and why I select these tools.

## Docker CE
yum install -y yum-utils
yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce docker-ce-cli containerd.io
systemctl enable docker
systemctl start docker

## Portainer CE
docker volume create portainer-data
docker run --detach \
  --publish 8000:8000 --publish 9000:9000 \
  --name=portainer \
  --restart=always \
  --volume /var/run/docker.sock:/var/run/docker.sock \
  --volume portainer-data:/data \
  portainer/portainer-ce
firewall-cmd --add-port 9000/tcp --permanent
firewall-cmd --reload

## Gitlab CE
export GITLAB_HOME=/srv
docker run --detach \
  --publish 443:443 --publish 80:80 \
  --name gitlab \
  --restart always \
  --volume $GITLAB_HOME/gitlab/config:/etc/gitlab:Z \
  --volume $GITLAB_HOME/gitlab/logs:/var/log/gitlab:Z \
  --volume $GITLAB_HOME/gitlab/data:/var/opt/gitlab:Z \
  gitlab/gitlab-ce:latest
firewall-cmd --add-port 80/tcp --permanent
firewall-cmd --add-port 443/tcp --permanent
firewall-cmd --reload

## Jenkins
docker run --detach \
  --publish 8080:8080 --publish 50000:50000 \
  --name jenkins \
  --restart always \
  --volume jenkins_home:/var/jenkins_home \
  jenkins/jenkins:lts
firewall-cmd --add-port 8080/tcp --permanent
firewall-cmd --reload

 

About C.H. Ling 260 Articles
a .net / Java developer from Hong Kong and currently located in United Kingdom. Thanks for Google because it solve many technical problems so I build this blog as return. Besides coding and trying advance technology, hiking and traveling is other favorite to me, so I will write down something what I see and what I feel during it. Happy reading!!!

Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.