Note
This project is still a work in progress.
Dockerbox provides docker on FreeBSD by running dockerd inside a Linux Bhyve VM.
This repository (freebsd-docker) holds the core files to run the dockerbox service, including rc script and configs.
freebsd-dockerbox-debian is the repository for dockerbox's underlying disk images.
freebsd-dockerbox-port holds dockerbox's port related files.
Children services are optional, but they improve dockerbox usability. It is recommended to install them, too.
They are automatically started by dockerbox in dockerbox poststart command if enabled.
- dockerbox-broker
- Maintains port forwarding from localhost to remote TCP docker host for ports binded on the remote host
To install from source, clone this repository and run make install.
git clone https://github.com/leafoliage/freebsd-dockerbox.gitmake installDownload the dockerbox disk image.
make fetch-diskInstall helper packages.
pkg install grub2-bhyve e2fsprogs docker-cli docker-composeThere is a recent patch to
grub2-bhveanddocker-compose;dockerwould be renamed todocker-cli. Please make sure the "latest" package repository is used instead of quarterly. Check withpkg -vv. Otherwise,grub2-bhyveshould be built from port.
Enable and start the dockerbox service.
sysrc dockerbox_enable=YES
service dockerbox enable
service dockerbox startRun docker command with remote docker specified.
docker -H 10.0.0.1:2375 run hello-worldSee freebsd-dockerbox-port Quickstart.
Starting dockerbox.
service dockerbox startSetup docker context for dockerbox.
docker context create dockerbox --docker "host=ssh://dockerbox@10.0.0.1"
docker context use dockerboxAltervatively, for one-shot use.
docker -H tcp://10.0.0.1:2375 ps
export DOCKER_HOST=tcp://10.0.0.1:2375; docker psDocker run.
docker run hello-worldStopping dockerbox.
service dockerbox stopResize docker data storage.
dockerbox resize 1GCurrently only extending storage is supported.
Access dockerbox console with dockerbox built in console command or ssh.
dockerbox console
ssh dockerbox@10.0.0.1Log is at /var/log/dockerbox.log
Refer to the wiki for advanced usages:
Make sure new version of sbin/dockerbox is installed, then upgrade root disk. It would prompt for permission to replace old disk, enter 'y' to proceed.
dockerbox fetch
- Default config
# /usr/local/etc/dockerbox/dockerbox.conf
cpu=1
memory=1024M
ext_if=auto
nat_ip=10.0.0.254
nat_mask=24
console=yes
start_wait_timeout=30
Refer to wiki/Configuration for details.
Dockerbox runs on a root disk and a docker data disk. The docker data disk is mounted at /var/lib/docker, and the rest of they system is installed on the root disk. The separate disk design is to simplify disk space management and resizing.