Docker commands - yunkon-kim/test-on-github-actions GitHub Wiki
Docker๋ฅผ ์ฐ๋ค๋ณด๋ฉด ํ์ํ์ง๋ง ์๊ฐ์ด ๋์ง์์ ๊ฒ์ํ๊ฒ ๋๋ Command ์ ๋๋ค. ์์ฃผ ์ฌ์ฉํ๋ ๋ค๋ฅธ Command๋ ์ฌ๊ธฐ์ ์ ๋ฐ์ดํธ ํด์ฃผ์ธ์. ๐
Daemon์ผ๋ก ์คํ๋ Container ์ ์
docker exec -it [CONTAINER ID] /bin/bash
- Reference
- docker container์ ์ ์ํ๊ธฐ(Accessed on 13 May 2020)
Host, Container ๊ฐ ํ์ผ ๋ณต์ฌ
Host to container
docker cp [HOST_PATH] [CONTAINER_NAME or CONTAINER_ID]:[CONTAINER_PATH]
Container to host
docker cp [CONTAINER_NAME or CONTAINER_ID]:[CONTAINER_PATH] [HOST_PATH]
- Reference
- docker cp - ํธ์คํธ ์ปจํ ์ด๋ ์ฌ์ด ํ์ผ ๋ณต์ฌ(Accessed on 13 May 2020)
Use volumes
According to Docker docs, -v or --volume: Consists of three fields, separated by colon characters (:).
The fields must be in the correct order, and the meaning of each field is not immediately obvious.
- In the case of named volumes, the first field is the name of the volume, and is unique on a given host machine. For anonymous volumes, the first field is omitted.
- The second field is the path where the file or directory is mounted in the container.
- The third field is optional, and is a comma-separated list of options, such as ro. These options are discussed below.
docker run -d --name [CONTAINER_NAME] -v [HOST_PATH]:[CONTAINER_PATH] [IMAGE_NAME]
Docker hub์ Container ์ ๋ก๋ํ๊ธฐ
- Reference
- docker container ์ปค๋ฐํ๊ธฐ(Accessed on 22 May 2020)