I'm using this in a service declaration:
ExecStartPre=/usr/bin/docker pull "$DOCKER_USERNAME/redis-replication:latest"
In the log of systemd, I can see this when I try to start the service:
Usage: docker pull [OPTIONS] NAME[:TAG]
Pull an image or a repository from the registry
-a, --all-tags=false Download all tagged images in the repository
It looks like systemd didn't execute the proper command but some weird one. What could it be and how to correct that?
Edited: Here's my entire unit file
[Unit]
Description=Run redis replication
After=docker.service
Requires=docker.service
[Service]
Restart=always
RestartSec=10s
EnvironmentFile=/etc/vax/credentials
EnvironmentFile=/etc/vax/centos-ip
EnvironmentFile=/etc/vax/docker-auth
EnvironmentFile=/etc/vax/cluster-prefix
ExecStartPre=-/usr/bin/docker kill redisrep
ExecStartPre=-/usr/bin/docker rm redisrep
ExecStartPre=/usr/bin/docker pull "$DOCKER_USERNAME/redis-replication:latest"
ExecStart=/usr/bin/docker run --rm --name redisrep -v /var/data/myproject/redis:/data -e S3_ACCESS_KEY=$S3_ACCESS_KEY -e S3_SECRET_KEY=$S3_SECRET_KEY -e S3_BUCKET=$S3_BUCKET -e BACKUP_PREFIX=$BACKUP_PREFIX -e REPLICATE_FROM_IP=$CENTOS_IP -e REPLICATE_FROM_PORT=6379 $DOCKER_USERNAME/redis-replication:latest
ExecStop=/usr/bin/docker kill redisrep
[X-Fleet]
MachineMetadata="machineIndex=1"