Skip to content

Commit

Permalink
Avoid sparse file in docker layer, extract in entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
poplexity committed Aug 1, 2024
1 parent 2689360 commit 9eb6bbd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ WORKDIR /app
COPY config.ini /node/config.ini
COPY logging.json /node/logging.json
COPY data.tar.gz /node/data.tar.gz
COPY entrypoint.sh /app/entrypoint.sh

RUN tar -xvf /node/data.tar.gz -C /node && mv /node/data /node/data-dir
# Do the extraction in entrypoint.sh so shared_memory.bin remains sparse
#RUN tar -xvf /node/data.tar.gz -C /node && mv /node/data /node/data-dir

CMD ["nodeos", "--data-dir=/node/data-dir", "--config-dir=/node", "--disable-replay-opts", "--enable-stale-production"]
#CMD ["nodeos", "--data-dir=/node/data-dir", "--config-dir=/node", "--disable-replay-opts", "--enable-stale-production"]

CMD ["./entrypoint.sh"]
7 changes: 7 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -x

tar -xvf /node/data.tar.gz -C /node && mv /node/data /node/data-dir

nodeos --data-dir=/node/data-dir --config-dir=/node --disable-replay-opts --enable-stale-production

0 comments on commit 9eb6bbd

Please sign in to comment.