这篇文章主要介绍了docker命令和Dockerfile有哪些,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。
#!/usr/bin/env bash # 构建镜像 docker build -t 130.51.23.250:8088/motor/path:1.0 -f /app/webapp/motor/Dockerfile_path /app/webapp/motor # 查看镜像 docker images # 创建并启动容器 docker run -d -p 8831:8830 --net=host --name=path-service -i 130.51.23.250:8088/motor/path:1.0 # 查看进程 docker ps docker ps -a # 查看日志 docker logs --tail 10 -f container_id # 重启容器(停止容器+启动容器) docker stop container_id docker start container_id # 重新创建启动容器(删除容器+创建容器) docker rm container_id docker run ...
[docker]Dockerfile
[webapp@app02 ~/motor]$docker build -t 130.51.23.250:8088/motor/path:1.0 -f /app/webapp/motor/Dockerfile_path /app/webapp/motor Sending build context to Docker daemon 203.4 MB Step 1/17 : FROM 130.51.23.250:8088/bss/jdk:1.8.0 ---> 2c93138a6ab1 Step 2/17 : MAINTAINER gonghy gonghy@asiainfo.com ---> Using cache ---> b90b22969770 Step 3/17 : RUN mkdir -p /opt/logs ---> Using cache ---> b2b7c226caf5 Step 4/17 : COPY path-service /opt/path-service ---> b5defad45336 Removing intermediate container 19d2f2b73fcb Step 5/17 : RUN groupadd -r -g 1002 webapp && useradd -r -g webapp -u 1003 webapp ---> Running in 17cce2777a03 ---> 39c4c25b0500 Removing intermediate container 17cce2777a03 Step 6/17 : RUN chown -R webapp:webapp /opt/logs ---> Running in 6789fcbdbb7e ---> 6717405fd00f Removing intermediate container 6789fcbdbb7e Step 7/17 : RUN chown -R webapp:webapp /opt/path-service ---> Running in a004a844130d ---> 1697b5558913 Removing intermediate container a004a844130d Step 8/17 : USER webapp ---> Running in 0aad5e40b26f ---> f11699373372 Removing intermediate container 0aad5e40b26f Step 9/17 : WORKDIR /opt/path-service ---> 1be1f49aae9d Removing intermediate container c5d4a43e9655 Step 10/17 : ENV LANG zh_CN.GB18030 ---> Running in 48244a2da996 ---> 6da966eb2ca4 Removing intermediate container 48244a2da996 Step 11/17 : ENV LC_ALL zh_CN.GB18030 ---> Running in 52f76d045648 ---> c4cf6362232b Removing intermediate container 52f76d045648 Step 12/17 : ENV JAVA_HOME /opt/jdk1.8.0_172 ---> Running in 1ae900dbe790 ---> b46be0d816ee Removing intermediate container 1ae900dbe790 Step 13/17 : ENV PATH $JAVA_HOME/bin:.:$PATH ---> Running in 4e2f7fee9ae3 ---> ee342059ad7b Removing intermediate container 4e2f7fee9ae3 Step 14/17 : ENV CLASSPATH /opt/path-service/lib/*:/opt/path-service/classes ---> Running in f0dbec5f0522 ---> f9ca6b625f5b Removing intermediate container f0dbec5f0522 Step 15/17 : ENTRYPOINT java -Dapp.home=/opt/path-service -Xms1024m -Xmx1024m com.asiainfo.ServerServiceApplication ---> Running in d2c68075b91e ---> 224b0ec667d5 Removing intermediate container d2c68075b91e Step 16/17 : VOLUME /opt/logs ---> Running in e75632442301 ---> 14e1a717c96d Removing intermediate container e75632442301 Step 17/17 : EXPOSE 8831 ---> Running in d4dcbeb6be4f ---> d7588e51e08a Removing intermediate container d4dcbeb6be4f Successfully built d7588e51e08a
感谢你能够认真阅读完这篇文章,希望小编分享的“docker命令和Dockerfile有哪些”这篇文章对大家有帮助,同时也希望大家多多支持亿速云,关注亿速云行业资讯频道,更多相关知识等着你来学习!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。