github.com/metacurrency/holochain@v0.1.0-alpha-26.0.20200915073418-5c83169c9b5b/docker/README.md (about) 1 # Holochain Docker Usage 2 This document provides a description and usage instructions for the different use-cases of Holochain Docker images. 3 4 TODO: This file and the hc-dev-tool scripts are out of data, and need to be updated. 5 6 <!-- TOC depthFrom:2 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 --> 7 8 - [Docker use-cases](#docker-use-cases) 9 - [Multi-Node Tests](#multi-node-tests) 10 - [Development](#development) 11 - [Packaging Holochain Apps for End-Users](#packaging-holochain-apps-for-end-users) 12 - [Images](#images) 13 - [Holochain/holochain-proto](#metacurrencyholochain) 14 - [hc-dev-tools](#hc-dev-tools) 15 16 <!-- /TOC --> 17 18 ## Docker use-cases 19 This is a list of use-cases for Docker in the context of Holochain. Once you have found the Docker image for your needs, scroll down to the relevant image section below. 20 21 ### Development 22 Docker can also be used for doing development inside of containers. This can be helpful for developers who are unable to (or don't want to) run Holochain directly on their system. 23 24 For this use-case, one of the [hc-dev-tools](#hc-dev-tools) images should be built and run interactively. 25 26 ### Packaging Holochain Apps for End-Users 27 Docker can also be used for distributing a Holochain application as an image. 28 29 For this use-case one of the [Holochain/holochain-proto](#metacurrencyholochain) images should be used as the base of a custom image for your project. 30 31 ## Images 32 This is a list of Docker images [published by holochain](https://hub.docker.com/u/metacurrency/) as well as instructions on how to use them. 33 34 ### Holochain/holochain-proto 35 These images are based on the official [`golang`](https://hub.docker.com/_/golang/) with the addition of installing the `hc` command. 36 37 In order to use these images place their tag in the `FROM` statement of your Dockerfile. 38 39 Example of an image which distributes a holochain app: 40 ```Dockerfile 41 FROM Holochain/holochain-proto 42 43 RUN hcadmin init address@example.org 44 45 ENV appdir="/home/holochain/app" 46 47 COPY . ${appdir} 48 # Files when first copied are owned by root. 49 RUN sudo chown -R holochain:holochain ${appdir}/.. \ 50 \ 51 && hc clone ${appdir} MYAPPNAMEHERE \ 52 && rm -rf ${appdir} \ 53 && hc gen chain MYAPPNAMEHERE 54 55 CMD ["hc", "web", "MYAPPNAMEHERE"] 56 ``` 57 58 ### hc-dev-tools 59 These images are basically the official `golang` images except with the `hc` command and a few other tools installed. 60 61 In order to build the latest version of this image, run the following commands from the root of the [Holochain](https://github.com/holochain/holochain-proto) repository: 62 * Build it using the `docker/build` 63 * Run it using the `docker/run`