Docker 图像未拉入systemd ExecStartPre=

Docker 图像未拉入systemd ExecStartPre=,docker,systemd,coreos,Docker,Systemd,Coreos,我从systemd/dockerd收到这条消息: Dec 29 14:41:32 core-01 systemd[1]: Starting ElasticSearch... Dec 29 14:41:32 core-01 docker[1335]: Error response from daemon: No such container: es Dec 29 14:41:32 core-01 docker[1346]: Error response from daemon: No such c

我从systemd/dockerd收到这条消息:

Dec 29 14:41:32 core-01 systemd[1]: Starting ElasticSearch...
Dec 29 14:41:32 core-01 docker[1335]: Error response from daemon: No such container: es
Dec 29 14:41:32 core-01 docker[1346]: Error response from daemon: No such container: es
Dec 29 14:41:33 core-01 docker[1367]: Pulling repository prv.private.registry/elasticsearch-qa
Dec 29 14:41:33 core-01 docker[1367]: Error: image elasticsearch-qa not found
Dec 29 14:41:33 core-01 systemd[1]: living-es.service: Control process exited, code=exited status=1
所以它告诉我,
图像弹性搜索qa未找到

systemd服务定义为:

  - name: living-es.service
    command: start
    enable: true
    content: |-
      [Unit]
      Description=ElasticSearch
      Author=Living
      After=docker.service

      [Service]
      Restart=always
      RestartSec=10s
      ExecStartPre=-/usr/bin/docker stop es
      ExecStartPre=-/usr/bin/docker rm es
      ExecStartPre=/usr/bin/docker pull prv.private.registry/elasticsearch-qa:v1
      ExecStart=/usr/bin/docker run --name es -p 9200:9200 -p 9300:9300 --hostname es -v /home/core/data/es:/usr/share/elasticsearch/data prv.private.registry.com/elasticsearch-qa:v1 -Des.node.name="esn1" -Des.cluster.name="cluster"
      ExecStop=/usr/bin/docker stop es
消息很清楚,但是,当我在shell上拖动图像时,它被正确地拖动。有什么想法吗

docker pull prv.private.registry/elasticsearch-qa:v1
v1: Pulling from elasticsearch-qa
8ad8b3f87b37: Pull complete
751fe39c4d34: Pull complete
b165e84cccc1: Pull complete
acfcc7cbc59b: Pull complete
04b7a9efc4af: Pull complete
b16e55fe5285: Pull complete
8c5cbb866b55: Pull complete
53c3dd7fc70d: Pull complete
3de13756a8c8: Pull complete
64be422416b7: Pull complete
b808918635ce: Pull complete
5b3ceec8c156: Pull complete
561269d0b7cc: Pull complete
0c6cf9533753: Pull complete
5234b57e3d12: Pull complete
4a86b042378a: Pull complete
c6f98581a18c: Pull complete
b6ee1115f29d: Pull complete
Digest: sha256:1f3c29d4f10ae897f67067ff72b8e25d8380531f04637941e67747bec96228f9code=exited status=1
Status: Downloaded newer image for prv.private.registry/elasticsearch-qa:v1

尝试以root用户身份手动运行
docker pull
命令,因为systemd正以该用户身份运行。它可能无法向您的私人回购进行身份验证,因为凭据存储在您的用户首选项中


如果是这种情况,请尝试将
User=yourusername
添加到
systemd
单元文件中。

尝试以
root
身份手动运行
docker pull
命令,因为systemd正以该用户的身份运行。它可能无法向您的私人回购进行身份验证,因为凭据存储在您的用户首选项中


如果是这种情况,请尝试将
User=yourusername
添加到
systemd
单元文件中。

理论:使用注册表时,首先需要运行
docker login
进行注册。这可以作为您的用户使用,但systemd不是以您的用户身份运行的,它可能是以root用户身份运行的。理论:当您使用注册表时,首先需要运行
docker login
以向其注册。这可以作为您的用户使用,但systemd不是以您的用户身份运行的,它可能以root用户身份运行。