$ git clone https://github.com/codestates/pacman-canvas
$ docker container run --name [container name] -p 818:80 httpd
$ docker-machine ip default// 해당 가상머신의 ip주소 나옴
192.168.99.100
Last login: Sat Sep 18 16:47:12 on ttys000
$ docker cp ~/Documents/codestates/week15/pacman-canvas/ httpd:/usr/local/apache2/htdocs
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? // 새로운 터미널에서 가상 머신 선택안해서 발생한 오류
$ docker-machine env dev // dev 가상머신 쉘 생성
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="/Users/siwoo/.docker/machine/machines/dev"
export DOCKER_MACHINE_NAME="dev"
# Run this command to configure your shell:
# eval $(docker-machine env dev)
$ eval $(docker-machine env dev) // 쉘 실행
$ docker cp ~/Documents/codestates/week15/pacman-canvas/ httpd:/usr/local/apache2/htdocs
Error: No such container:path: httpd:/usr/local/apache2
// 컨테이너명 오입력
$ docker cp ~/Documents/codestates/week15/pacman-canvas/ httpdserver:/usr/local/apache2/htdocs
//전체 경로명으로 입력했을시 적용이 안됨
$ docker container cp ./ httpdserver:/usr/local/apache2/htdocs
// 파일 경로로 이동 후 복사 시도 성공
$ docker exec -it httpdserver bash
root@c14c5721068f:/usr/local/apache2# cd htdocs
root@c14c5721068f:/usr/local/apache2/htdocs# ls
Dockerfile img pacman-canvas.js
README.md index.html pacman-canvas.test.js
ads.txt js pacman-canvas.webapp
bump_version.sh manifest.json server.js
cache.manifest mp3 style.css
data package-lock.json wav
fonts package.json web-app-manifest.json
googlee6aee5a894225e60.html pacman-canvas webpack.config.js
httpd.conf pacman-canvas.css
$ docker container commit httpdserver my_pacman:1.0
sha256:dbd547c679bc290e02b2b7c7677357729a853d38e1ca6fe1b302be7cbff3b4be
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
my_pacman 1.0 dbd547c679bc 28 minutes ago 172MB
httpd latest f34528d8e714 2 weeks ago 138MB
$ docker run --name my_web2 -p 900:80 my_pacman:1.0
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
[Sat Sep 18 10:23:01.138645 2021] [mpm_event:notice] [pid 1:tid 140573721932928] AH00489: Apache/2.4.48 (Unix) configured -- resuming normal operations
[Sat Sep 18 10:23:01.145361 2021] [core:notice] [pid 1:tid 140573721932928] AH00094: Command line: 'httpd -D FOREGROUND'
192.168.99.1 - - [18/Sep/2021:10:23:10 +0000] "GET / HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:10 +0000] "GET /style.css HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:10 +0000] "GET /pacman-canvas.css HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:10 +0000] "GET /js/jquery.hammer.min.js HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:10 +0000] "GET /js/jquery-1.10.2.min.js HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:11 +0000] "GET /img/inky.svg HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:11 +0000] "GET /pacman-canvas.js HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:11 +0000] "GET /img/instructions/instructions_scatter.PNG HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:11 +0000] "GET /img/bg-pattern-black.png HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:11 +0000] "GET /img/audio-icon.png HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:11 +0000] "GET /img/clyde.svg HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:11 +0000] "GET /img/pinky.svg HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:11 +0000] "GET /img/blinky.svg HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:11 +0000] "GET /fonts/PressStart2Play.woff HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:12 +0000] "GET /img/instructions/instructions_chase.PNG HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:12 +0000] "GET /img/instructions/instructions_powerpill.PNG HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:12 +0000] "GET /img/audio-icon-mute.png HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:12 +0000] "GET /img/platzh1rsch-logo.png HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:12 +0000] "GET /wav/theme.wav HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:13 +0000] "GET /data/map.json HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:13 +0000] "GET /wav/waka.wav HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:13 +0000] "GET /wav/powerpill.wav HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:13 +0000] "GET /wav/die.wav HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:15 +0000] "GET /img/heart.png HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:15 +0000] "GET /img/dazzled.svg HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:15 +0000] "GET /img/dazzled2.svg HTTP/1.1" 304 -
192.168.99.1 - - [18/Sep/2021:10:23:16 +0000] "GET /img/dead.svg HTTP/1.1" 304 -
$ docker build . --tag my_pacman:2.0
#. 현재 경로의 있는 Dockerfile을 찾아서 빌드
# --tag: name:tag 형식으로 이미지 생성
Sending build context to Docker daemon 17.29MB
Step 1/3 : FROM httpd:2.4 # 베이스 이미지를 httpd:2.4로 사용
---> f34528d8e714
Step 2/3 : WORKDIR /usr/local/apache2
---> Running in 8d73821600bd
Removing intermediate container 8d73821600bd
---> be18cfb9f7c4
Step 3/3 : COPY ./ /usr/local/apache2/htdocs/ #호스트의 현재 경로에 있는 파일 해당경로에 복사
---> 48620c6c43b0
Successfully built 48620c6c43b0
Successfully tagged my_pacman:2.0
(base) bagsiuui-MacBook-Pro:pacman-canvas siwoo$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
my_pacman 2.0 48620c6c43b0 About an hour ago 155MB
my_pacman 1.0 dbd547c679bc 3 hours ago 172MB
httpd 2.4 f34528d8e714 2 weeks ago 138MB
httpd latest f34528d8e714 2 weeks ago 138MB
# 이미지에 my_pacman:2.0이 생성된 걸 확인
$ docker run --name my_web3 -p 901:80 my_packman:2.0
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
[Sat Sep 18 11:58:24.634424 2021] [mpm_event:notice] [pid 1:tid 140486022722688] AH00489: Apache/2.4.48 (Unix) configured -- resuming normal operations
[Sat Sep 18 11:58:24.654023 2021] [core:notice] [pid 1:tid 140486022722688] AH00094: Command line: 'httpd -D FOREGROUND'
# 터미널 상황
192.168.99.1 - - [18/Sep/2021:11:58:49 +0000] "GET / HTTP/1.1" 200 10268
192.168.99.1 - - [18/Sep/2021:11:58:50 +0000] "GET /style.css HTTP/1.1" 200 9997
192.168.99.1 - - [18/Sep/2021:11:58:50 +0000] "GET /pacman-canvas.css HTTP/1.1" 200 4594
192.168.99.1 - - [18/Sep/2021:11:58:50 +0000] "GET /js/jquery.hammer.min.js HTTP/1.1" 200 13005
192.168.99.1 - - [18/Sep/2021:11:58:50 +0000] "GET /js/jquery-1.10.2.min.js HTTP/1.1" 200 93107
192.168.99.1 - - [18/Sep/2021:11:58:51 +0000] "GET /pacman-canvas.js HTTP/1.1" 200 46430
192.168.99.1 - - [18/Sep/2021:11:58:51 +0000] "GET /img/inky.svg HTTP/1.1" 200 5845
192.168.99.1 - - [18/Sep/2021:11:58:51 +0000] "GET /img/pinky.svg HTTP/1.1" 200 5852
192.168.99.1 - - [18/Sep/2021:11:58:51 +0000] "GET /img/blinky.svg HTTP/1.1" 200 5862
192.168.99.1 - - [18/Sep/2021:11:58:51 +0000] "GET /img/clyde.svg HTTP/1.1" 200 5850
192.168.99.1 - - [18/Sep/2021:11:58:51 +0000] "GET /img/instructions/instructions_scatter.PNG HTTP/1.1" 200 14970
192.168.99.1 - - [18/Sep/2021:11:58:51 +0000] "GET /img/audio-icon.png HTTP/1.1" 200 917
192.168.99.1 - - [18/Sep/2021:11:58:51 +0000] "GET /fonts/PressStart2Play.woff HTTP/1.1" 200 6688
192.168.99.1 - - [18/Sep/2021:11:58:51 +0000] "GET /img/bg-pattern-black.png HTTP/1.1" 200 24091
192.168.99.1 - - [18/Sep/2021:11:58:51 +0000] "GET /img/instructions/instructions_chase.PNG HTTP/1.1" 200 16104
192.168.99.1 - - [18/Sep/2021:11:58:51 +0000] "GET /img/instructions/instructions_powerpill.PNG HTTP/1.1" 200 15557
192.168.99.1 - - [18/Sep/2021:11:58:51 +0000] "GET /img/platzh1rsch-logo.png HTTP/1.1" 200 1325
192.168.99.1 - - [18/Sep/2021:11:58:51 +0000] "GET /data/map.json HTTP/1.1" 200 10874
192.168.99.1 - - [18/Sep/2021:11:58:51 +0000] "GET /img/audio-icon-mute.png HTTP/1.1" 200 1201
192.168.99.1 - - [18/Sep/2021:11:58:51 +0000] "GET /wav/theme.wav HTTP/1.1" 206 382510
192.168.99.1 - - [18/Sep/2021:11:58:51 +0000] "GET /wav/waka.wav HTTP/1.1" 206 34606
192.168.99.1 - - [18/Sep/2021:11:58:52 +0000] "GET /wav/die.wav HTTP/1.1" 206 281134
192.168.99.1 - - [18/Sep/2021:11:58:52 +0000] "GET /wav/powerpill.wav HTTP/1.1" 206 110638
192.168.99.1 - - [18/Sep/2021:11:58:52 +0000] "GET /img/heart.png HTTP/1.1" 200 181
192.168.99.1 - - [18/Sep/2021:11:58:52 +0000] "GET /img/dazzled2.svg HTTP/1.1" 200 6588
192.168.99.1 - - [18/Sep/2021:11:58:52 +0000] "GET /img/dazzled.svg HTTP/1.1" 200 6586
192.168.99.1 - - [18/Sep/2021:11:58:53 +0000] "GET /img/dead.svg HTTP/1.1" 200 3381
192.168.99.1 - - [18/Sep/2021:11:59:02 +0000] "GET /img/Icon-130x130.png HTTP/1.1" 200 4545