List of files prepared on the host:
Dockerfile
#启动ssh和apache服务的角本
run.sh1 2 3 1 2 3
The above files are placed in the/root/apache_centos directory
Mkdir-p/root/apache_centos
Cd/root/apache_centos1 2 1 2
Base Image: An image of an open SSH service based on a mirrored CentOS
[Root@localhost apache_centos]# Docker images
REPOSITORY TAG
Tags: dockerfile1. Create a new Dockerfile fileDockerfile
12345678910111213141516
# VERSION 0.0.1FROM ubuntu:latestMAINTAINER lanhong Turnbull "[emailprotected]"# Add 10gen official apt source to the sources listRUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10RUN echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | tee /etc/apt/sources.list.d/10gen.list# Hack for initctl not being available in UbuntuRUN dpkg-divert --local --re
1, first download the image to local. https://hub.docker.com/r/gettyimages/spark/~$ Docker Pull Gettyimages/spark2, download from https://github.com/gettyimages/docker-spark/blob/master/docker-compose.yml to support the spark cluster DOCKER-COMPOSE.YML fileStart it$
terminal
Prompts you to enter your registration docker hub information.
If you see successful information, you are successful, this time, you can perform the tag operation, in the tag, you need to pay attention to the format. In the same way, anyone can docker hub download a mirror from a warehouse, but if you want to share your image, you must re
Recently began to use Docker, the common command to touch once, want to put the image of the build process on the Jenkins. The specific process will not say, very simple, only need a few commands on it.
An exception can be reported when pushing to a private registry:
Docker push registry.mydocker.com/demo/small:latest The
push refers to Repository [registry.mydoc
If you need to replace or add a file to the old Tomcatimage to form a new image, you need to do something in Dockerfile
From Old_tomcat
#这里可以使用docker官方的镜像, the following descriptions are examples of
maintainer ****************** on this basis
#如果需要替换原有的配置文件或者脚本
ADD web.xml/usr/local/tomcat/webapps/manager/web-inf/
Add tomcat-users.xml/usr/local/tomcat/conf/
Add server.xml/usr/local/tomcat/conf/
add
Summary: Sometimes we need to package a PHP project into a Docker image, which is described hereIdea: We PHP and Apache combine an image to implement PHP project Access, MySQL is a separate mirrorSteps:1. First of all, we test the local PHP project is not available, after all, put on the server after the test is not very convenient. We then import the PHP project
With a learning attitude, I want to know how to create a basic docker image. So I found a description on the official docker website:
First, the creation of base image is related to the Linux release version to be created. Different releases are different.
The following are examples:
Use the tar command to create a c
Reprint: http://www.cnblogs.com/cfrost/p/6241892.htmlThe first is pull image, and here I take5.6.35:
1
$sudodocker pull mysql:5.6.35
After pulling down the big can follow the official instructions no brain start, but external inaccessible, so bound port:
1
$sudodocker run --name mysql -p 12345:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:5.6.35
Tags: ubuntu djang class Run comment variable repo modify pipA docker pull ubuntu, first download down a mirror,Or start a mirror locallyDocker Run-i-T Ubuntu/bin/bashTwoEnter a certain update operation# Shell on Container$ apt-get Update$ apt-get-y Install Python-pip$ pip Install DjangoThe above action is to update the source and then install Pip and DjangoThreeUpdate imageDocker Commit- m="description abo
Create docker image and sshddocker With sshd service
Reference: https://docs.docker.com/examples/running_ssh_service/
1. Create an empty directory to store Dockerfile
Mkdir-p/home/thm/docker/test/new_image
Vim Dockerfile
The content of Dockerfile is:
FROM tanghuimin0713/ubuntu_amd64:14.04 RUN apt-get update RUN apt-get install -y openssh-server #RUN mkdir
1. Local Image
For example, you can package your development environment with the name centos6-base.tar. then, you can use centos6-base.tar as the benchmark image in docker.
1. Create your own image and place it in the/root directory:
# Tar -- Numeric-owner -- exclude =/proc -- exclude =/sys-CVF centos6-base.ta
Tags: mysql5.7 's CentOS Dock1. After entering Linux, use the docker command to download MySQL, commands such as:Docker Pull mysql:5.7After you run the command, the following log is displayed:[[emailprotected]~]#dockerpullmysql:5.7 5.7:pullingfromlibrary/ MySQL ad74af05f5a2:pullcomplete 0639788facc8:pullcomplete de70fa77eb2b:
pullcomplete 724179e94999:pullcomplete 50c77fb16ba6:pullcomplete d51f459239fb:pullcomplete 937bbdd4305a:pullcomplete 35369f9634
At present, I use Docker to do CaaS platform, mainly to solve:1, operation and maintenance of sandbox environmental testing;2, research and development of semi-automated code deployment and rollback;3, clustered application and auto scale.The 3 points are now fulfilled, but there is a problem when contacting the 2nd and 3rd. In the 2nd, the development test successful code will be packaged as a images, put into a private library, and then the 3rd clus
CentOS7 Docker Service failed to start solution
Check Step
Start the Docker service:
Systemctl Restart Docker
This time will be an error, please do the following steps:
1. Find the type of error, or the description of the error.2. Check the
implemented on-line. Below I post the package plugin code in the POM:Note the changes in ENV nodes and entrypointCom.spotifydocker-maven-plugin0.4.11pumelo/${project.artifactid}-${version}frolvlad/alpine-oraclejdk8:slim "" [" SH ","-C "," Java $JAVA _opts-jar/${project.build.finalname}.jar "]/${project.build.directory}${ Project.build.finalname}.jarTestAfter the image is newly packaged, runDocker run-e java_opts= '-xms128m-xmx256m-dspring.profiles.ac
1. Download the dind imageDocker Pull Docker:dind2. Perform the imageDocker run-it--privileged--name some-docker-d docker:dind3. In-mirror processing--no-cache Icu-libs4. Download the Dotnet tar packageHTTPS://www.microsoft.com/net/download/thank-you/dotnet-sdk-2.1.302-linux-x64-alpine-binaries Very clear for theHTTPS://download.microsoft.com/download/4/0/9/40920432-3302-47a8-b13c-bbc4848ad114/ Dotnet-sdk-2.1.302-linux-musl-x64.tar.gz5. Copy to the ho
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.