Browse Source

docker integration

Ian Goldberg 4 years ago
parent
commit
db1070f82a
3 changed files with 24 additions and 0 deletions
  1. 14 0
      Dockerfile.in
  2. 6 0
      build-docker
  3. 4 0
      run-docker

+ 14 - 0
Dockerfile.in

@@ -0,0 +1,14 @@
+FROM ubuntu:18.04
+RUN apt update
+RUN apt install -y python3 python3-pip python3-dev build-essential screen sudo
+RUN pip3 install merklelib
+RUN pip3 install pynacl
+RUN groupadd -g GROUP_ID walkingo
+RUN useradd -g walkingo -u USER_ID -m -s /bin/bash walkingo
+RUN adduser walkingo sudo
+RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
+USER walkingo
+WORKDIR /home/walkingo
+ENV SHELL=/bin/bash
+
+COPY --chown=walkingo:walkingo client.py dirauth.py network.py relay.py simulator.py ./

+ 6 - 0
build-docker

@@ -0,0 +1,6 @@
+#!/bin/bash
+
+mkdir -p docker
+sed "s/USER_ID/$(id -u)/; s/GROUP_ID/$(id -g)/" Dockerfile.in > docker/Dockerfile
+cp -av client.py dirauth.py network.py relay.py simulator.py docker/
+cd docker && docker build -t walkingonions .

+ 4 - 0
run-docker

@@ -0,0 +1,4 @@
+#!/bin/bash
+
+mkdir -p logdir
+exec docker run -v `/bin/pwd`/logdir:/home/walkingo/logdir -it walkingonions bash