$ docker version $ docker search ubuntu # search for ubuntu images $ docker pull name/repo # download image $ docker run name/repo command # run command in name/repo $ docker run caibin/ubuntu echo 'test' $ docker run caibin/ubuntu apt-get install ping # install packages $ docker ps -l # list process $ docker commit pid caibin/insist # save new state to new image $ docker inspect image_id # display info about image $ docker images # show images on your host $ docker build -t insist - < Dockerfile_insist
Dockerfile
# Memcached # # VERSION 2.2 # use the ubuntu base image provided by dotCloud FROM ubuntu MAINTAINER Victor Coisne victor.coisne@dotcloud.com # make sure the package repository is up to date RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list RUN apt-get update # install memcached RUN apt-get install -y memcached # Launch memcached when launching the container ENTRYPOINT ["memcached"] # run memcached as the daemon user USER daemon # expose memcached port EXPOSE 11211