Docker Learning Note II, based on Dockerfile to build Java Tomcat Runtime environmentObjectiveIn the first text, we completely manual, a command of a command input, implementation of a Java Tomcat runtime environment, although the initial results, but very tiring. If you rely on scripting to build a Tomcat container instance, a command can be done, why not. Fortunately, Docker provides dockerfile as a scrip
The ONBUILD directive can add triggers for mirroring. The parameter is any one of the dockerfile directives.When we add the Onbuild directive to a dockerfile file, the directive does not have a substantial impact on the use of the dockerfile to build the image (for example, a mirror).But when we write a new Dockerfile
Original link: Docker use Dockerfile to create a container mirror that supports SSH service self-boot
1. First create a Dockerfile file with the following contents
# Select an existing OS mirror as
the author of the base from CENTOS:CENTOS6 # mirror
maintainer fanbin Kong "kongxx@hotmail.com"
# Install the Openssh-server and sudo packages and set the sshd usepam parameters to no
RUN yum install-y opens
In the previous two, we talked about most of the parameters, today will introduce the other two more important parameters, and then the previous two chapters of the knowledge string up, do a dockerfile, to achieve vim/ssh image.Here's what we're going to say about the dockerfile environment today:650) this.width=650; "Style=" background-image:none;padding-left:0px;padding-right:0px;float:none; Border-top-wi
Lnmp is another very popular web framework behind the lamp, the linux+nginx+mysql+php site architecture scheme. Nginx is more lightweight than Apache, especially for static page processing. A friend of operations should know a popular word-dynamic static separation, one of the more common is to use nginx processing static pages, and dynamic pages to the backend Apache or tomcat processing. This article is to talk about the construction of LNMP environment image through
1. dockerfile command description:
Dockerfile commands are case-insensitive. We recommend that you use uppercase letters and # As annotations. Each line supports only one command, and each command can carry multiple parameters.Dockerfile commands can be divided into two types based on their functions: Build commands and set commands.The build command is used to build an image. The specified operation is not
Use Dockerfile to build an imageCreate a directory and initialize Dockerfile .~ Mkdir static_web? ~ Cd static_web? Static_web touch Dockerfile? Static_web vim Dockerfile we create a directory named static_web to save the Dockerfile. This directory is our build environment, a
Docker Dockerfile Detailed Category: DevOps 2014-05-15 11:0921652 People readComments (0)CollectionReportDockerdirectory (?) [+] How to use Dockerfile is used to create a custom image that contains user-specified software dependencies, and so on. Under current directory contains Dockerfile, use command build to create a new image and name it edwardsbean/centos6-
First, the following commands, such as Run, CMD, and entrypoint, can be used to execute commands, but each has different characteristics.
Run is executed at the time of build image.
The CMD entrypoint is executed when the image is run.
CMD can be used in conjunction with entrypoint, or it can be used with a single command. When both CMD and entrypoint are present in a dockerfile, the information set in cmd (the exec format) is provid
Dockerfile: create an image Template
Dockerfile is a configuration file in text format. You can use Dockfile to quickly create a custom image. Dockerfile is composed of a line of command statements, and supports comment lines starting.
# Generally, Dockerfile is divided into four parts: basic image information, maintai
View the directory structure of Nginx and PHP:[email protected] docker_demo]# tree Nginxnginx├──dockerfile├──fastcgi_params├──nginx-1.8. 1. Tar . gz├──nginx.conf└──www.conf[email protected] docker_demo]# tree phpphp├──dockerfile├──init.d.php-fpm├──libmcrypt-2.5 . 7. Tar . gz├──php-5.6. . Tar . bz2├──php-fpm.conf.default└──php.ini-productionThe build process for Nginx and PHP is described in detail, as well
Using Dockerfile to create CentOS Docker mirrors with Apache services
List of files prepared on the host:
Dockerfile
#启动ssh和apache服务的角本
run.sh
The above files are placed in the/root/apache_centos directory
Mkdir-p/root/apache_centos
Cd/root/apache_centos
Base mirroring: Mirroring of open SSH services based on mirrored CentOS
[Root@localhost apache_centos]# Docker images
R
Docker there's a dockerfile, why should we use him?To put it simply: we used to Docker run to create a Docker container that sometimes comes with a lot of parameters.Like what:
The code is as follows
Copy Code
Docker run-d-P 22-p 8080:8080 Ruifengyun/ubunt-redis "Redis-server redis.conf /usr/sbin/sshd-d"
Will find it very troublesome. This time we can create an edit Dockerfil
Build Docker Image
Simple recording of how to build Docker image
Build Docker image Docker build Usage dockerfile related instruction RUN CMD entrypoint SHELL CMD entrypoint building ACTIVEMQ Image Reference
The Docker build Usage dcoker Build command sends the built-in content to the Docker daemon, sequentially executing the commands in Dockerfile (each line of instruction commits a new layer). Successful
ObjectiveIn the first text, we completely manual, a command of a command input, implementation of a Java Tomcat runtime environment, although the initial results, but very tiring. If you rely on scripting to build a Tomcat container instance, a command can be done, why not. Fortunately, Docker provides dockerfile as a script to build Docker images, avoiding the input of people on one line. Dockerfile script
The command format isINSTRUCTION arguments, Commands includeFROM,MAINTAINER,RUN.From
Format:FROM OrFROM .
The first command must beFROMCommand. In addition, if you create multiple images in the same dockerfile, you can use multipleFROMCommand (once for each image ).Maintainer
Format:MAINTAINER , Specify the maintainer information.Run
Format:RUN OrRUN ["executable", "param1", "param2"].
The former will run commands in the shell terminal, that is/bin/sh
in this way, the download process is also extremely frustrating, helpless, had to download the relevant RPM package, put in the local MySQL directory, through the Add command to copy the files in the directory into the Mirror. Note:/mysql is a relative path relative to Dockerfile, because the absolute path of my Dockerfile is/root/dockerfile, so the absolute pat
In the docker Study Notes (1), we mentioned using the commit command to submit a new image. Next we will use the dockerfile file to generate an image and use the dockerfile for convenient transplantation.
I. Several Common commands in dockerfile:
(1) From
Format:
FROM Or
FROM
(2) maintainer
Format:
MAINTAINER
Description: sets the creator of the gene
Back to CatalogUncle feel online on the dockerfile is not very clear, or how to use said not clear, in vs2017 we can go to build their own dockerfile file, then your project can be generated a mirror, push it to the warehouse, you can in Linux, Mac go on run your project! Sounds great, but the process does have some pits!The answer in Dockerfile
From bas
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.