A cointainer is a coin-daemon in a docker-container.
Place new Cointainers in a subfolder named by its ticker name. A cointainer requires a Dockerfile to build a docker container, a .dockerignore file and a docker-compose.yml file to configure Docker Compose for local testing and usage and last but not least a cointainer.yml file for the stage/production deployments.
FROM cryptobridge/baseimage:bionic-build
# clone repo and run build
RUN git clone <coin-repo>/ . && \
cd <coin-dir> && \
./autogen.sh && \
./configure && \
make
FROM cryptobridge/baseimage:bionic
COPY --from=build /build/<coin-name>/src/coind /usr/local/bin/coind
COPY --from=build /build/<coin-name>/src/coin-cli /usr/local/bin/coin-cli
EXPOSE 12345
USER crypto
CMD ["coind"]
We use a multistage build for the cointainers to reduce the image size. The upper part is used to build or download the coin daemon, the second part is the execution part which gets deployed then.
We have 4 predefined docker images.
cryptobridge/baseimage:xenial-build (Including build tools)cryptobridge/baseimage:xenial (Including all runtime libraries)cryptobridge/baseimage:bionic-build (Including build tools)cryptobridge/baseimage:bionic (Including all runtime libraries)Please use this images. They all based on the phusion/baseimage which is based on ubuntu 16.04 or 18.04. The baseimages containing all required build tools and it shouldn't be nacessary to install any build tools for the most coins. Feel free to add new baseimages or extend the existing one. (See baseimage subfolder)
data/
version: '3.6'
services:
btc:
context: '.'
volumes:
- ./data/:/home/crypor/.bitcoin
container_name: cryptobridge/cointainer-btc
version: '3.6'
services:
btc:
image: cryptobridge/cointainer-btc
ports:
- "8332:8332"
volumes:
- cointainer-btc:/root/.bitcoin
command:
- "bitcoind"
deploy:
mode: replicated
replicas: 1
user: root
tty: true
volumes:
cointainer-btc:
driver: rexray/ebs
driver_opts:
name: 'btc'
size: 400
type: 'gp2'
encrypted: 'true'
Change into the folder of the required coin and run docker-compose build. The Command downloads all required Docker images and compiles the cointainer. This step my take some time. Repeat this step if you made any changes in the Dockerfile file.
docker-compose build [coinname]
Use docker-compose for localy usage and testing. It is more comfortable then the plain docker cli. Docker compose requires a docker-compose.yml file at the current working dir.
The first time you start a daemon, it downloads the full blockchain to your local machine. Please check if your machine has enough space. Bitcoin requires about 240GB disk space. All necessary data are stored under <coinname>/data/ on your local machine. This folder will be mounted into the cointainer during startup.
cd btc/
docker-compose up [coinname]
docker-compose exec [coinname] bash
docker-compose stop [coinname]
Docker forwards the RPC ports of the running cointainer to the host machine. The list below shows all cointainer ports. (Please update it if you add a new one)
| Coin name | Port | Testnet Port |
|---|---|---|
| Bitcoin | 8332 | 18332 |
| Bridgecoin | ???? | |
| Raven | 8766 | 18766 |
docker tag [coin-dir]_[coinname] cryptobridge/cointainer-[coinname]docker push cryptobridge/cointainer-[coinname]docker stack deploy -c deploy/[coinname].yml cointainer** = Could be done by Travis
docker service ls
docker service ps <service-name>
docker stack deploy -c deploy/<filename>.yml cointainer
docker service logs --raw -f <service-name>
docker service scale <service-name>=0
docker service scale <service-name>=1
docker service scale <service-name>=0
or just remove it
docker service rm <service-name>
A removed cointainer can be restored by a redeploy
docker stack deploy -c deploy/<filename>.yml cointainer
Content type
Image
Digest
Size
136.4 MB
Last updated
about 7 years ago
docker pull cryptobridge/cointainer-hora:1.1