Skip to content

Quickstart

Chun Cheng Yeh edited this page Jun 30, 2026 · 7 revisions

Install from pkg

Install required packages.

pkg install dockerbox docker-cli docker-compose docker-buildx

Fetch dockerbox disk image.

dockerbox fetch

Install from source

To install from source, clone this repository and run make install.

git clone https://github.com/leafoliage/freebsd-dockerbox.git
make install

Download the dockerbox disk image.

make fetch-disk

Install helper packages.

pkg install grub2-bhyve e2fsprogs docker-cli docker-compose

There is a recent patch to grub2-bhve and docker-compose; docker would be renamed to docker-cli. Please make sure the "latest" package repository is used instead of quarterly. Check with pkg -vv. Otherwise, grub2-bhyve should be built from port.

Enable and start the dockerbox service.

sysrc dockerbox_enable=YES
service dockerbox enable
service dockerbox start

Run docker command with remote docker specified.

docker -H 10.0.0.1:2375 run hello-world

Install from port

See freebsd-dockerbox-port Quickstart.

Usage

Starting dockerbox.

service dockerbox start

Setup docker context for dockerbox.

# Choose either tcp or ssh
docker context create dockerbox --docker "host=tcp://10.0.0.1:2375"
docker context create dockerbox --docker "host=ssh://dockerbox@10.0.0.1"
docker context use dockerbox

Username and password are both "dockerbox".

Altervatively, for one-shot use.

docker -H tcp://10.0.0.1:2375 ps
export DOCKER_HOST=tcp://10.0.0.1:2375; docker ps

Docker run.

docker run hello-world

Stopping dockerbox.

service dockerbox stop

Resize docker data storage.

dockerbox resize 1G

Access dockerbox console with dockerbox built in console command or ssh.

dockerbox console
ssh dockerbox@10.0.0.1

Currently only extending storage is supported.

Log is at /var/log/dockerbox.log

Clone this wiki locally