This is an old revision of the document!


Docker on Debian

Prerequisites

  • Packages installed: debootstrap and friends.
  • I use Debian testing/jessie (now stable), and put sid into sources.list so I can apt-get install docker.io, because docker.io removed from testing in late March 2015 and available only in sid.
    # vim /etc/apt/sources.list
    deb http://yourrepo/debian/ sid main
  • Update your packages list.
    # apt-get update
  • Install docker.io with:
    # apt-get install docker.io

Creating Docker Image

  • Use mkimage.sh to create Docker image.
    $ sudo /usr/share/docker.io/contrib/mkimage.sh -t ${USER}/minbase debootstrap --variant=minbase --components=main --include=inetutils-ping,inetutils-traceroute,iproute jessie http://yourrepo/debian/
  • Try to run 'echo'.
    $ sudo docker run -i ${USER}/minbase echo "hello citra"

Creating Docker Container

  • Firstly, create a dockerfile for your container.
    $ vim dockerfile
    FROM stwn/minbase
    MAINTAINER stwn@NOSPAMduniasemu.org
    
    RUN apt-get update && apt-get install -y \
        apt-utils less sudo screen \
        openssh-server openssh-client \
        asterisk
  • Build docker container based on the dockerfile.
    # docker build -t ${USER}/asterisk:test0 dockerfile

Frequently Used Commands

  • Show images:
    # docker images
    REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
    stwn/minbase        latest              d816657c5182        3 minutes ago       123.7 MB
    scratch             latest              511136ea3c5a        22 months ago       0 B
  • Show all running containers:
    # docker ps -a
  • Remove image:
    # docker rmi <image>
 
doc/docker.1430768668.txt.gz · Last modified: 2015/05/04 19:44 by stwn · [Old revisions]
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki