2021. 12. 31. 17:20ㆍDocker
계정 셋팅
useradd docker
passwd docker
vi /etc/sudoers
# 'docker ALL=(ALL) ALL' 추가
su docker
docker 설치
https://niceman.tistory.com/36
yum -y update
yum -y install docker docker-registry
systemctl enable docker.service
systemctl start docker.service
systemctl status docker.service
docker-compose 설치
https://docs.docker.com/compose/install/
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker-compose --version
unknown flag: --iidfile
docker-compose build 수행시 에러 발생
# 다운그레이드 필요 : root로 실행해야 함(sudo로는 permission 에러 발생) -> 이 방법으로 하면 다른 문제 생김
rm -f /usr/local/bin/docker-compose
curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose
docker-compose --version
# 근본적으로 docker 버전이 낮아서 생긴 문제 : docker -> docker-ce로 변경 필요
docker -v
Docker version 1.13.1, build 7d71120/1.13.1
docker stop 컨테이너명 : 나중에 'docker start 컨테이너명'이 작동하지 않아서 'docker rm 컨테이너명'으로 삭제함
yum remove -y docker-common
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum list docker-ce --showduplicates | sort -r
yum install -y docker-ce
systemctl start docker
systemctl start enable docker.service
docker -v
Docker version 20.10.12, build e91ed57
docker swarm 셋팅
docker swarm init
# worker 등록을 위한 정보 확인
docker swarm join-tocken worker
# worker 등록
docker swarm join --tocken 토큰 manager서버IP:포트
# manager서버 포트가 안 열려 있으면 아래 에러 발생
Error response from daemon: rpc error: code = 14 desc = grpc: the connection is unavailable
manager서버에서 방화벽 오픈 필요
'Docker' 카테고리의 다른 글
Docker 에러 (0) | 2022.01.02 |
---|---|
Docker 명령어 (0) | 2022.01.02 |
InfluxDB 명령어 (0) | 2021.12.26 |
gitlab 설치 (0) | 2021.12.26 |
Windows Docker 설치 (0) | 2021.12.26 |