docker build . \
--file alpine.Dockerfile \
--tag "dnclient:alpine-latest" \
--tag "dnclient:latest"
docker build . \
--file debian.Dockerfile \
--tag "dnclient:debian-latest" \
--tag "dnclient:latest"
To run the built image, use the following command:
docker run \
--name dnclient \
--cap-add NET_ADMIN \
--network host \
--volume defined:/etc/defined \
--volume /dev/net/tun:/dev/net/tun \
--env DN_ENROLLMENT_CODE="insert code here" \
--rm \
dnclient
A few notes:
- The
NET_ADMIN
capability and/dev/net/tun
volume are necessary to create the tun adapter on the host. --volume defined:/etc/defined
will persist the config to a named volume across runs.--env DN_ENROLLMENT_CODE="insert code here"
is necessary only for the first run. Get an enrollment code from https://admin.defined.net