Linux에서 인트라넷에 도커를 설치하는 방법

王林
풀어 주다: 2020-04-15 15:34:13
원래의
3870명이 탐색했습니다.

Linux에서 인트라넷에 도커를 설치하는 방법

1. 기본 환경

1. 운영체제: CentOS 7.3

2. Docker 설치

1. 압축이 풀린 docker 파일의 내용을 이동합니다. /usr/bin/ 디렉터리

tar -xvf docker-18.06.1-ce.tgz
로그인 후 복사

3. docker를 service

cp docker/* /usr/bin/
로그인 후 복사

로 등록합니다. docker.service에 다음 구성을 추가하고 저장합니다.

vim /etc/systemd/system/docker.service
로그인 후 복사

4. 시작

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
 
[Install]
WantedBy=multi-user.target
로그인 후 복사

5. 확인

chmod +x /etc/systemd/system/docker.service    #添加文件权限并启动docker
systemctl daemon-reload    #重载unit配置文件
systemctl start docker    #启动Docker
systemctl enable docker.service  #设置开机自启
로그인 후 복사

추천 튜토리얼:

docker 튜토리얼

위 내용은 Linux에서 인트라넷에 도커를 설치하는 방법의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!