Skip to content
bohyeon edited this page Dec 12, 2019 · 7 revisions

docker

κ°œλ… 곡뢀 및 μ‹€μŠ΅

nCloud에 docker μ„€μΉ˜

  • https://docs.docker.com/install/linux/docker-ce/ubuntu
  • μ„€μΉ˜ 쀑 μ°Έκ³ 
    • $ sudo apt-get install docker-ce=5:18.09.1~3-0~ubuntu-xenial docker-ce-cli=5:18.09.1~3-0~ubuntu-xenial containerd.io

      λ¬Έμ„œ 쀑 'Install a specific version using the version string from the second column, for example'μ—μ„œλŠ” μœ„μ™€κ°™μ΄ μž…λ ₯ν•΄μ£Όλ©΄ λœλ‹€.

    • OS requirements 쀑 Disco 19.04, Cosmic 18.10, Bionic 18.04 (LTS), Xenial 16.04 (LTS)듀은 ubuntu version λ“€μ˜ 별칭이닀.

docker-compose

μ°Έκ³ 

docker-mysql

ν•΄κ²°ν•΄μ•Όν•  것듀

  • volume 섀정이 아쉽닀. μ •ν™•ν•˜κ²Œ μ•Œμ•„μ•Όν•¨
  • dockerλ₯Ό μ΄μš©ν•΄ nCloud μ„œλ²„μ— mysql μ„œλ²„ μ‹€ν–‰ν•˜κΈ°
    • lucas에 μ˜¬λΌμ™€μžˆλ˜ Mysql 섀정등도 μžλ™μœΌλ‘œ μ μš©ν•˜λ„λ‘ Dockerfile을 λ§Œλ“€μ–΄μ£Όλ©΄ 쒋을 것 κ°™λ‹€.

기타

  • docker ps μ—μ„œ ps? : process status의 μ•½μž. displays currently-running processes
  • port : docker run -p 8080:80 name
    • -p [Host]:[Container]
    • 확인 : docker port name
  • volume
    • version: '3'
        services:
          web:
            build: .
            ports:
              - "5000:5000"
            volumes:
              - .:/code
            environment:
              FLASK_ENV: development
          redis:
            image: "redis:alpine"
      
    • host의 . directory와 container의 /code directory λ₯Ό mount ν•œλ‹€.

    • volumesλŠ” μ™œ ν•„μš”ν•œκ°€?

      • λ‘œμ»¬μ— λ­”κ°€λ₯Ό μ €μž₯ν•  ν•„μš”κ°€ μžˆλ‹€κ³  ν•˜λ©΄ mountν•  ν•„μš”κ°€ μžˆλ‹€. κ³  보면 될 것이닀. (from μ§€μˆ˜, almost 100% official)
      • Volumes are easier to back up or migrate than bind mounts.
      • In addition, volumes are often a better choice than persisting data in a container’s writable layer, because a volume does not increase the size of the containers using it, and the volume’s contents exist outside the lifecycle of a given container.
      • μ°Έκ³  : https://docs.docker.com/compose/gettingstarted/#step-5-edit-the-compose-file-to-add-a-bind-mount
    • redisμ—μ„œλŠ” volume이 ν•„μš”ν• κΉŒ?

      • If persistence is enabled, data is stored in the VOLUME /data, which can be used with --volumes-from some-volume-container or -v /docker/host/dir:/data (see docs.docker volumes).
      • μ°Έκ³  : https://hub.docker.com/_/redis

μ°Έκ³ 

Clone this wiki locally