๐Ÿณ EC2์— docker , docker-compose ์„ค์น˜ํ•˜๊ธฐ

2021. 4. 30. 16:00ใ†๐ŸŒฑ Develop/devOps

1๏ธโƒฃ docker,  docker-compose ์„ค์น˜

โœ… ๋„์ปค ์„ค์น˜ํ•˜๊ธฐ

sudo yum install docker   // linux
sudo apt-get install docker   // ubuntu
โœ… docker-compose ์„ค์น˜ํ•˜๊ธฐ

$ sudo curl -L https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
$ docker-compose --version 

๐Ÿ‘‰ docker-compose ์ตœ์‹  ๋ฒ„์ „์€ ์—ฌ๊ธฐ์„œ ํ™•์ธํ•ด์„œ ๋งํฌ๋ฅผ ๋ฐ”๊พธ๋ฉด ๋œ๋‹ค. 

 

 

2๏ธโƒฃ docker hub ๋กœ๊ทธ์ธ

docker, docker-compose๋ฅผ ๋ชจ๋‘ ์„ค์น˜ํ–ˆ๋‹ค๋ฉด docker hub์—์„œ ์ด๋ฏธ์ง€๋ฅผ pull ๋ฐ›์•„์˜ฌ ์ˆ˜ ์žˆ๋„๋ก ๋กœ๊ทธ์ธ์„ ํ•ด์ค๋‹ˆ๋‹ค. ์•„์ง ํšŒ์›๊ฐ€์ž…์„ ํ•˜์ง€ ์•Š์•˜๋‹ค๋ฉด, docker hub ์—์„œ ํšŒ์›๊ฐ€์ž…์„ ํ•ด์ฃผ์„ธ์š”! 

docker login // ๋„์ปค ํ—ˆ๋ธŒ ๊ฐ€์ž…ํ•œ ์•„์ด๋””, ๋น„๋ฒˆ ์น˜๊ณ  ๋กœ๊ทธ์ธํ•˜๊ธฐ

 

 

 

๐Ÿค” docker login ์‹œ ์ด๋Ÿฐ ์—๋Ÿฌ๊ฐ€ ๋‚œ๋‹ค๋ฉด!

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? 

ot permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/auth: dial unix /var/run/docker.sock: connect: permission denied

 

ํ•ด๋‹น ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด docker.sock์— ๊ถŒํ•œ์„ ๋ถ€์—ฌํ•ด์ค๋‹ˆ๋‹ค.

sudo chmod 666 /var/run/docker.sock

 

๐Ÿ“š ์ฐธ๊ณ : https://github.com/occidere/TIL/issues/116