Skip to content

Commit

Permalink
docker image is now based on debian, because of usb support
Browse files Browse the repository at this point in the history
  • Loading branch information
schulterklopfer committed Feb 25, 2020
1 parent 0e15de5 commit c1dabef
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 27 deletions.
54 changes: 32 additions & 22 deletions ckbunker_docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
FROM python:3.8.1-alpine
FROM python:3.8-slim-buster

WORKDIR /

RUN \
mkdir /static && \
mkdir /data && \
apk --no-cache add --update \
apt-get update && apt-get install -y \
bash \
tor \
libusb \
zlib \
libusb-1.0-0 \
zlib1g \
openssl \
hidapi \
libffi\
libhidapi-dev \
libffi6\
udev \
eudev \
freetype \
su-exec \
libfreetype6 \
gosu \
usbutils \
libjpeg && \
apk --no-cache add --update --virtual .build-deps \
git \
alpine-sdk \
libusb-dev \
zlib-dev \
openssl-dev \
hidapi-dev \
libffi-dev \
eudev-dev \
freetype-dev \
jpeg-dev && \
libjpeg-dev \
git \
libudev-dev \
build-essential \
libusb-1.0-0-dev \
zlib1g-dev \
libffi-dev \
libssl-dev \
libfreetype6-dev && \
# libfreetype6-dev \
# liblcms2-dev \
# libtiff-dev \
Expand All @@ -40,11 +36,25 @@ RUN \
pip install -r requirements.txt && \
pip install --editable . && \
ln -s /sys/bus /dev/bus && \
apk del .build-deps
apt-get remove --purge -y \
git \
build-essential \
libudev-dev \
libusb-1.0-0-dev \
zlib1g-dev \
libffi-dev \
libssl-dev \
libfreetype6-dev && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*

ENV PATH=${PATH}:/ck-bunker

COPY entrypoint.sh /
WORKDIR /ck-bunker

RUN echo "Log notice file /var/log/tor/notices.log" >> /etc/tor/torrc && \
echo "DataDirectory /var/lib/tor" >> /etc/tor/torrc && \
echo "ControlPort 9051" >> /etc/tor/torrc

ENTRYPOINT ["/entrypoint.sh"]
3 changes: 3 additions & 0 deletions ckbunker_docker/ckbunker-bash.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
# TODO: get it working without --privileged
docker run -p 9823:9823 -it --privileged --rm --device /dev/usb/hiddev0 cyphernode/ckbunker:latest 0:0 bash
3 changes: 3 additions & 0 deletions ckbunker_docker/ckbunker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
# TODO: get it working without --privileged
docker run -p 9823:9823 --privileged --rm --device /dev/usb/hiddev0 cyphernode/ckbunker:latest 0:0 ckbunker run
4 changes: 2 additions & 2 deletions ckbunker_docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh

su-exec tor tor &
su-exec $@
gosu debian-tor tor &
gosu $@
3 changes: 0 additions & 3 deletions ckbunker_docker/run.sh

This file was deleted.

0 comments on commit c1dabef

Please sign in to comment.