【Docker】Docker push失败的问题相关解决方案和实践

原创文章,转载请注明:www.blog.csdn.net/postedit/53114750

Docker push镜像失败的问题。
以下是输入push自己的tomcat后出现了失败

[root@slave3 ~]# docker push lekkoliu/tomcat8:latest
The push refers to a repository [docker.io/lekkoliu/tomcat8]
cefee3f6c961: Preparing 
82f021d9c2b9: Preparing 
4f91f02b4e49: Preparing 
a4b3ce7e1d4a: Preparing 
c3b95f8496f1: Preparing 
bcfb53b3ff7c: Waiting 
3aa267e87e63: Waiting 
6c0ce72ad569: Waiting 
3242004f198a: Waiting 
b2ac5371e0f2: Waiting 
142a601d9793: Waiting 
unauthorized: authentication required

以下是已经执行过的方案:将private hub改变为 public,不能解决这个问题。

解决方案:
这里尤其注意,如果命名方式不对,是不行的。
以我自己的为例:
我docker官方中申请的hub为:

PRIVATE REPOSITORY
lekko/liu

这里在执行本地docker push的时候,要先利用docker tag的命令来修改image为符合规范(docker tag username/userimage)的命名。
例如:

[root@slave3 ~]# docker tag lekko/liu/tomcat8 lekko/tomcat8

之前我以为username是我整个的名字即lekko/liu。后来我经过多次测试,测出原来这里的username指的是申请的账号,即我的lekko/liu中的lekko。
此时,如上面代码所示,修改后的image名称为lekko/tomcat8。

因此这里把这个image push出去即可。

[root@slave3 ~]# docker push lekko/tomcat8
The push refers to a repository [docker.io/lekko/tomcat8]
cefee3f6c961: Layer already exists 
82f021d9c2b9: Layer already exists 
4f91f02b4e49: Layer already exists 
a4b3ce7e1d4a: Layer already exists 
c3b95f8496f1: Layer already exists 
bcfb53b3ff7c: Layer already exists 
3aa267e87e63: Layer already exists 
6c0ce72ad569: Layer already exists 
3242004f198a: Layer already exists 
b2ac5371e0f2: Layer already exists 
142a601d9793: Layer already exists 
latest: digest: sha256:4c878796e09584128e4eb3a17c9d6cb66c33e3678db377aa1921110116e2b4da size: 2625

此时,可以通过docker 服务器来来取到刚才上传好的镜像:

[root@master ~]# docker pull lekko/tomcat8
Using default tag: latest
latest: Pulling from lekko/tomcat8
6a5a5368e0c2: Pull complete 
7b9457ec39de: Pull complete 
d5cc639e6fca: Pull complete 
dae3b0638638: Pull complete 
ab678d1c6f00: Pull complete 
d5bf826c3153: Pull complete 
0081bad1df81: Pull complete 
8fafa3f26de4: Pull complete 
ae984359ed7e: Pull complete 
9175a2e1674f: Pull complete 
2e8f15e74426: Pull complete 
Digest: sha256:4c878796e09584128e4eb3a17c9d6cb66c33e3678db377aa1921110116e2b4da
Status: Downloaded newer image for lekko/tomcat8:latest

结束语

觉得好的朋友可以给我大赏一杯咖啡钱缓解通宵梳理环境的疲乏〜!
方式一:支付宝
这里写图片描述
方式二:以太坊
这里写图片描述

发布了198 篇原创文章 · 获赞 180 · 访问量 44万+
展开阅读全文

docker容器重启后报错

10-26

日志如下 ``` Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server version: Apache Tomcat/7.0.67 Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server built: Dec 7 2015 13:07:11 UTC Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server number: 7.0.67.0 Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: OS Name: Linux Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: OS Version: 3.10.0-327.el7.x86_64 Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Architecture: amd64 Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Java Home: /opt/heading/jdk1.6.0_45/jre Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: JVM Version: 1.6.0_45-b06 Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: JVM Vendor: Sun Microsystems Inc. Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: CATALINA_BASE: /opt/heading/pfs Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: CATALINA_HOME: /opt/heading/pfs Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djava.util.logging.config.file=/opt/heading/pfs/conf/logging.properties Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Duser.timezone=GMT+08 Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Xms512m Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Xmx1024m Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -XX:PermSize=256M Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -XX:MaxPermSize=512M Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djava.endorsed.dirs=/opt/heading/pfs/endorsed Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Dcatalina.base=/opt/heading/pfs Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Dcatalina.home=/opt/heading/pfs Oct 26, 2016 5:05:47 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djava.io.tmpdir=/opt/heading/pfs/temp Oct 26, 2016 5:05:47 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /opt/heading/jdk1.6.0_45/jre/lib/amd64/server:/opt/heading/jdk1.6.0_45/jre/lib/amd64:/opt/heading/jdk1.6.0_45/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib Oct 26, 2016 5:05:48 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["http-bio-8080"] Oct 26, 2016 5:05:48 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["ajp-bio-8009"] Oct 26, 2016 5:05:48 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 4462 ms Oct 26, 2016 5:05:48 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["http-bio-10001"] Oct 26, 2016 5:05:48 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["ajp-bio-10009"] Oct 26, 2016 5:05:48 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 4458 ms Oct 26, 2016 5:05:48 PM org.apache.catalina.core.StandardService startInternal INFO: Starting service Catalina Oct 26, 2016 5:05:48 PM org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: Apache Tomcat/7.0.67 Oct 26, 2016 5:05:48 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory /opt/heading/dts/webapps/ROOT Oct 26, 2016 5:05:48 PM org.apache.catalina.core.StandardService startInternal INFO: Starting service Catalina Oct 26, 2016 5:05:48 PM org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: Apache Tomcat/7.0.67 Oct 26, 2016 5:05:48 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory /opt/heading/pfs/webapps/ROOT Oct 26, 2016 5:05:52 PM org.apache.tomcat.websocket.server.WsSci onStartup INFO: JSR 356 WebSocket (Java WebSocket 1.1) support is not available when running on Java 6. To suppress this message, run Tomcat on Java 7, remove the WebSocket JARs from $CATALINA_HOME/lib or add the WebSocket JARs to the tomcat.util.scan.DefaultJarScanner.jarsToSkip property in $CATALINA_BASE/conf/catalina.properties. Note that the deprecated Tomcat 7 WebSocket API will be available. Oct 26, 2016 5:05:52 PM org.apache.tomcat.websocket.server.WsSci onStartup INFO: JSR 356 WebSocket (Java WebSocket 1.1) support is not available when running on Java 6. To suppress this message, run Tomcat on Java 7, remove the WebSocket JARs from $CATALINA_HOME/lib or add the WebSocket JARs to the tomcat.util.scan.DefaultJarScanner.jarsToSkip property in $CATALINA_BASE/conf/catalina.properties. Note that the deprecated Tomcat 7 WebSocket API will be available. ``` 求大神帮分析下原因 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: Age of Ai 设计师: meimeiellie

分享到微信朋友圈

×

扫一扫,手机浏览