https://www.mock-server.com/mock_server/running_mock_server.html#docker_container
134
https://www.mock-server.com/mock_server/running_mock_server.html#docker_container
#
# MockServer Dockerfile
#
# https://github.com/mock-server/mockserver
# http://www.mock-server.com
#
# build image
FROM alpine as build
# download jar
RUN apk add --update openssl ca-certificates bash wget
# REPOSITORY is releases or snapshots
ARG REPOSITORY=releases
# VERSION is LATEST or RELEASE or x.x.x
ARG VERSION=RELEASE
# see: https://oss.sonatype.org/nexus-restlet1x-plugin/default/docs/path__artifact_maven_redirect.html
ARG REPOSITORY_URL=https://oss.sonatype.org/service/local/artifact/maven/redirect?r=${REPOSITORY}&g=org.mock-server&a=mockserver-netty&c=jar-with-dependencies&e=jar&v=${VERSION}
RUN wget --max-redirect=10 -O mockserver-netty-jar-with-dependencies.jar "$REPOSITORY_URL"
# runtime image
FROM gcr.io/distroless/java:11
# maintainer details
LABEL MAINTAINER.NAME="James Bloom" MAINTAINER.EMAIL="[email protected]"
# expose ports.
EXPOSE 1080
# copy in jar
COPY --from=build mockserver-netty-jar-with-dependencies.jar /
# don't run MockServer as root
USER nonroot
VOLUME [ "/config", "/libs", "/etc/localtime" ]
ENTRYPOINT ["java", "-Duser.timezone=Asia/Shanghai", "-Dfile.encoding=UTF-8", "-cp", "/mockserver-netty-jar-with-dependencies.jar:/libs/*", "-Dmockserver.propertyFile=/config/mockserver.properties", "org.mockserver.cli.Main"]
CMD ["-serverPort", "1080"]
Content type
Image
Digest
Size
85.3 MB
Last updated
about 6 years ago
docker pull zxytech/mockserver:5.11.1