Merge pull request #37 from vulcanize/feature-docker-overlay
Update docker environment to support fs overlay
This commit is contained in:
commit
3d3e68c0ae
@ -6,6 +6,8 @@ RUN apk add busybox-extras
|
||||
|
||||
# Get and build ipfs-blockchain-watcher
|
||||
ADD . /go/src/github.com/vulcanize/eth-statediff-service
|
||||
#RUN git clone https://github.com/vulcanize/eth-statediff-service.git /go/src/github.com/vulcanize/eth-statediff-service
|
||||
|
||||
WORKDIR /go/src/github.com/vulcanize/eth-statediff-service
|
||||
RUN GO111MODULE=on GCO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o eth-statediff-service .
|
||||
|
||||
@ -15,7 +17,10 @@ FROM alpine
|
||||
ARG USER="vdm"
|
||||
ARG CONFIG_FILE="./environments/example.toml"
|
||||
ARG EXPOSE_PORT=8545
|
||||
RUN adduser -Du 5000 $USER
|
||||
|
||||
RUN adduser -Du 5000 $USER adm
|
||||
RUN adduser $USER adm; apk --no-cache add sudo; echo '%adm ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
||||
|
||||
WORKDIR /app
|
||||
RUN chown $USER /app
|
||||
USER $USER
|
||||
|
@ -4,8 +4,17 @@ set -e
|
||||
set +x
|
||||
|
||||
# Check the database variables are set
|
||||
test $VDB_COMMAND
|
||||
test "$VDB_COMMAND"
|
||||
set +e
|
||||
|
||||
echo "Running the statediff service"
|
||||
./eth-statediff-service ${VDB_COMMAND} --config=config.toml
|
||||
# docker must be run in privilaged mode for mounts to work
|
||||
echo "Setting up /app/geth-rw overlayed /app/geth-ro"
|
||||
mkdir -p /tmp/overlay && \
|
||||
sudo mount -t tmpfs tmpfs /tmp/overlay && \
|
||||
mkdir -p /tmp/overlay/upper && \
|
||||
mkdir -p /tmp/overlay/work && \
|
||||
mkdir -p /app/geth-rw && \
|
||||
sudo mount -t overlay overlay -o lowerdir=/app/geth-ro,upperdir=/tmp/overlay/upper,workdir=/tmp/overlay/work /app/geth-rw && \
|
||||
|
||||
echo "Running the statediff service" && \
|
||||
sudo ./eth-statediff-service "$VDB_COMMAND" --config=config.toml
|
||||
|
Loading…
Reference in New Issue
Block a user