Using Docker to build Gitlab-ce

Source: Internet
Author: User
Tags docker run
Docker Build Gitlab-ce

No Internet environment, external Docker pull [image],docker save [Image] > [Image].tar, under LAN Docker load < [Image].tar
First, create an empty container volume to facilitate data backup migration:

sudo docker pull Ubuntu;
sudo docker run \
    --volume/home/fay/gitlabdb/gitlab/config:/etc/gitlab \
    --volume/home/fay/gitlabdb/gitlab /logs:/var/log/gitlab \
    --volume/home/fay/gitlabdb/gitlab/data:/var/opt/gitlab \
    --name fay-gitlabdb Ubuntu/bin/bash

Then create a GITLAB-CE container that uses the above GITLABDB data volume (the GITLABDB is mounted to the container):

sudo docker pull gitlab/gitlab-ce;
sudo docker run--detach \
    --hostname 0.0.0.0 \
    --publish 10443:443--publish 80:80--publish 1022:22 \
    --name FAY-GITLABCE \
    --restart always \
    --volumes-from gitlabdb \
    gitlab/gitlab-ce:latest

Data backup:

sudo docker run--volumes-from gitlabdb \
    -V $ (PWD):/backup ubuntu \
    tar cvf/backup/backup.tar \
    /etc/gitlab /var/log/gitlab/var/opt/gitlab

Data migration:

sudo docker pull BusyBox
sudo docker run \
    --volume/home/fay/gitlabdb/gitlab/config:/etc/gitlab \
    --volume/home/fay/gitlabdb/gitlab /logs:/var/log/gitlab \
    --volume/home/fay/gitlabdb/gitlab/data:/var/opt/gitlab \
    --name fay-gitlabdb Ubuntu/bin/bash
sudo docker run--volumes-from gitlabdb \
    v $ (PWD):/backup busybox \
    tar Xvf/backup/backup.tar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.