forked from zcash/lightwalletd
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile
65 lines (60 loc) · 2.18 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# /************************************************************************
# File: Dockerfile
# Author: mdr0id
# Date: 9/3/2019
# Description: Used for devs that have not built zcashd or lightwalletd on
# on existing system
# USAGE:
#
# To build image: make docker_img
# To run container: make docker_image_run
#
# This will place you into the container where you can run zcashd, zcash-cli,
# lightwalletd server etc..
#
# First you need to get zcashd sync to current height on testnet, from outside container:
# make docker_img_run_zcashd
#
# Sometimes you need to manually start zcashd for the first time, from inside the container:
# zcashd -printtoconsole
#
# Once the block height is at least 280,000 you can go ahead and start lightwalletd
# make docker_img_run_lightwalletd_insecure_server
#
# If you need a random bash session in the container, use:
# make docker_img_bash
#
# If you get kicked out of docker or it locks up...
# To restart, check to see what container you want to restart via docker ps -a
# Then, docker restart <container id>
# The reattach to it, docker attach <container id>
#
# Known bugs/missing features/todos:
#
# *** DO NOT USE IN PRODUCTION ***
#
# - Create docker-compose with according .env scaffolding
# - Determine librustzcash bug that breaks zcashd alpine builds at runtime
# - Once versioning is stable add config flags for images
# - Add mainnet config once lightwalletd stack supports it
#
# ************************************************************************/
# Create layer in case you want to modify local lightwalletd code
FROM golang:1.13 AS lightwalletd_base
ADD . /go/src/github.com/zcash/lightwalletd
WORKDIR /go/src/github.com/zcash/lightwalletd
RUN make \
&& /usr/bin/install -c ./lightwalletd /usr/local/bin/ \
&& mkdir -p /var/lib/lightwalletd/db \
&& chown 2002:2002 /var/lib/lightwalletd/db
ARG LWD_USER=lightwalletd
ARG LWD_UID=2002
RUN useradd --home-dir /srv/$LWD_USER \
--shell /bin/bash \
--create-home \
--uid $LWD_UID\
$LWD_USER
USER $LWD_USER
WORKDIR /srv/$LWD_USER
ENTRYPOINT ["lightwalletd"]
CMD ["--help"]