FROM java:8
ENV ARTIFACTID xc‐govern‐center ENV ARTIFACTVERSION
1.0‐SNAPSHOT ENV HOME_PATH /home WORKDIR
$HOME_PATH ADD /$ARTIFACTID‐$ARTIFACTVERSION.jar
$HOME_PATH/$ARTIFACTID.jar ENTRYPOINT ["java", "‐jar", "xc‐govern‐center.jar"]
[root@localhost xc‐govern‐center]# docker images REPOSITORY
TAG
IMAGE ID
CREATED
SIZE xc‐govern‐center
1.0‐SNAPSHOT
ad14dcce6666
35 seconds ago
684 MB
docker create ‐‐name xc‐govern‐center‐test ‐t ‐p 50101:50101 ‐e PORT=50101 ‐e EUREKA_SERVER=http://192.168.101.64:50101/eureka/,http://192.168.101.64:50102/eureka/ xcgovern‐center:1.0‐SNAPSHOT
[root@localhost xc‐govern‐center]# docker ps CONTAINER ID
IMAGE
COMMAND
CREATED
STATUS
PORTS
NAMES 688cabeef187
xc‐govern‐center:1.0‐SNAPSHOT "java ‐jar xc‐gove..." 2 minutes ago
Up 2 minutes
0.0.0.0:50101‐>50101/tcp
xc‐govern‐centertest
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |