使用Docker安装Gitlab
- Install Prerequisites
- Due to a known issue with the dependencies of the docker .deb,
installing docker on a Debian/Ubuntu VM requires an additional step:
apt-get install dmsetup && dmsetup mknodes
- Due to a known issue with the dependencies of the docker .deb,
installing docker on a Debian/Ubuntu VM requires an additional step:
- Install Docker
Use the Docker-maintained install script for Debian or Ubuntu. For other operating systems, see the Docker Installation guides.
- Run:
curl -sSL https://get.docker.com/ | sh
注:The current version of the docker script checks for AUFS support and displays the warning below if support is not found:
Warning: current kernel is not supported by the linux-image-extra-virtual package. We have no AUFS support. Consider installing the packages linux-image-virtual kernel and linux-image-extra-virtual for AUFS support. + sleep 10This message can be safely ignored, as the script will continue the installation using DeviceMapper or OverlayFS. If you require AUFS support, you will need to configure a distribution supplied or custom compiled kernel.
- If necessary, add the non-root user to the “docker”
group:
sudo usermod -aG docker example_user
- Run:
- Run the image
sudo docker run --detach \ --hostname git.eduhe.com \ --publish 443:443 --publish 80:80 --publish 82:82 \ --name gitlab \ --restart always \ --volume /srv/gitlab/config:/etc/gitlab \ --volume /srv/gitlab/logs:/var/log/gitlab \ --volume /srv/gitlab/data:/var/opt/gitlab \ gitlab/gitlab-ce:latest
This will download and start a GitLab CE container and publish ports needed to access SSH, HTTP and HTTPS. All GitLab data will be stored as subdirectories of /srv/gitlab/. The container will automatically restart after a system reboot. - Upgrade GitLab to newer version
- Stop the running container:
sudo docker stop gitlab
- Remove existing container:
udo docker rm gitlab
- Pull the new image:
sudo docker pull gitlab/gitlab-ce:latest
- Create the container once again with previously specified
options:
sudo docker run --detach \ --hostname git.eduhe.com \ --publish 443:443 --publish 80:80 --publish 82:82 \ --name gitlab \ --restart always \ --volume /srv/gitlab/config:/etc/gitlab \ --volume /srv/gitlab/logs:/var/log/gitlab \ --volume /srv/gitlab/data:/var/opt/gitlab \ gitlab/gitlab-ce:latest
- Stop the running container: