set up docker and run httpd in 2 vagrant machines. 4
2302 단어 Docker
Run httpd by Dockerfile
create index.html
bashvi index.html
html<html>
Hello docker! docker!
</html>
We can run httpd by Dockerfile.
DockerfileFROM centos
MAINTAINER taro yamada <[email protected]>
# RUN: It executes when it is built
RUN yum -y install httpd
ADD ./index.html /var/www/html
EXPOSE 80
# CMD: It executes when it is running
CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"]
bashsudo docker build -t bibobibo/httpd .
You can run docker. host:8080 container:80
bashsudo docker run -p 8080:80 -d bibobibo/httpd
You can see it from browser.
We can push image to docker index.
please create an account here.
https://hub.docker.com/
bashsudo docker login
shell-sessionLogin with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username:
Password:
Login Succeeded
You can rename image
sudo docker tag "current imagename""docker repository name"
bashsudo docker tag bibobibo/httpd jojiurano/bibo
bashsudo docker push jojiurano/bibo
shell-sessionThe push refers to a repository [docker.io/jojiurano/bibo]
b395726bdce1: Pushed
6302e3c8d93a: Pushed
99b28d9413e4: Pushed
latest: digest: sha256:c39795ad32958fc4475f48099c6965b121f0e6833afa806d390fd9dd4732deec size: 948
앞에 이거.
Reference
이 문제에 관하여(set up docker and run httpd in 2 vagrant machines. 4), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/joji/items/30c80a41319abb4b757e
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
vi index.html
<html>
Hello docker! docker!
</html>
FROM centos
MAINTAINER taro yamada <[email protected]>
# RUN: It executes when it is built
RUN yum -y install httpd
ADD ./index.html /var/www/html
EXPOSE 80
# CMD: It executes when it is running
CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"]
sudo docker build -t bibobibo/httpd .
sudo docker run -p 8080:80 -d bibobibo/httpd
sudo docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username:
Password:
Login Succeeded
sudo docker tag bibobibo/httpd jojiurano/bibo
sudo docker push jojiurano/bibo
The push refers to a repository [docker.io/jojiurano/bibo]
b395726bdce1: Pushed
6302e3c8d93a: Pushed
99b28d9413e4: Pushed
latest: digest: sha256:c39795ad32958fc4475f48099c6965b121f0e6833afa806d390fd9dd4732deec size: 948
Reference
이 문제에 관하여(set up docker and run httpd in 2 vagrant machines. 4), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/joji/items/30c80a41319abb4b757e텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)