Skip to content

LeastAuthority/magic-wormhole-docker

Repository files navigation

Magic Wormhole Docker images

Building Docker images of Magic Wormhole backend services and CLI:

The 2 first images are currently used in the magic-wormhole backend operated by https://github.com/LeastAuthority for use by the following products:

Integration test

This repository provides Docker Composer files to build and test the images. The test is basic: send and receive "Hello world!" message through a local wormhole.

# Build the back-end images
docker compose -f docker-compose-back.yml build
# Build the front-end images
docker compose -f docker-compose-front.yml build
# Start the back-end in the background
docker compose -f docker-compose-back.yml up --detach
# Start the front-end in the foreground
docker compose -f docker-compose-front.yml up
# Stop the back-end (or replay the previous step)
docker compose -f docker-compose-back.yml down

REM: Use docker-compose for older version.

Basic instructions

Select which source versions to use for the build

Update the requirements.in file in selected target folder and replace the Git hash used to determine the version:

magic-wormhole-mailbox-server @ https://github.com/magic-wormhole/magic-wormhole-mailbox-server@4b358859ba80de37c3dc0a5f67ec36909fd48234#egg=magic-wormhole-mailbox-server

or just give the desired released version:

magic-wormhole==0.12.0

Install pip-tools and run

pip-compile --generate-hashes requirements.in

Docker tags used for build results

In order to have an exact reference to the desired version we use

Variant Command Use case

latest tag reachable from current commit

git describe --tags

when building for tags on main

Short git hash of the current commit

git rev-parse --short HEAD

when building for non-tag commits on main

Tags an commit hashes reference this repository.

Manual build example

To manually build for a tag like reference, e. g. 0.4.1-11-gac91c3a.

Build Mailbox Service

cd mailbox

Build Docker image

docker build . -t leastauthority/magic-wormhole-mailbox:0.4.1-11-gac91c3a --build-arg VERSION_TAG=0.4.1-11-gac91c3a

Push image

With version tag

docker push leastauthority/magic-wormhole-mailbox:0.4.1-11-gac91c3a

and latest version

docker tag leastauthority/magic-wormhole-mailbox:0.4.1-11-gac91c3a leastauthority/magic-wormhole-mailbox:latest
docker push leastauthority/magic-wormhole-mailbox:latest

Build Relay Service or Implementation and CLI

Instructions are similar to the ones above …​