Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Porting Docker to FreeBSD

Kazuyoshi Kato
July 04, 2014
12k

Porting Docker to FreeBSD

Kazuyoshi Kato

July 04, 2014
Tweet

Transcript

  1. Porting
    Docker to
    FreeBSD
    Kato Kazuyoshi
    http://8-p.info/

    View Slide

  2. YO DAWG, I HERD YOU LIKE DOCKER
    SO I PUT DOCKER ON VIRTUALBOX SO
    YOU CAN RUN DOCKER ON YOUR MAC

    View Slide

  3. Docker
    Init
    Docker
    Init
    Docker
    Init
    Docker
    daemon
    Docker
    client
    Docker
    client
    HTTP
    Unix
    domain socket
    exec

    View Slide

  4. execdriver
    networkdriver
    graphdriver
    lxc native
    aufs devmapper btrfs vfs
    bridge
    chroot
    Jan 11th-Feb 25th

    View Slide

  5. cgroups
    Linux 2.6.24 (2007)
    Solaris Zones
    Solaris 10 (2005)
    FreeBSD jail
    FreeBSD 4.0 (2000) by phk@

    View Slide

  6. https://github.com/kzys/docker/tree/execdriver-jail

    View Slide

  7. % git log --oneline --author kazu master
    7337114 cp's -T and --reflink=auto are only available on GNU coreutils
    0046995 Fatal() doesn't take a format string like Fatalf()
    21b42df UTIME_OMIT is only available on Linux
    92ea101 SQLite is also available in FreeBSD
    e1e512e This permission should be interpreted as octal, not decimal
    3754fdd Support FreeBSD on pkg/mount
    ca7a0e6 FreeBSD's nullfs doesn't support file mount
    a7e181c Add a test for mount.GetMounts
    0f72486 Fix utils.FollowSymlinkInScope's infinite loop bug
    e3e078c Add the test to reproduce the issue even in "make test"
    c5226d9 Avoid "invalid memory address or nil pointer dereference" panic
    1c90a4d Support FreeBSD on pkg/system/utimes_*.go
    66baf56 Unlike GNU find, FreeBSD's find needs a path before an expression
    18bea24 Use LLVM Clang explicitly on FreeBSD
    794b5de Don't assume the file system has sub-second precision timestamp
    da8aa71 Remove archive/stat_unsupported.go because it is not used
    b2cd890 Like signal_linux.go, we don't have import os and os/signal
    %

    View Slide

  8. IMHO
    "return err" is sometimes
    hard to debug because
    there is no context like
    a stack trace
    ... by default. Maybe what I need is github.com/juju/errgo.

    View Slide

  9. TODO
    Upstream "jail" execdriver
    (Use jail(2) instead of /usr/sbin/jail, ...)
    Start implementing a graphdriver for ZFS
    Start implementing a networkdriver

    View Slide