Running Boatswain as a container

Boatswain anywhere

Today Boatswain is available on Docker Hub which allows running Boatswain on any Docker server and it is independent from the OS platform. The project is hosted on GitLab and if you have any questions with regard to Boatswain, free feel to create an issue there.

Starting Boatswain as a container

First of all, register a Boatswain account to get your BOATSWAIN_TOKEN. With this token, you can now read the Docker logs as well as those system metrics on app.boatswain.io.

There are two ways to start the Boatswain container. Either running the native docker run command or using docker-compose.

By docker command

Replace the BOATSWAIN_TOKEN below and start the Boatswain container.

1
2
3
4
5
6
7
8
9
docker run --name boatswain \
  -e "BOATSWAIN_TOKEN=<TO_BE_REPLACED>" \
  -e "BOATSWAIN_PERIOD=default" \
  -v /var/run/docker.sock:/var/run/docker.sock \
  --pid host \
  --network host \
  --cap-add NET_ADMIN \
  --restart always \
  -d boatswainio/boatswain:latest boatswain

By docker compose

Create the following docker-compose.yml and fill in the BOATSWAIN_TOKEN.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
version: '3.2'
services:
  boatswain:
    image: boatswainio/boatswain:latest
    container_name: boatswain
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
    pid: "host"
    network_mode: "host"
    cap_add:
      - NET_ADMIN
    restart: always
    environment:
      BOATSWAIN_TOKEN: <TO_BE_REPLACED>
      BOATSWAIN_PERIOD: default

Then you can start the Boatswain container by

1
docker-compose up -d

Limitation

Although it’s much easier to run Boatswain as a container, the Disk Utilization graph in the Host Status page on app.boatswain.io could not show the correct values. That’s the only difference from host installation. Please refer to our docs portal or leave us a message if you need more information.