This is a working, but very simple dummy project, that shall help to
- integrate open source projects into your On-Prem CI/CD pipeline
- provide a blue print for Alpine based dockerization
It implements a browser based simulation of reaction-diffusion systems using WebSockets, build in memoriam and as reminiscence to Alan Turing. The 3.045 bytes of code come from Yusuke Endoh and were an IOCCC winner in 2015.
Reaction-diffusion systems, proposed by Alan Turing in [1], are mathematical models in which two chemical substances are transformed into each other (local chemical reactions) and spread out (diffusion). Their interactions sometimes form non-trivial patterns, such as spots, spiral, dappling and labyrinths.
make
# point your browser to http://localhost:10042/ after running the following command
tcpserver -v 127.0.0.1 10042 src/oregonator src/ioccc.txt
^C
make clean
docker build --tag=ioccc .
Build the application stuff during docker image building via
- a single docker build with temporary virtual environments
apk add --no-cache --virtual .fetch-deps ... && \
apk add --no-cache --virtual .build-deps ... && \
... && \
apk del .fetch-deps .build-deps
- a multi-stage docker build
- or by feeding pre-build artefacts from somewhere
For the moment a multi-stage Dockerfile is provided. We are working on providing the other two examples.
A working docker-entrypoint.sh
skeleton for configuring the container during bootstrapping is provided.
It is strongly recommended to use the entrypoint pattern to initialize container data at runtime from the beginning for each image that is exposing a daemon as the service.
# access the container during development
docker run -p 10042:10042 -it --rm --name ioccc ioccc /bin/bash
# run the container during development
docker run -p 10042:10042 --rm --name ioccc ioccc
^C
# run the container in production
docker run -p 10042:10042 -d --rm --name ioccc ioccc
# point your browser to http://localhost:10042/ in any case...
To bump a new version, run locally:
make clean
make release v=0.1.0
You need write permissions to the upstream.
Remember that make
is using git hub CLI. There is a Wiki page with some further examples.
- automated DockerHub publishing
- releasing and publishing on GitHub via local build environment
- provide additional Dockerfiles
- Tini as explicit
init
for containers instead of--init
- mo as mustache template engine
- improve documentation
Written with StackEdit.
[1] Turing, A. M., "The Chemical Basis of Morphogenesis", Philosophical Transactions of the Royal Society, 1952.