Skip to content

Commit

Permalink
Rename it barge
Browse files Browse the repository at this point in the history
- DockerRoot -> Barge
- docker-root -> barge
- user -> bargee
  • Loading branch information
ailispaw committed Apr 26, 2016
1 parent 5ec9101 commit c8fcedd
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 106 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ env: | status

status:
@if [ ! -f vm/.mac_address ]; then \
echo "docker-root-xhyve: stopped"; \
echo "barge-xhyve: stopped"; \
exit 1; \
else \
if ping -c 1 -t 1 $(IP_ADDR) >/dev/null 2>&1; then \
echo "docker-root-xhyve: running on $(IP_ADDR)"; \
echo "barge-xhyve: running on $(IP_ADDR)"; \
else \
echo "docker-root-xhyve: starting"; \
echo "barge-xhyve: starting"; \
exit 1; \
fi; \
fi >&2;
Expand Down
88 changes: 43 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# DockerRoot running on xhyve hypervisor
# Barge running on xhyve hypervisor

This is a toolbox to run [DockerRoot](https://github.com/ailispaw/docker-root) on xhyve hypervisor easily.
This is a toolbox to run [Barge](https://github.com/bargees/barge) on xhyve hypervisor easily.

For VirtualBox or QEMU, see https://github.com/ailispaw/docker-root-packer.
For VirtualBox or QEMU, see https://github.com/bargees/barge-packer.

## Features

- [DockerRoot](https://github.com/ailispaw/docker-root)
- [Barge](https://github.com/bargees/barge)
- Disable TLS
- Expose the official IANA registered Docker port 2375
- Support NFS synced folder: $HOME is NFS-mounted on the DockerRoot VM.
- Support NFS synced folder: $HOME is NFS-mounted on the Barge VM.

## Requirements

Expand Down Expand Up @@ -37,11 +37,11 @@ or
$ brew install xhyve
```

## Setting up DockerRoot images and tools
## Setting up Barge images and tools

```
$ git clone https://github.com/ailispaw/docker-root-xhyve
$ cd docker-root-xhyve
$ git clone https://github.com/bargees/barge-xhyve
$ cd barge-xhyve
$ make init
```

Expand All @@ -50,8 +50,8 @@ $ make init
```
$ sudo ./xhyverun.sh [<dir>]
Welcome to DockerRoot docker-root /dev/ttyS0
docker-root login:
Welcome to Barge barge /dev/ttyS0
barge login:
```

or
Expand All @@ -65,55 +65,53 @@ Booting up...
- On iTerm.app: This will split the current window, then you will see in the bottom pane as below.

```
Welcome to DockerRoot docker-root /dev/ttyS0
docker-root login:
Welcome to Barge barge /dev/ttyS0
barge login:
```

## Logging In

- ID: docker
- Password: docker (in most instances you will not be prompted for a password)
- ID: bargee
- Password: bargee (in most instances you will not be prompted for a password)

```
$ make ssh
docker-root-xhyve: running on 192.168.64.2
docker@192.168.64.2's password:
Welcome to DockerRoot version 1.3.10, Docker version 1.9.1, build 66c06d0-stripped
[docker@docker-root ~]$
barge-xhyve: running on 192.168.64.2
bargee@192.168.64.2's password:
Welcome to Barge 2.0.0, Docker version 1.9.1, build 66c06d0-stripped
[bargee@barge ~]$
```

## Shutting Down

Use `halt` command to shut down in the VM:

```
[docker@docker-root ~]$ sudo halt
halt[316]: Stopping Docker daemon
docker[320]: Loading /var/lib/docker-root/profile
docker[320]: Stopping Docker daemon
halt[316]: Executing shutdown scripts in /etc/init.d
[bargee@barge ~]$ sudo halt
halt[324]: Executing shutdown scripts in /etc/init.d
Stopping crond... OK
docker[332]: Loading /etc/default/docker
docker[332]: Stopping Docker daemon
Stopping sshd... OK
Saving random seed... done.
halt[316]: halt
[docker@docker-root ~]$ reboot: System halted
halt[324]: halt
[bargee@barge ~]$ reboot: System halted
$
```

or, use `make halt` on the host:

```
$ make halt
docker-root-xhyve: running on 192.168.64.2
[email protected]'s password:
halt[317]: Stopping Docker daemon
docker[321]: Loading /var/lib/docker-root/profile
docker[321]: Stopping Docker daemon
halt[317]: Executing shutdown scripts in /etc/init.d
barge-xhyve: running on 192.168.64.2
[email protected]'s password:
halt[326]: Executing shutdown scripts in /etc/init.d
Stopping crond... OK
docker[334]: Loading /etc/default/docker
docker[334]: Stopping Docker daemon
Stopping sshd... OK
Saving random seed... done.
halt[317]: halt
halt[326]: halt
Connection to 192.168.64.2 closed by remote host.
Shutting down...
```
Expand All @@ -138,12 +136,12 @@ Then, in the VM, or on the host if you have installed the Docker client:

```
$ make env
docker-root-xhyve: running on 192.168.64.2
barge-xhyve: running on 192.168.64.2
export DOCKER_HOST=tcp://192.168.64.2:2375;
unset DOCKER_CERT_PATH;
unset DOCKER_TLS_VERIFY;
$ eval $(make env)
docker-root-xhyve: running on 192.168.64.2
barge-xhyve: running on 192.168.64.2
$ docker info
Containers: 0
Expand All @@ -153,35 +151,35 @@ Storage Driver: overlay
Backing Filesystem: extfs
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 4.4.8-docker-root
Operating System: DockerRoot v1.3.10
Kernel Version: 4.4.8-barge
Operating System: Barge 2.0.0
CPUs: 1
Total Memory: 999.4 MiB
Name: docker-root
ID: H2SV:IRHA:ZJ23:J3CL:KLHE:V2IP:UML4:YPEE:TVW2:NT6V:QFAM:3X6I
Name: barge
ID: 4PSM:WE3D:OB7Q:TSDO:QIXD:YRVU:YVJP:C45G:TVHR:QOBG:VUBS:NK4V
Debug mode (server): true
File Descriptors: 12
Goroutines: 18
System Time: 2016-04-20T23:42:19.078377304Z
System Time: 2016-04-26T18:39:48.469457293Z
EventsListeners: 0
Init SHA1:
Init Path: /opt/bin/docker
Docker Root Dir: /mnt/vda1/var/lib/docker
```

## Upgrading DockerRoot
## Upgrading Barge

When DockerRoot is upgraded and docker-root-xhyve is updated,
When Barge is upgraded and barge-xhyve is updated,

```
$ git pull origin master
$ make upgrade
$ make up
$ make ssh
[docker@docker-root ~]$ sudo cp /var/lib/docker-root/start.sh /var/lib/docker-root/start.old
[docker@docker-root ~]$ sudo wget -qO /var/lib/docker-root/start.sh https://raw.githubusercontent.com/ailispaw/docker-root-xhyve/master/contrib/configs/start.sh
[docker@docker-root ~]$ sudo chmod +x /var/lib/docker-root/start.sh
[docker@docker-root ~]$ sudo reboot
[bargee@barge ~]$ sudo cp /etc/init.d/start.sh /etc/init.d/start.old
[bargee@barge ~]$ sudo wget -qO /etc/init.d/start.sh https://raw.githubusercontent.com/bargees/barge-xhyve/master/contrib/configs/start.sh
[bargee@barge ~]$ sudo chmod +x /etc/init.d/start.sh
[bargee@barge ~]$ sudo reboot
```

## Resources
Expand Down
8 changes: 4 additions & 4 deletions contrib/configs/start.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh

NFS_ROOT=$(cat /proc/cmdline | sed -n 's/^.*docker-root.nfsroot="\([^"]\+\)".*$/\1/p')
SHARED_FOLDER=$(cat /proc/cmdline | sed -n 's/^.*docker-root.shared_folder="\([^"]\+\)".*$/\1/p')
NFS_ROOT=$(cat /proc/cmdline | sed -n 's/^.*barge.nfsroot="\([^"]\+\)".*$/\1/p')
SHARED_FOLDER=$(cat /proc/cmdline | sed -n 's/^.*barge.shared_folder="\([^"]\+\)".*$/\1/p')
: ${SHARED_FOLDER:="${NFS_ROOT}"}

VIRTFS_UNAME=$(cat /proc/cmdline | sed -n 's/^.*docker-root.virtfs_uname=\([^ ]\+\).*$/\1/p')
VIRTFS_UNAME=$(cat /proc/cmdline | sed -n 's/^.*barge.virtfs_uname=\([^ ]\+\).*$/\1/p')

GW_IP=$(ip route get 8.8.8.8 | awk 'NR==1 {print $3}')

Expand All @@ -16,7 +16,7 @@ if [ -n "${SHARED_FOLDER}" ]; then
mkdir -p "${MOUNT_POINT}"

if [ -n "${VIRTFS_UNAME}" ]; then
mount -t 9p -o version=9p2000,trans=virtio,access=any,uname=${VIRTFS_UNAME},dfltuid=$(id -u docker),dfltgid=$(id -g docker) host "${MOUNT_POINT}"
mount -t 9p -o version=9p2000,trans=virtio,access=any,uname=${VIRTFS_UNAME},dfltuid=$(id -u bargee),dfltgid=$(id -g bargee) host "${MOUNT_POINT}"
fi
if ! mountpoint -q "${MOUNT_POINT}"; then
if [ -n "${GW_IP}" ]; then
Expand Down
46 changes: 27 additions & 19 deletions contrib/makehdd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
4GB for example

```
$ dd if=/dev/zero of=vm/docker-root-data.img bs=1g count=4
$ dd if=/dev/zero of=vm/barge-data.img bs=1g count=4
4+0 records in
4+0 records out
4294967296 bytes transferred in 11.520751 secs (372802719 bytes/sec)
Expand All @@ -14,19 +14,19 @@ $ dd if=/dev/zero of=vm/docker-root-data.img bs=1g count=4
## Set up a persistent disk

- Boot it on xhyve
- Download and execute [makehdd.sh](https://github.com/ailispaw/docker-root-xhyve/blob/master/contrib/makehdd/makehdd.sh)
- Download and execute [makehdd.sh](https://github.com/bargees/barge-xhyve/blob/master/contrib/makehdd/makehdd.sh)

```
$ sudo ./xhyverun.sh
Welcome to DockerRoot docker-root /dev/ttyS0
docker-root login: docker
Welcome to Barge barge /dev/ttyS0
barge login: bargee
Password:
Welcome to DockerRoot version 1.3.10, Docker version 1.9.1, build 66c06d0-stripped
[docker@docker-root ~]$ wget https://raw.githubusercontent.com/ailispaw/docker-root-xhyve/master/contrib/makehdd/makehdd.sh
[docker@docker-root ~]$ chmod +x makehdd.sh
[docker@docker-root ~]$ sudo ./makehdd.sh
[docker@docker-root ~]$ sudo fdisk -l
Welcome to Barge 2.0.0, Docker version 1.9.1, build 66c06d0-stripped
[bargee@barge ~]$ wget https://raw.githubusercontent.com/bargees/barge-xhyve/master/contrib/makehdd/makehdd.sh
[bargee@barge ~]$ chmod +x makehdd.sh
[bargee@barge ~]$ sudo ./makehdd.sh
[bargee@barge ~]$ sudo fdisk -l
Disk /dev/vda: 4294 MB, 4294967296 bytes
64 heads, 32 sectors/track, 4096 cylinders
Expand All @@ -37,19 +37,27 @@ Units = cylinders of 2048 * 512 = 1048576 bytes
/dev/vda2 1 955 977904 82 Linux swap
Partition table entries are not in disk order
[docker@docker-root ~]$ ls -l /mnt/vda1/var/lib/docker-root/
total 8
-rw-r--r-- 1 root root 47 Apr 22 03:45 profile
-rwxr-xr-x 1 root root 1123 Apr 22 03:45 start.sh*
[docker@docker-root ~]$ sudo halt
halt[301]: Stopping Docker daemon
docker[305]: Stopping Docker daemon
halt[301]: Executing shutdown scripts in /etc/init.d
[bargee@barge ~]$ df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 921012 47192 873820 5% /
devtmpfs 506040 0 506040 0% /dev
tmpfs 511672 0 511672 0% /run
cgroup 511672 0 511672 0% /sys/fs/cgroup
/dev/vda1 2949500 4760 2767540 0% /mnt/vda1
overlay 2949500 4760 2767540 0% /etc
[bargee@barge ~]$ ls -l /etc/default/docker
-rw-r--r-- 1 root root 47 Apr 26 19:21 /etc/default/docker
[bargee@barge ~]$ ls -l /etc/init.d/start.sh
-rwxr-xr-x 1 root root 1105 Apr 26 19:21 /etc/init.d/start.sh*
[bargee@barge ~]$ sudo halt
halt[309]: Executing shutdown scripts in /etc/init.d
Stopping crond... OK
docker[317]: Loading /etc/default/docker
docker[317]: Stopping Docker daemon
Stopping sshd... OK
Saving random seed... done.
halt[301]: halt
[docker@docker-root ~]$ reboot: System halted
halt[309]: halt
[bargee@barge ~]$ reboot: System halted
```

Done.
16 changes: 10 additions & 6 deletions contrib/makehdd/makehdd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,24 @@ MNT=/mnt/vda1
until [ -b "${DEV}2" ]; do
sleep 0.5
done
mkswap -L DOCKERROOT-SWAP ${DEV}2
mkswap -L BARGE-SWAP ${DEV}2

(echo n; echo p; echo 1; echo; echo; echo w) | fdisk ${DEV}
until [ -b "${DEV}1" ]; do
sleep 0.5
done
mkfs.ext4 -b 4096 -i 4096 -F -L DOCKERROOT-DATA ${DEV}1
mkfs.ext4 -b 4096 -i 4096 -F -L BARGE-DATA ${DEV}1

mkdir -p ${MNT}
mount -t ext4 ${DEV}1 ${MNT}
mkdir -p ${MNT}/var/lib/docker-root

wget -qO ${MNT}/var/lib/docker-root/profile https://raw.githubusercontent.com/ailispaw/docker-root-xhyve/master/contrib/configs/profile
wget -qO ${MNT}/var/lib/docker-root/start.sh https://raw.githubusercontent.com/ailispaw/docker-root-xhyve/master/contrib/configs/start.sh
chmod +x ${MNT}/var/lib/docker-root/start.sh
mkdir -p ${MNT}/etc
mkdir -p ${MNT}/work/etc
mount -t overlay overlay -o lowerdir=/etc,upperdir=${MNT}/etc,workdir=${MNT}/work/etc /etc

mkdir -p /etc/default
wget -qO /etc/default/docker https://raw.githubusercontent.com/bargees/barge-xhyve/master/contrib/configs/profile
wget -qO /etc/init.d/start.sh https://raw.githubusercontent.com/bargees/barge-xhyve/master/contrib/configs/start.sh
chmod +x /etc/init.d/start.sh

sync; sync; sync
32 changes: 17 additions & 15 deletions contrib/resizehdd.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
4GB more for example

```
$ dd if=/dev/zero bs=1g count=4 >> vm/docker-root-data.img
$ dd if=/dev/zero bs=1g count=4 >> vm/barge-data.img
4+0 records in
4+0 records out
4294967296 bytes transferred in 11.438091 secs (375496862 bytes/sec)
Expand All @@ -14,30 +14,32 @@ $ dd if=/dev/zero bs=1g count=4 >> vm/docker-root-data.img
## Re-partition the disk

```
$ make run
$ make up
Booting up...
$ make ssh
docker-root-xhyve: running on 192.168.64.2
[email protected]'s password:
Welcome to DockerRoot version 1.1.0, Docker version 1.8.3, build f4bf5c7
[docker@docker-root ~]$ (echo d; echo 1; echo n; echo p; echo 1; echo; echo; echo w) | sudo fdisk /dev/vda
[docker@docker-root ~]$ sudo reboot
reboot[275]: Stopping Docker daemon
docker[285]: Stopping Docker daemon
reboot[275]: Executing shutdown scripts in /etc/init.d
barge-xhyve: running on 192.168.64.2
[email protected]'s password:
Welcome to Barge 2.0.0, Docker version 1.9.1, build 66c06d0-stripped
[bargee@barge ~]$ (echo d; echo 1; echo n; echo p; echo 1; echo; echo; echo w) | sudo fdisk /dev/vda
[bargee@barge ~]$ sudo reboot
reboot[332]: Executing shutdown scripts in /etc/init.d
Stopping crond... OK
docker[340]: Loading /etc/default/docker
docker[340]: Stopping Docker daemon
Stopping sshd... OK
Saving random seed... done.
reboot[275]: reboot
reboot[332]: reboot
Connection to 192.168.64.2 closed by remote host.
```

## Resize the disk after reboot

```
$ make ssh
docker-root-xhyve: running on 192.168.64.2
docker@192.168.64.2's password:
Welcome to DockerRoot version 1.1.0, Docker version 1.8.3, build f4bf5c7
[docker@docker-root ~]$ sudo resize2fs /dev/vda1
barge-xhyve: running on 192.168.64.2
bargee@192.168.64.2's password:
Welcome to Barge 2.0.0, Docker version 1.9.1, build 66c06d0-stripped
[bargee@barge ~]$ sudo resize2fs /dev/vda1
resize2fs 1.42.13 (17-May-2015)
Filesystem at /dev/vda1 is mounted on /mnt/vda1; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
Expand Down
Loading

0 comments on commit c8fcedd

Please sign in to comment.