Linux installation docker Docker installation gitlab

## Centos7 installation Docker
`` `
# requirements CentOS system kernel version 3.10 or higher, to view the prerequisites of this page to verify your CentOS version supports Docker
1, check your current version of the kernel by uname -r command
uname -r
2, log on Centos with root privileges. Ensure that the yum package up to date.
Update -y yum
3, uninstall the old version (if an old version is installed)
yum-the Remove the Common Docker Docker Docker Docker-SELinux-Engine
4, install the required packages, yum-util provide yum-config-manager function, the other two one is dependent devicemapper driving
yum the install yum-utils devicemapper -Y-Data-persistent LVM2
. 5, the source provided yum
yum-config-manager --add-repo https://download.docker.com/linux/centos/ ce.repo-docker
6, you can view all versions of all warehouse docker, and choose a specific version to install
yum List docker-ce --showduplicates | -r the Sort
7, install docker
sudo yum install -y docker-ce # default because the repo open only stable warehouse, so here to install the latest stable version 18.03.1
8, start and join the boot
systemctl Start docker
systemctl enable docker
9, verify that the installation was successful (there are two parts, client service and installation start indicate docker are successful)
docker Version

```

## Ubuntu18.04 installation Docker
`` `
# The first method directly download and install from the Ubuntu repository:
$ sudo APT install docker.io
$ sudo systemctl Start Docker
$ sudo systemctl enable Docker
# see if the installation was successful
$ Docker -v
# Docker version 17.12.1-ce, build 7390fc6

The second method Docker download and install from the warehouse:
This installation must first ensure that Ubuntu server can access Docker warehouse address: https: //download.docker.com/linux/ubuntu, if we can access, in accordance with the following steps to install .
Update the sudo APT $
$ APT the install the sudo APT-Transport-CA-HTTPS Certificates Software-curl-Common Properties
# file, add the following in /etc/apt/sources.list.d/docker.list content
deb [arch = amd64] https : //download.docker.com/linux/ubuntu Bionic stable
# add keys
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo APT the Add-Key -
$ sudo APT Update
# installation ce-Docker
$ sudo install APT Docker-ce
# to see if the installation was successful:
$ --version Docker
Docker Version 18.03.0-ce, Build 0520e24
`` `


### docker mounting gitlab
`` `
1.pull mirror Chinese Language:
Docker pull beginor / gitlab-CE
2. Run:
will usually GitLab configuration (etc), log (log), data (data) into the container In addition, to facilitate future upgrades, so please prepare three directories.

-p mkdir / usr / local / gitlab / etc
mkdir -p / usr / local / gitlab / log
mkdir -p / usr / local / gitlab / the Data
After preparing the three directories, you can begin to run Docker mirrored. My suggestion is to use unless-stopped as the restart strategy, because it can be manually stop the container, and easy maintenance.
Complete run the following command:

docker run --detach --publish 8443: 443 --publish 8080: 80 --name gitlab --restart unless-stopped --volume / mnt / sda1 / gitlab / etc: / etc / gitlab --volume / mnt / sda1 / gitlab / log: / var / log / gitlab --volume / mnt / sda1 / gitlab / Data: / var / opt / gitlab --privileged = beginor to true / gitlab-CE
--publish: 443 mapped to an external port 8443
--publish 8080: 80: 80 mapped to an external port 8080
--name gitlab run container name
--restart unless-stopped restart strategy
--volume / usr / local / gitlab / etc: / etc / gitlab mount directory
- volume / usr / local / gitlab / log: / var / log / gitlab mounted directory
--volume / usr / local / gitlab / data: / var / opt / gitlab mount directory
--privileged = true root within the container such that It has a real root privileges. Otherwise, root inside a container just outside of normal user privileges

3. Access:
Open your browser: ip address: 8080 (http://192.168.106.128:8080/)

Upgrade
(for example, upgrading from 8.8.2 to 8.8.3), referring to the official description small version upgrade, the original vessel stopped and then deleted:

docker stop gitlab
docker rm gitlab

Then again pull down a new version of the image:

docker pull beginor/gitlab-ce

Also use the Run command to run the original:

docker run
--detach
--publish 8443:443
--publish 8080:80
--name gitlab
--restart unless-stopped
--volume /mnt/sda1/gitlab/etc:/etc/gitlab
--volume /mnt/sda1/gitlab/log:/var/log/gitlab
--volume /mnt/sda1/gitlab/data:/var/opt/gitlab
beginor/gitlab-ce

Major version upgrade (for example, upgrading from 8.7.x to 8.8.x) is possible with the above operation error occurs, if an error occurs, you can try to log on to the interior of the container, you can use docker exec, you can also use ssh, in turn execute the following command :

gitlab-ctl reconfigure
gitlab-ctl restart

```

### docker maven PW build the Nexus
`` `
1. Download the image of a nexus3
Docker pull Sonatype / nexus3
2. The inner container / var / nexus-data to the host to mount / root / nexus-data directory.
8081 RUN -d -p Docker: 8081 --name Nexus -v / the root / Nexus-Data: / var / Nexus-Data --restart = Always Sonatype / nexus3
3. into the container
docker exec -it 775c7c9ee1e1 / bin / bash
4. Check the password
cat /nexus-data/admin.password

```

Add ### docker aliyun mirror acceleration
`` `
the sudo mkdir -p / etc / Docker
the sudo TEE /etc/docker/daemon.json << - 'the EOF'
{
" Registry-Mirrors ": [" HTTPS: // ho61rkj01 .mirror.aliyuncs.com "]
}
the EOF
the sudo systemctl-daemon reload
the sudo systemctl the restart Docker
` ``

Guess you like

Origin www.cnblogs.com/zmsn/p/12121471.html