This repository contains a Dockerfile image to build a working Wake-on-LAN environment on startup
as well as a docker-compose file template.
The aim of this project is to provide a instant Wake-on-LAN instance (ability to send Wake-on-LAN magic packets using etherwake and wakeonlan) if you own docker
without needing to install etherwake and wakeonlan seperately
- Base Image: Debian:latest
- Entrypoint: etherwake
- Dependencies
- etherwake
- Folders (Recommended)
- ./wol/config/ : Place all your
wakeonlan
configuration files in here to mount into the container
- ./wol/config/ : Place all your
- Files
- ./wol/config/[wakeonlan-config-filename] : This is the WakeOnLAN configuration file; Refer to 'wol.template' for a sample config file
- docker(-ce)
- docker-compose
- Build Dockerfile image
docker build -t [docker-image-name] [dockerfile-path]
- Run docker image
-
General background
docker run -itd --name [container-name] [image-name] {other-commmands}
-
Run docker image with volume mapping (Recommended)
docker run -itd -v "[host-system-volume]:[container-volume]" --name [container-name] [image-name] {other-commmands}
-
- Stop docker container
docker container stop [container-name]
- Remove docker container
docker container rm [container-name]
- Remove docker image
docker image rm [container-name]
-
Running
docker-compose up -d --build
-
Teardown
docker-compose down
- Check issues with docker container
- Check container process
docker (container) ps
- Check docker container logs
docker logs [container-name]
- Check container process
- Basic startup with volume mount
- Dockerfile/docker run
- Build dockerfile into image
docker build -t [new-docker-image-name] [path-to-dockerfile (i.e. '.')]
- docker run and startup a container using built Dockerfile image
- with Volume mounting : This is like using the key 'volume:' in a docker-compose environment to mount a folder in your host system to the container
- This lets you effectively get the files that will be output by rust, as well as let the docker environment see your source files
docker run -itd -v $(pwd)/wol/config/[wakeonlan-config-filename]:/wol/configs --name [container-name] [docker-image-name]
- with Volume mounting : This is like using the key 'volume:' in a docker-compose environment to mount a folder in your host system to the container
- Execute commands in container
- Create new project workspace
- Because you mounted the source file volume directory, the outputted project workspace is also found there
docker exec -it [container-name] {etherwake-options} [mac-address-here]
- Create new project workspace
- Stop docker container
docker container stop [container-name]
- Remove docker container
docker container rm [container-name]
- Remove docker image
docker (image) stop [container-name]
- Build dockerfile into image
- docker-compose
- Startup docker-compose
docker-compose up -d --build
- Stop docker-compose
docker-compose down
- Start container
docker-compose start [container-name]
- Stop container
docker-compose stop [container-name]
- Startup docker-compose
- Dockerfile/docker run
-
Execute container with '-it' to get a shell
docker exec -it [container-name] [command]
-
wakeonlan
- Send WoL Magic Packets
docker exec -it [container-name] wakeonlan [Mac-address-here]
- Send WoL Magic Packets
-
etherwake
- Send WoL Magic Packets
docker exec -it [container-name] etherwake [MAC-address-here]
- Send WoL Magic Packets with Increased Debug Level (verbose)
docker exec -it [container-name] etherwake -D [MAC-address-here]
- Send WoL Magic Packets