docker pull ubuntu:12.04 // make first image
docker build -t compile . // put your Dockerfile in current directoryNOTE: you need configure http proxy or dns for docker build.
DNS configuration:
/etc/default/docker
Dockfile example for create image contain compile env
FROM ubuntu:12.04
ENV http_proxy="xxxx:80"
RUN apt-get update && \
apt-get -y install gcc git
RUN apt-get -y install cmake autoconf libtool texi2html texinfo libxml2-dev
RUN apt-get -y install apt-utils g++ make flex bison libssl-dev libedit-dev
# Make ssh dir
RUN mkdir /root/.ssh/
# Copy over private key, put id_rsa/id_rsa.pub into your dockfile directory
ADD id_rsa /root/.ssh/id_rsa
ADD id_rsa.pub /root/.ssh/id_rsa.pub
RUN ssh-keyscan -t rsa gitxxx.com > ~/.ssh/known_hosts
RUN git clone git@gitxxxx.com:/xxxxtools.git
RUN mkdir /root/check
#put your check directory into dockfile directory
ADD check /root/check/
WORKDIR /xxx/xxx
RUN ./xxx
docker images manager command:
docker images //show current all images
docker rmi imageId //delete one of images
docker ps -a //But some times you can not delete current using images, you needdocker rm $(docker ps -aq) //To remove all existing containers (not images!) run