Code Monkey home page Code Monkey logo

sdc-docker's Introduction

sdc-docker

A Docker Engine for SmartDataCenter, where the whole DC is exposed as a single docker host. The Docker remote API is served from a 'docker' core SDC zone (built from this repo).

Disclaimer

This is still very much alpha. Use at your own risk!

Current State

The following shows the state of the various docker commands when talking to sdc-docker instead of a regular docker host.

Working and partially-working commands

  • docker create --name=foo64 lx-busybox:0.002 /bin/sh
    • supports -m, -c
    • does not support any other options (especially interactive modes)
  • docker exec
    • supports -i, -t
    • does not support -d yet
  • docker images
    • does not filter, fakes 'latest'
  • docker info
  • docker inspect
    • supports inspecting a container
    • does not support inspecting an image yet
  • docker kill
    • only signals supported by node
  • docker ps
    • does not filter (and -a is same)
    • doesn't show actual exit status / time
  • docker restart
    • supports -t
  • docker rm
    • ALWAYS behaves as though -f were passed
    • does not support other options
  • docker run -d --name=foo lx-busybox:0.002 /bin/sh
    • supports -m, -c
    • does not support any other options (especially interactive modes)
  • docker stop
    • supports -t
  • docker start <id|short-id|name>
    • does not support -a or -i
  • docker version
  • docker wait

Non-working commands

  • currently none that are implemented but non-working

Non implemented commands

  • docker attach (DOCKER-4)
    • not implemented
  • docker build
    • not implemented
  • docker commit
    • not implemented
  • docker cp
    • not implemented
  • docker diff
    • not implemented
  • docker events
    • not implemented
  • docker export
    • not implemented
  • docker history
    • not implemented
  • docker import
    • not implemented
  • docker load
    • not implemented
  • docker login
    • not implemented
  • docker logout
    • not implemented
  • docker logs
    • not implemented
  • docker port
    • not implemented
  • docker pause (blocked on OS-3455)
    • not implemented
  • docker pull
    • not implemented
  • docker push
    • not implemented
  • docker rmi
    • not implemented
  • docker save
    • not implemented
  • docker search
    • not implemented
  • docker tag
    • not implemented
  • docker top
    • not implemented
  • docker unpause (blocked on OS-3456)
    • not implemented

Installation

Installing sdc-docker means getting a running 'docker' core zone. This has been coded into sdcadm as of version 1.3.9:

[root@headnode (coal) ~]# sdcadm --version
sdcadm 1.3.9 (master-20141027T114237Z-ge4f2eed)

If you don't yet have a sufficient version, then update:

sdcadm self-update

Then you can update your 'docker' instance (creating an SAPI service and first instance if necessary) via:

sdcadm experimental update-docker

Then set DOCKER_HOST (and unset DOCKER_TLS_VERIFY for now) on your Mac (or whever you have a docker client):

$ export DOCKER_TLS_VERIFY=
$ export DOCKER_HOST=tcp://$(ssh [email protected] 'vmadm lookup alias=docker0 | xargs -n1 vmadm get | json nics.0.ip'):2375
$ docker info
Containers: 0
Images: 31
Storage Driver: sdc
Execution Driver: sdc-0.1
Kernel Version: 7.x
Operating System: Joyent Smart Data Center
Debug mode (server): true
Debug mode (client): false
Fds: 42
Goroutines: 42
EventsListeners: 0
Init Path: /usr/bin/docker

Development

  1. Add a 'coal' entry to your '~/.ssh/config'. Not required, but we'll use this as a shortcut in examples below.

     Host coal
         User root
         Hostname 10.99.99.7
         ForwardAgent yes
         StrictHostKeyChecking no
         UserKnownHostsFile /dev/null
         ControlMaster no
    
  2. Get a clone on your Mac:

     git clone [email protected]:joyent/sdc-docker.git
     cd sdc-docker
    
  3. Make changes in your local clone:

     vi
    
  4. Sync your changes to your 'docker0' zone in COAL (see Installation above):

     ./tools/rsync-to coal
    

    This will rsync over changes (excepting binary bits like a change in sdcnode version, or added binary node modules) and restart the docker SMF service.

For testing I tend to have a shell open tailing the docker

ssh coal
sdc-login docker
tail -f `svcs -L docker` | bunyan

Before commiting be sure to:

make check

Images for hacking

Until we fully support pulling images from a registry I've built 2 images that I'm using for testing. To get these you can:

for file in $(mls /Joyent_Dev/stor/stuff/docker/ | grep "\-11e4-"); do
    mget -O /Joyent_Dev/stor/stuff/docker/${file}
done

Copy the resulting files to /var/tmp in your COAL and import them into IMGAPI:

scp *-11e4-* coal:/var/tmp
ssh coal
cd /var/tmp
for img in $(ls *.manifest); do
    sdc-imgadm import -m ${img} -f $(basename ${img} .manifest).zfs.gz
done

Then (as of a recent sdc-docker) you should be able to do:

$ docker create --name=ABC123 lx-busybox32:0.007 /bin/sh
57651723e32949bc967f2640872bae9651385b4254e64a49a320dc82c3d46bbb
$ ssh coal vmadm list uuid=~5765
UUID                                  TYPE  RAM      STATE             ALIAS
57651723-e329-49bc-967f-2640872bae96  LX    512      stopped           ABC123

sdc-docker's People

Contributors

joshwilsdon avatar trentm avatar orlandov avatar thekvn avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.