[NC-887] release docker image (#71)

Provide a release grade Docker image

fix NC-887
use OpenJDK 8 slim docker image and integrated builder step
Replace the previous unused dockerfile with also some integrated documentation
Automatic building of the image and push to DockerHub will be done in a new Jenkins job
Nicolas MASSART 6 years ago committed by GitHub
parent 46fdab18d2
commit 3a1f7f163d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 45
      Dockerfile

@ -1,13 +1,42 @@
# Base Alpine Linux based image with OpenJDK JRE only # Pantheon release grade Docker image
#FROM openjdk:8-jre-alpine #
FROM openjdk:8-jdk # What is this image for ?
# This image is for using Pantheon within Docker for any purpose, test, dev, production.
# The Docker file integrates two steps, first the build with a JDK and then the runnning image with a JRE.
# Then you don't need a JDK installed locally to build Pantheon, just run the docker build
# command and once the image is created you can use it as if you were using a regular Patheon binary.
#
# How to use this image:
#
# first build it (use the name and tag you like) :
#
# docker build -t mypantheon:myTag .
#
# then run pantheon:
# Either as a simple node with sync on mainnet with a volume for data (keeps the database between runs) and that's all:
#
# docker run -d --mount source=pantheon_database,target=/opt/pantheon/database --name myPantheon mypantheon:myTag
#
# or as a simple node with sync on mainnet with a volume for data (keeps the database between runs) and HTTP/WS RPC access :
#
# docker run -d --mount source=pantheon_database,target=/opt/pantheon/database \
# --name myPantheon -p 8545:8545 -p 8546:8546 mypantheon:myTag \
# --rpc-enabled --rpc-listen=0.0.0.0:8545 --rpc-cors-origins=mydomain.tld \
# --ws-enabled -ws-listen=0.0.0.0:8546
# copy application (with libraries inside) # builder temporary image with JDK
ADD build/install/pantheon /opt/pantheon/ FROM openjdk:8-jdk-slim as builder
ADD integration-tests/src/test/resources/tech/pegasys/pantheon/tests/cluster/docker/geth/genesis.json /opt/pantheon/genesis.json # copy all pantheon source to the image
COPY . /tmp/pantheon
WORKDIR /tmp/pantheon
# build the distribution
RUN ./gradlew installDist
# final image with only jre
FROM openjdk:8-jre-slim
# copy application from builder image
COPY --from=builder /tmp/pantheon/build/install/pantheon /opt/pantheon/
# List Exposed Ports # List Exposed Ports
EXPOSE 8084 8545 30303 30303/udp EXPOSE 8546 8545 30303
# specify default command # specify default command
ENTRYPOINT ["/opt/pantheon/bin/pantheon"] ENTRYPOINT ["/opt/pantheon/bin/pantheon"]

Loading…
Cancel
Save