i have dockerfile nginx.
from ubuntu # file author / maintainer maintainer maintaner name # install nginx # add application repository url default sources run echo "deb http://archive.ubuntu.com/ubuntu/ raring main universe" >> /etc/apt/sources.list # update repository run apt-get update # install necessary tools run apt-get install -y nano wget dialog net-tools # download , install nginx run apt-get install -y nginx # remove default nginx configuration file run rm -v /etc/nginx/nginx.conf # copy configuration file current directory add nginx.conf /etc/nginx/ # append "daemon off;" beginning of configuration run echo "daemon off;" >> /etc/nginx/nginx.conf # expose ports expose 80 # set default command execute # when creating new container cmd service nginx start
and have docker-compose.yml file.
web: build: . ports: - "5000:5000" volumes: - .:/code links: - redis redis: image: redis
after running
docker-compose up
it creates image dockerfile called "web" , downloads redis image also. creates combination of both image called "web_web1" , when checked output of
docker ps
both nginx , redis service running. question if commit newly created image image , export container , import environment, during execution of docker run command,will start both nginx , redis service?
my question if commit newly created image image , export container , import environment, during execution of docker run command,will start both nginx , redis service?
all need change container names , port mapping declared in docker-compose.yml
, , launch many instances of images want (no need export/import)
Comments
Post a Comment