Skip to content

Development

Nicholas Wilde edited this page Feb 24, 2021 · 10 revisions

Setup

My docker images are typically linux multi-architecture (armv7, arm64, & amd64) because I run a RPi cluster. I use buildx to build my multi-architecture images.

Check that you can build the following:

$ docker buildx ls
NAME/NODE    DRIVER/ENDPOINT             STATUS  PLATFORMS
mybuilder *  docker-container
  mybuilder0 unix:///var/run/docker.sock running linux/amd64, linux/arm64, linux/arm/v7

If you are having trouble building arm images on a x86 machine, see this blog post.

Also checkout qemu-user-static.

$ make build

task

The docker repos are in the process of being converted to using task rather than make for better flexibility.

Installation

# For Default Installion to ./bin with debug logging
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d

# For Installation To /usr/local/bin for userwide access with debug logging
# May require sudo sh
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin

Development

  1. Create a new repository using this repository as a template. Make sure the repo name is in the form docker-<app name> so that the ci github action can property extract the docker image name.
  2. Update the make.env/task.env with the appropriate variables.
  3. Rename the Dockerfile.alpine or Docker.ubuntu files to Dockerfile depending on which base image you'd like to use. Delete the one that is not used.
  4. Develop the Dockerfile.
  5. Use make checksum/task checksum to get the checksum of the downloaded package file. The URL in the Makefile may need to be updated depending on the app. Add the checksum to the make.env/task.env file and the Dockerfile. Note: the target will still produce a checksum even if the URL doesn't exist.
  6. Use make build/task build and make all/task all to build the image.
  7. Use make load/task load to load the image to your cache.
  8. Use make run/task run to run the image. You may use Ctrl + c or Ctrl + z to stop the image. Because the image is started using make or task, the container might not stop correctly. You may use make stop/task stop to stop the container.
  9. Use make stop to stop the container if it's running the in background.
  10. Lint the images.

Troubleshooting

See Troubleshooting

Clone this wiki locally