Skip to content

Development

Jonas Brømsø edited this page Jun 24, 2024 · 7 revisions

The primary notes on development of Ebirah is included in the README. This page contains notes on tips and tricks for developing on Ebirah. I mostly write these for myself, since I cannot always remember all the small things.

Building the Docker image for DockerHub

docker build -t jonasbn/ebirah:latest .

When building on Apple silicon (M1), this additional parameter --platform has to be specified and set to linux/amd64 for use with GitHub actions etc.

docker build --platform linux/amd64 -t jonasbn/ebirah:latest .

If not specifying the parameter the architecture will be: arm64

You can see the the architecture of your image like so:

docker image inspect jonasbn/ebirah:latest |grep -i architecture

REF: Blog post: "Create docker image on Apple Silicon M1 Mac" by Lakhan Samani.

Debugging the Docker image

docker run -it --entrypoint /bin/bash ebirah:latest

This was lifted from my TIL: "Use shell to inspect filesystem of layer"

Pushing the Docker image to DockerHub

# login
cat DOCKERHUB_ACCESS_TOKEN | docker login -u jonasbn --password-stdin

# Tag 
docker tag jonasbn/ebirah:TAGNAME

# Push
docker push jonasbn/ebirah:TAGNAME

Latest is always build automatically from master. Remember to logout between switching repositories.

Pushing the Docker image to GitHub Container Repository

This is currently being attempted automated using GitHub Actions, please see: .github/workflows/docker-publish.yml. Perhaps automation can be extended to cover both repositories.

# login
# REF: https://docs.github.com/en/free-pro-team@latest/packages/getting-started-with-github-container-registry/migrating-to-github-container-registry-for-docker-images
cat GITHUB_ACCESS_TOKEN | docker login ghcr.io -u jonasbn --password-stdin

# Tag 
docker tag ghcr.io/jonasbn/ebirah:TAGNAME

# Push
docker push ghcr.io/jonasbn/ebirah:TAGNAME

Remember to logout between switching repositories.