This will show you the process of using Dockerfile to create a Docker image with Apache services.Preparatory work:First, create a Apache_centos working directory in which[Email protected] ~]# mkdir apache_centos cd Apache_centos[email protected] apache_centos]# Touch Dockerfile run.sh[Email protected] apache_centos]# mkdir sample[email protected] apache_centos]# cat DockerfileFrom Docker.io/centos:latest#设
run.sh script. The advantage of this is that you can use WebLogic concepts such as clustering, synchronization, and so on. Deploy a clustered application that only needs to be installed once to the cluster.? ? The disadvantages are:? ? The Docker configuration is complex.?? There is no way to automatically expand the compute capacity of the cluster, if you want to add nodes, you need to create a node on administrator, then configure the new container run.sh startup script, and then start the co
# One: Environment preparationcentos7.4 and well-built Docker
[Email protected] ~]# cat/etc/redhat-releaseCentOS Linux release 7.4.1708 (Core)[Email protected] ~]# docker-vDocker version 17.03.2-ce, build f5ec1e2
# Two: Build the image of Nginx and PHP1.nginxCreate a base image
[Email protected]/]# vim DockerfileFrom CentOS
Maintainer liuning
Centos-base.repo.bakRUN Mv/etc/yum.repos.d/centos-base.repo/etc/yum.repos.d/centos-base.repo.bak
/etc/yum.repos.dCOPY Ce
Dockerfile Building a Java Web environment
Dockfile Introduction:
Dockfile is a script that is interpreted by a Docker program, and Dockerfile consists of a single instruction, each of which corresponds to a command under Linux. The Docker program translates these dockerfile instructions into real Linux commands. Dockerfile
Dockerfile provides two very similar commands to COPY and ADD, this article attempts to explain the basic functions of the two commands, as well as their similarities and differences, and then summarizes their respective appropriate application scenarios.
concept of Build context
When you create a mirror from Dockerfile using the Docker Build command, a build context is generated. The so-called build contex
1, in the host to create folders tomcat7.0_jdk1.7, download tomcat7.0 and JDK put into this directory[email protected] ~/tomcat7.0_jdk1.7 $ lsDockerfile apache-tomcat-7.0.68 JDK run.sh2, Write Dockerfile[email protected] ~/tomcat7.0_jdk1.7 $ cat DockerfileFrom sshd:centos6.5Maintainer created from [email protected]ENV Catalina_home/tomcatENV JAVA_HOME/JDKADD Apache-tomcat-7.0.68/tomcatADD JDK/JDKADD run.sh/run.shRUN chmod +x/*.shRUN chmod +x/tomcat/bi
Environment: OS X 10.10.5Maven 3.3.9Docker version 1.12.2Docker-machine version 0.8.2The program example is the service Discovery program mentioned in http://www.cnblogs.com/modprobe/p/6001333.htmlRelated code: Https://github.com/li-hong/spring-cloud-demoFirst, the preparation work, installs the Docker-toolboxMethod: Http://www.docker.com/products/docker-toolboxAfter installation, use Docker-machine to create a virtual machine with a Docker runtime environment, or run Toolbox build directlyComma
1. Writing. Dockerignore When you build the image, you do not need the Node_modules directory and so on, you can use the. Dockerignore Ignore the file#. dockerignoredockerfilenode_modules/ 2. Writing the Dockerfile file From Mhart/alpine-node:7label maintainer "test-nodejs.com" COPY localtime/etc/localtimeworkdir/appcopy Package.json/ Apprun apk--update add git apk--update Add Curl rm-rf/tmp/*/var/cache/apk/* A mp NPM Install npm
Three ways to create a mirrorThere are three ways to create Docker images, which are created based on existing images, created based on local templates, and created based on Dockerfile.Creating a mirror from Dockerfile
Here the main record is based on the Dockerfile creation method, Dockerfile is a set of instructions consisting of a file, each of which
Original address: http://blog.csdn.net/we_shell/article/details/38445979
Dockfile is a script that is interpreted by the Docker program, Dockerfile consists of a single instruction, each of which corresponds to a command under Linux. The Docker program translates these dockerfile instructions into real Linux commands. Dockerfile has its own writing format and su
The ASP. NET Samples project on Git has already written the Docker file, the content is as follows?Any dockersfile must begin with a form, and the agreement is capitalized.From Microsoft/aspnet:1.0.0-rc1-update1?COPY. /appWorkdir/appCall Dnu's restore to get the latest environment from NuGet, since ASP. NET core is completely out of the GAC, So each project is equivalent to carrying a full set of operating environments. And the use of DNU's restore is the way Microsoft provides the answer to the
Generate. NET Core MVC CodeDocker RUN-ITD Microsoft/dotnet:latestDocker PSDocker Attach Containeridmkdir WebCD Webdotnet NEW-T WebIf you do not have a dotnet Docker image, refer to:Http://www.cnblogs.com/windchen/p/6235406.htmlPrepare code files and related filesPress Ctrl+p,ctrl+q to exit the containerCD ~mkdircp containerid:/web/./webReference http://www.cnblogs.com/windchen/p/6235406.htmlChange the Program.cs file under the Web directory, and also copy the Nuget.config file to the Web directo
Tags: docker1. Directory structure, put the configuration files here, and so on to copy into the image to 2.mongod.confNET:
port:27017
bindip:0.0.0.0
security:
authorization:enabled
systemlog:
Destination: File
path: "/data/log/mongod.log"
logappend:true
Storage:
dbPath: "/data/db"
# Processmanagement:
# Fork:true3. Dockerfile#FROM debian:wheezy Fromubuntu #addouruserandgroupfirstto makesuretheiridsgetassignedconsistently,regardlessof whateverdependen
Collated the document today to build mariadbHost or CentOS 172.16.0.200 build a second imagesmkdir./mysql-dockerfile Below is three filesDockerfile #构建mariadb-images mysqld_charset.cnf #mariadb #配置文件 The encoding format is setScript #目录内, storing three filesScript #目录下三个文件All right, let's take a look at one.DockerfileFrom docker.io/237356573@qq .com>#add system-/var/lib/Yum Install -y mariadb mariadb-server yum clean all#add Mysql.confadd mysqld
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.