ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [Linux] ๋ฆฌ๋ˆ…์Šค์— Docker, Docker Compose ์„ค์น˜
    ๐Ÿ’ปProgramming/Linux 2024. 2. 4. 18:34

    Docker ์„ค์น˜

    # ์„ค์น˜
    curl -fsSL https://get.docker.com/ | sh
    
    # Docker ์„œ๋น„์Šค ์‹œ์ž‘
    sudo systemctl start docker
    
    # Docker ์„œ๋น„์Šค ์ž‘๋™ ์ƒํƒœ ํ™•์ธ
    sudo systemctl status docker
    
    # Docker ์„œ๋น„์Šค๋ฅผ ์šด์˜์ฒด์ œ ๋ถ€ํŒ…์‹œ ์ž๋™ ์‹œ์ž‘ํ•˜๋„๋ก ์„ค์ •(์šด์˜์ฒด์ œ๊ฐ€ ์ค‘์ง€๋˜๋Š” ๊ฒฝ์šฐ docker๋„ ์ข…๋ฃŒ๋˜๊ธฐ ๋•Œ๋ฌธ)
    sudo systemctl enable docker
    
    # docker ๋ช…๋ น์–ด๋ฅผ sudo ์—†์ด ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด ๊ณ„์ •์„ docker ๊ทธ๋ฃน์— ์†Œ์† (๊ณ„์ • ์žฌ์ ‘์† ํ•„์š”)
    sudo usermod -aG docker $USER
    newgrp docker
    
    # ์„ค์น˜ ํ™•์ธ
    docker --version

     

    Docker Compose ์„ค์น˜

    # Docker Compose ์„ค์น˜
    sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
    
    # Docker Compose ์‹คํ–‰ ๊ถŒํ•œ ๋ถ€์—ฌ
    sudo chmod +x /usr/local/bin/docker-compose
    
    # ์„ค์น˜๋œ Docker Compose ์‹คํ–‰ ํ™•์ธ
    docker-compose --version
    Docker Compose version v2.20.2

     

    Docker Hub ๋กœ๊ทธ์ธ

    # ๊ธฐ์กด ์ €์žฅ๋œ ์ธ์ฆ ์ •๋ณด๋ฅผ ์‚ญ์ œ
    rm ~/.docker/config.json
    
    # ๊ธฐ์กด ๋กœ๊ทธ์ธ๋˜์–ด ์žˆ๋‹ค๋ฉด ๋กœ๊ทธ์•„์›ƒ
    docker logout
    
    # DockerHub ์‚ฌ์šฉ์ž๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด ๋กœ๊ทธ์ธ
    docker login
    
    # ํ† ํฐ์ด ์žˆ๋Š” ๊ฒฝ์šฐ ํŒจ์Šค์›Œ๋“œ์— ํ† ํฐ ์ ์–ด์ค˜์•ผํ•จ. ํŒจ์Šค์›Œ๋“œ ์ ์–ด์ฃผ๋ฉด ๋กœ๊ทธ์ธ ์•ˆ๋จ.
    Username:
    Password:

     

     

    References

    https://ruungji.tistory.com/entry/Linux-Deploy-sudo-add-apt-repository-command-not-found

    '๐Ÿ’ปProgramming > Linux' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

    [Linux] ubuntu nginx ์ง€์šฐ๊ณ  ๋‹ค์‹œ ์„ค์น˜ํ•˜๊ธฐ  (0) 2024.01.24
Designed by Tistory.