您好,登錄后才能下訂單哦!
這篇文章主要介紹了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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。