Commit 497b3863 authored by Krzysztof Jurewicz's avatar Krzysztof Jurewicz

Add Docker files

parent ba2c23ea
Pipeline #17434088 passed with stages
in 14 minutes and 2 seconds
.git/
.eunit
deps
*.o
*.beam
*.plt
erl_crash.dump
ebin/
*.d
doc/*
_rel/*
.erlang.mk/
priv/current_data.bin
.eunit
deps
*.o
......@@ -10,3 +8,4 @@ ebin/
*.d
doc/*
_rel/*
.erlang.mk/
stages:
- test
- build
- release
image: erlang:20
variables:
GIT_DEPTH: "3"
CONTAINER_REF_IMAGE: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}
CONTAINER_LATEST_IMAGE: ${CI_REGISTRY_IMAGE}:latest
test:
stage: test
before_script:
# Workaround for https://github.com/ninenines/erlang.mk/issues/501
- make plt || test $? -eq 2
script:
- make check
- make rel
build:
stage: build
image: docker:latest
script:
- docker build -t ${CONTAINER_REF_IMAGE} .
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- docker push ${CONTAINER_REF_IMAGE}
services:
- docker:dind
tags:
- docker
release:
stage: release
image: docker:latest
script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- docker pull ${CONTAINER_REF_IMAGE}
- docker tag ${CONTAINER_REF_IMAGE} ${CONTAINER_LATEST_IMAGE}
- docker push ${CONTAINER_LATEST_IMAGE}
services:
- docker:dind
tags:
- docker
only:
- master
FROM erlang:20
WORKDIR /app
COPY . /app
# We create .erlang.mk/ as a workaround until https://github.com/ninenines/erlang.mk/pull/744 is merged.
RUN mkdir -p .erlang.mk && make rel
EXPOSE 46658
CMD ["./_rel/ercoin_release/bin/ercoin_release", "foreground"]
......@@ -29,6 +29,28 @@ For support and other ephemeral discussions, see [the #ercoin IRC channel on irc
You can play with the node using [`ercoin_wallet`](https://gitlab.com/Ercoin/ercoin_wallet).
## Persistence
`./bootstrap.sh` downloads initial state for both ABCI client (Tendermint) and ABCI server (this repository) to the directory `~/.ercoin`. ABCI server dumps current state back to disc at the beginning of each epoch. If you want ABCI server to use other directory than `~/.ercoin`, set the `ERCOIN_HOME` variable.
## Docker integration
To run the project using [Docker Compose](https://docs.docker.com/compose/):
1. Install [IPFS](https://ipfs.io/) and run `ipfs init`.
2. `./bootstrap.sh`.
3. `docker-compose up`.
---
Docker images for tags and branches are automatically built in GitLab CI (unless tests are failing) and available in the [container registry](https://gitlab.com/Ercoin/ercoin/container_registry). For example, to pull an image generated from `master` branch:
```
docker pull registry.gitlab.com/ercoin/ercoin:master
```
`latest` tag points to `master`.
## Technical specification
All numbers are big endian.
......
version: "3.1"
services:
abci-server:
build: .
environment:
- ERCOIN_HOME=/ercoin
ports:
- 46658
volumes:
- ${ERCOIN_HOME}:/ercoin
tendermint:
image: tendermint/tendermint:0.15.0
ports:
- "46656:46656"
- "46657:46657"
volumes:
- ${ERCOIN_HOME}:/tendermint
links:
- abci-server
command: node --home /tendermint --proxy_app tcp://abci-server:46658
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment