Skip to content

Build your worker image

Local docker build

To build a docker image of the worker we've previously built, we can use the datashare-python script.

It's a tiny wrapper around the docker compose CLI:

./datashare-python build datashare-python=> [datashare-python internal] booting buildkit 0.9s
=> => starting container buildx_buildkit_strange_curran0 0.9s
=> [datashare-python internal] load build definition from Dockerfile
...
=> => exporting layers 56.1s
=> => exporting manifest sha256:7462a3f43df6073c57fc2482726a65d43e4f83f68ccd098ec0804b8b959d9a17 0.0s
=> => exporting config sha256:184ed641f1ee82d4eb068143702d3cbec32b25413051764000353b02458e12a1 0.0s
=> => sending tarball 38.7s
=> [datashare-python datashare-python] importing to docker

Publish to Docker Hub

You can also clone the template repository:

clone_template.png

and use the CI to build and publish the worker image to Docker Hub.

To publish:

  • make sure to set the DOCKERHUB_USERNAME and DOCKERHUB_TOKEN (see documentation)
  • remove or comment the if: false line in the publish-to-dockerhub job of the .github/pyblish.yml workflow
  • then commit, create a tag and push it to trigger the build