sure, thanks. Here it is, including the tail of journalctl. As you can
see it only fails when using atomic run from systemd, if I try from the CLI
it'll work just fine. Its like it doesn't like the : in the image name and
doesn't get the $Environment variable either.
[Unit]
Description=Service unit for puppet-dashboard
After=docker.service
Requires=docker.service
[Service]
Type=forking
RemainAfterExit=yes
StartLimitInterval=20
StartLimitBurst=5
TimeoutStartSec=0
RestartSec=10s
Environment="HOME=/root"
ExecStartPre=-/usr/bin/docker kill dash
ExecStartPre=-/usr/bin/docker rm dash
ExecStart=/usr/bin/atomic run solarflow:puppet-dashboard-img
#ExecStart=/usr/bin/docker run -dp 192.168.10.213:80:80 --name=dash
--hostname=puppet-dashboard.local solarflow:puppet-dashboard-img
ExecStop=/usr/bin/docker stop dash
[Install]
WantedBy=multi-user.target
Feb 20 18:36:37 atomic.local docker[872]: time="2017-02-20T18:36:37-08:00"
level="info" msg="GET /v1.16/containers/solarflow/json"
Feb 20 18:36:37 atomic.local docker[872]: time="2017-02-20T18:36:37-08:00"
level="info" msg="+job container_inspect(solarflow)"
Feb 20 18:36:37 atomic.local docker[872]: No such container: solarflow
Feb 20 18:36:37 atomic.local docker[872]: time="2017-02-20T18:36:37-08:00"
level="info" msg="-job container_inspect(solarflow) = ERR (1)"
Feb 20 18:36:37 atomic.local docker[872]: time="2017-02-20T18:36:37-08:00"
level="error" msg="Handler for GET /containers/{name:.*}/json returned
error: No such container: solarflow"
Feb 20 18:36:37 atomic.local docker[872]: time="2017-02-20T18:36:37-08:00"
level="error" msg="HTTP Error: statusCode=404 No such container: solarflow"
Feb 20 18:36:37 atomic.local docker[872]: time="2017-02-20T18:36:37-08:00"
level="info" msg="GET /v1.16/images/solarflow:puppet-dashboard-img/json"
Feb 20 18:36:37 atomic.local docker[872]: time="2017-02-20T18:36:37-08:00"
level="info" msg="+job image_inspect(solarflow:puppet-dashboard-img)"
Feb 20 18:36:37 atomic.local docker[872]: time="2017-02-20T18:36:37-08:00"
level="info" msg="-job image_inspect(solarflow:puppet-dashboard-img) = OK
(0)"
Feb 20 18:36:37 atomic.local atomic[8462]: time="2017-02-20T18:36:37-08:00"
level="fatal" msg="mkdir .docker: permission denied"
Feb 20 18:36:37 atomic.local atomic[8462]: docker run -dp 192.168.10.213:80:80
--name=dash --hostname=puppet-dashboard.local solarflow:puppet-dashboard-img
Feb 20 18:36:37 atomic.local systemd[1]: docker-puppet-dashboard.service:
control process exited, code=exited status=1
Feb 20 18:36:37 atomic.local systemd[1]: Failed to start Service unit for
puppet-dashboard.
Feb 20 18:36:37 atomic.local systemd[1]: Unit
docker-puppet-dashboard.service entered failed state.
And from the CLI it works fine:
$ /usr/bin/atomic run solarflow:puppet-dashboard-img
docker run -dp 192.168.10.213:80:80 --name=dash
--hostname=puppet-dashboard.local solarflow:puppet-dashboard-img
3daf620fccbde74cc0b65a1ea36225e322593de77baa5b646093ca7365d58313
PRD atomic ~ $ docker ps -a
CONTAINER ID IMAGE COMMAND
CREATED STATUS PORTS
NAMES
3daf620fccbd solarflow:puppet-dashboard-img "/tmp/entrypoint.sh"
3 seconds ago Up 2 seconds 192.168.10.213:80->80/tcp
dash
On Mon, Feb 20, 2017 at 5:15 PM, Josh Berkus <[email protected]> wrote:
> On 02/20/2017 02:20 PM, solarflow99 wrote:
> > I noticed I can't use systemd to start a container with atomic run
> > because it doesn't seem to pass: Environment="HOME=/root"
> >
> > yet, if I just use docker run for the exec in the unit file, it works.
> > Is there something i'm missing, or any examples of unit files with
> atomic?
>
> Can you share your unit file?
>
> --
> --
> Josh Berkus
> Project Atomic
> Red Hat OSAS
>