Dockerfile-server1
[root@lab2 docker-file]# cd server1/ [root@lab2 server1]# ls a.sh ddbes-server1-0.0.1-SNAPSHOT.jar Dockerfile [root@lab2 docker-file]# cat server1/Dockerfile FROM java:8-jre-alpine COPY ddbes-server1-0.0.1-SNAPSHOT.jar /opt/docker-file/server1/ddbes-server1-0.0.1-SNAPSHOT.jar WORKDIR /opt/docker-file/server1 EXPOSE 8881 CMD ["java", "-jar", "ddbes-server1-0.0.1-SNAPSHOT.jar"] [root@lab2 server1]# docker build -t server1 /opt/docker-file/server1/