This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker exec project_name apt-get update -y | |
docker exec project_name apt-get install php5-mysqlnd php5-curl -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker exec project_name sed -i -e 's/bind-address/#bind-address/g' /etc/mysql/my.cnf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker pull linode/lamp:latest | |
docker run -i -t -d -p 4040:80 -p 33060:3306 \ | |
-v /project/path:/var/www/example.com/public_html \ | |
--name project_name linode/lamp /bin/bash | |
docker exec project_name apt-get update -y | |
docker exec project_name apt-get install php5-mysqlnd php5-curl -y | |
docker exec project_name sed -i -e 's/bind-address/#bind-address/g' /etc/mysql/my.cnf | |
docker exec project_name service apache2 start | |
docker exec project_name service mysql start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
phpinfo(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ubuntu 최신 버전 받기 | |
docker pull ubuntu:latest | |
# ubuntu 12.04 버전 받기 | |
docker pull ubuntu:12.04 | |
# linode/lamp 받기 | |
docker pull linode/lamp:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 다운로드 받은 모든 도커 이미지 목록을 봅니다 | |
docker images | |
# 다음과 같이 목록을 확인할 수 있습니다. | |
REPOSITORY TAG IMAGE ID CREATED SIZE | |
ubuntu latest f975c5035748 2 weeks ago 112MB | |
linode/lamp latest 2359fa12fded 3 years ago 372MB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# docker [OPTION] image-name | |
docker run -i -t --name ubuntu-container ubuntu | |
# -i: 인터렉티브 interactive 옵션. 표준 입력 STDIN 을 유지하며 호스트와 통신을 유지합니다. | |
# -t: pseudo-tty 옵션. 호스트에서 터미널을 이용해 컨테이너와 통신하려면 필수적인 옵션입니다. | |
# --name: 컨테이너 이름. 이번의 경우엔 ubuntu-container | |
# ubuntu 도커 이미지 이름. 이번의 경우엔 ubuntu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker ps | |
# 실행중인 컨테이너 목록이 다음과 같이 나옵니다. | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
ecc4804eabf7 ubuntu "/bin/bash" 57 seconds ago Up 59 seconds docker-container | |
# 실행중인 목록이 없을 경우 컨테이너가 정지되어 있는 겁니다. | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -i -t \ | |
-p 8888:80 \ | |
-v /project/docker:/var/www/example.com/public_html \ | |
--name lamp linode/lamp | |
# -p: 호스트의 8888 포트와 컨테이너의 80 포트를 연결합니다. | |
# -v: 호스트의 /project/docker 를 컨테이너의 /var/www/example.com/public_html 에 연결합니다. |