Breaking change: Docker to follow XDG spec (#2437)

change default dir inside docker from /var/lib/erigon to /home/erigon/.local/share/erigon
This commit is contained in:
Alex Sharov 2021-07-24 16:14:46 +07:00 committed by GitHub
parent 6801208497
commit 9398e2ff93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 10 deletions

View File

@ -5,20 +5,19 @@ RUN apk --no-cache add make gcc g++ linux-headers git bash ca-certificates libgc
WORKDIR /app
ADD . .
# expect that host run `git submodule update --init`
RUN make erigon rpcdaemon integration sentry
FROM docker.io/library/alpine:3.13
RUN mkdir -p /var/lib/erigon
VOLUME /var/lib/erigon
RUN apk add --no-cache ca-certificates libgcc libstdc++ tzdata
COPY --from=builder /app/build/bin/* /usr/local/bin/
WORKDIR /var/lib/erigon
RUN adduser -H -u 1000 -g 1000 -D erigon
RUN chown -R erigon:erigon /var/lib/erigon
RUN mkdir -p /home/erigon
RUN mkdir -p /home/erigon/.local/share/erigon
RUN chown -R erigon:erigon /home/erigon
USER erigon
EXPOSE 8545 8546 30303 30303/udp 30304 30304/udp 8080 9090 6060

View File

@ -5,9 +5,9 @@ services:
erigon:
image: thorax/erigon:latest
build: .
command: erigon --datadir=/var/lib/erigon --metrics --metrics.addr=0.0.0.0 --metrics.port=6060 --private.api.addr=0.0.0.0:9090 --pprof --pprof.addr=0.0.0.0 --pprof.port=6061
command: erigon --metrics --metrics.addr=0.0.0.0 --metrics.port=6060 --private.api.addr=0.0.0.0:9090 --pprof --pprof.addr=0.0.0.0 --pprof.port=6061
volumes:
- ${XDG_DATA_HOME:-~/.local/share}/erigon:/var/lib/erigon
- ${XDG_DATA_HOME:-~/.local/share}/erigon:/home/erigon/.local/share/erigon
ports:
- "30303:30303/tcp"
- "30303:30303/udp"
@ -40,10 +40,10 @@ services:
rpcdaemon:
image: thorax/erigon:latest
command: rpcdaemon --datadir /var/lib/erigon --private.api.addr=erigon:9090 --http.addr=0.0.0.0 --http.vhosts=* --http.corsdomain=* --http.api=eth,debug,net
command: rpcdaemon --datadir=/home/erigon/.local/share/erigon --private.api.addr=erigon:9090 --http.addr=0.0.0.0 --http.vhosts=* --http.corsdomain=* --http.api=eth,debug,net
pid: service:erigon # Use erigon's PID namespace. It's required to open Erigon's DB from another process (RPCDaemon local-mode)
volumes:
- ${XDG_DATA_HOME:-~/.local/share}/erigon:/var/lib/erigon
- ${XDG_DATA_HOME:-~/.local/share}/erigon:/home/erigon/.local/share/erigon
ports:
- "8545:8545"
restart: unless-stopped

View File

@ -34,6 +34,7 @@ type WriteDB interface {
}
func NewSnapshotKV() snapshotOpts {
return snapshotOpts{}
}