-
Notifications
You must be signed in to change notification settings - Fork 1
/
epic-docker-guide-manual.txt
74 lines (53 loc) · 2.85 KB
/
epic-docker-guide-manual.txt
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
66
67
68
69
70
71
72
73
# Manual Docker Image creation process for Epic Node Server
# Note: You can also put epic binary (renamed epic-node) in same folder cloned from Repo and run make
# Note: If .tar downloaded from Repo Release or created with make, skip to 'docker load' line
$ docker pull ubuntu:20.04
$ docker run -it --name epic-dock ubuntu:20.04 bash (create temp build container)
:/$ <- inside running container (as root)
:/$ apt update
:/$ apt -y install sudo openssl libncurses5 libncursesw5 libncursesw6 zlib1g screen locales nano
:/$ useradd -u 1000 -G sudo -U -m -s /bin/bash epicnode
:/$ echo "epicnode ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
:/$ locale-gen en_US.UTF-8
:/$ mkdir -p /home/epicnode/.epic/main
$ <- run these from another terminal with container running and in Repo cloned folder
$ docker cp foundation.json epic-dock:/home/epicnode/.epic/main/foundation.json
$ docker cp epic-server.toml epic-dock:/home/epicnode/.epic/main/epic-server.toml
$ docker cp entrypoint.sh epic-dock:/home/epicnode/entrypoint.sh
$ docker cp epic-node epic-dock:/home/epicnode/epic-node
:/$ <- *inside running container*
:/$ cd /home/epicnode
:~$ chown -R epicnode:epicnode .
:~$ chmod +x entrypoint.sh
:~$ chmod +x epic-node
$ <- run these from another terminal with container running and in Repo cloned folder
$ docker commit --change='ENTRYPOINT ["/home/epicnode/entrypoint.sh"]' \
--change "ENV LANG=en_US.UTF-8" --change "USER epicnode" epic-dock epic-node (create image)
$ docker save -o epic-docker.tar epic-node (create .tar backup from image)
$ docker stop epic-dock
$ docker rm epic-dock (remove temp build container)
# Docker File Execution and Interaction
# Note: Create epic-node Image from .tar (if downloaded from Repo Release or created with make)
# Note: Image epic-node already exists if created with commit/save, skip to docker run
$ docker load < epic-docker.tar
# Image epic-node ready to run as Container epic-node
# Create and run Container from Image
$ docker run --restart always --name epic-node -h 'epic-node' -d epic-node
# Check Container epic-node is running
$ docker logs -f epic-node (<ctrl>C to exit) or $ docker stats (<ctrl>C to exit)
# Interact with running Container
$ docker exec -it epic-node bash
epicnode@epic-node:~$ screen -r server-node (attach to screen running EPIC node)
(Note: <ctrl>A then D to detach from screen and back to epicnode@epic-node:~$)
epicnode@epic-node:~$ exit (to leave Docker Container)
$
# Stop/Start Container
$ docker stop epic-node
$ docker start epic-node
# Edit crontab (crontab -e) to restart every other day (add to end of crontab file <ctrl>X-Y to save)
5 1 */2 * * docker stop epic-node && sleep 20 && docker start epic-node
# Note: If node data becomes corrupted or server gets hung up:
# Stop and delete Container and Image and re-run load and run lines above.
$ docker stop epic-node
$ docker rm epic-node
$ docker rmi epic-node