Docker study notes one. Update kernel, upgrade kernel to 3.x two. Install Docker:
RPM--import/etc/pki/rpm-gpg/rpm-gpg-key-epel-6
Yum-y Install Docker-io
Three. Start Docker:
Service Docker start
Chkconfig Docker on
Four. Download the base mirror image:
Docker Pull Centos:latest
Five. To view local mirrors:
Docker images
Six. Add run File: (Take se as an example)
Dockerfile, Dockertest.jar, jdk1.8.0_141
Dockerfile:
From Centos:latest
COPY jdk1.8.0_141 jdk1.8.0_141
ENV java_home=/jdk1.8.0_141
ENV path= $JAVA _home/bin: $PATH
Envclasspath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
ADD Dockertest.jar Demo1.jar
RUN bash-c ' Touch/demo1.jar '
Entrypoint["Java", "-jar", "/demo1.jar"
Seven. Buil folder and load to mirror
Docker build-t Test (custom mirror name).
Eight. Running Mirrors
Docker Run-i-T
Nine. View currently running mirrors
Docker PS
Ten. Remove Mirror 1. Stop mirroring:
Docker stop
Where the container ID is Docker PS query out of the container ID or in the running mirror exit exit
2. Remove Mirror
Docker RMI or Docker rmi-f