Browse Source

replace bitcoind with bitcoin-qt

Fabian Peter Hammerle 3 years ago
parent
commit
7f45d612a0
2 changed files with 21 additions and 17 deletions
  1. 8 10
      Dockerfile
  2. 13 7
      docker-compose.yml

+ 8 - 10
Dockerfile

@@ -3,16 +3,14 @@ FROM alpine:3.12
 # > All command-line options (except for '-datadir' and '-conf') may be specified in a configuration file
 ENV DATA_DIR_PATH=/var/lib/bitcoin
 ARG BITCOIN_CORE_PACKAGE_VERSION=0.19.1-r0
-# > Executing bitcoin-0.19.1-r0.post-install
-# > Generated random user / password / port in: /etc/bitcoin.conf
-RUN apk add --no-cache bitcoin=$BITCOIN_CORE_PACKAGE_VERSION \
-    && rm /etc/bitcoin.conf \
-    && mkdir "$DATA_DIR_PATH" \
-    && chown -c bitcoin "$DATA_DIR_PATH"
+ARG TTF_OPENSANS_PACKAGE_VERSION=1.10-r0
+ARG USER=bitcoin
+RUN apk add --no-cache \
+        bitcoin-qt=$BITCOIN_CORE_PACKAGE_VERSION \
+        ttf-opensans=$TTF_OPENSANS_PACKAGE_VERSION \
+    && adduser -h "$DATA_DIR_PATH" -u 100 -S $USER
 VOLUME $DATA_DIR_PATH
 
-USER bitcoin
+USER $USER
 EXPOSE 8333/tcp
-# json-rpc api
-EXPOSE 8332/tcp
-CMD ["sh", "-c", "exec bitcoind -datadir=\"$DATA_DIR_PATH\" -rpcbind=0.0.0.0 -rpcallowip=172.16.0.0/12"]
+CMD ["sh", "-c", "exec bitcoin-qt -datadir=\"$DATA_DIR_PATH\" -printtoconsole"]

+ 13 - 7
docker-compose.yml

@@ -4,23 +4,29 @@ volumes:
   data:
 
 services:
-  bitcoind:
+  bitcoin-qt:
     build: .
-    image: fphammerle/bitcoin-core
-    container_name: bitcoind
+    image: fphammerle/bitcoin-core-qt
+    container_name: bitcoin_qt
+    environment:
+      DISPLAY: ':0'
+      LIBGL_DEBUG: verbose
     volumes:
     - type: volume
       source: data
       target: /var/lib/bitcoin
+    - type: bind
+      # Xephyr -resizeable :8333
+      source: /tmp/.X11-unix/X8333
+      target: /tmp/.X11-unix/X0
     read_only: yes
-    ports:
-    - '8333:8333'
-    - '127.0.0.1:8332:8332'
+    #ports:
+    #- '8333:8333'
     cap_drop: [ALL]
     security_opt: [no-new-privileges]
     cpus: 0.5
     # > Memory cgroup out of memory: Killed process 81421 (bitcoind) total-vm:1379624kB, [...]
     mem_limit: 2g
-    restart: unless-stopped
+    restart: on-failure
 
 # https://docs.docker.com/compose/compose-file/compose-file-v2/