Sign inSign up

walterwhites/webservice

By walterwhites

Updated over 7 years ago

Java EE project

Image
0

755

walterwhites/webservice repository overview

What is this image ?

This image allow to run deploy a war file on a container.

Exemple of image

FROM openjdk:8-jdk-alpine
EXPOSE 8081
ADD /target/webservice-0.0.1-SNAPSHOT.war webservice-0.0.1-SNAPSHOT.war
ENTRYPOINT ["java","-jar","-jar","webservice-0.0.1-SNAPSHOT.war"]

How to use This image

1) You should replace the port where you expose the war:
EXPOSE {PORT_NUMBER}
  1. for exemple when you build you war with Spring boot, the path is /target/(APP_NAME}-{VERSION_NAME}.war
    so replace to:
    ADD {PATH_OF_WAR} {NAME_OF_WAR_FILE}

  2. replace entrypoint with you war file name:
    ["java","-jar","-jar","{NAME_OF_WAR_FILE}"]

To deploy a webservice application on container

Build you war file with maven: mvn clean install

To build docker image with maven
mvn install dockerfile:build
(by default it create image with a tag 'latest': walterwhites/webservice:latest)

To list images
$ docker images

To delete images
$ docker image rm {IMAGE ID} --force

To login to Docker CLI
$ docker login -u "username" -p "password" docker.io

To run the container

$ docker run -p 8081:8081 walterwhites/webservice

Tag summary

Content type

Image

Digest

Size

105.5 MB

Last updated

over 7 years ago

docker pull walterwhites/webservice