Skip to content

Instantly share code, notes, and snippets.

@briancurt
Created April 9, 2020 13:01
Show Gist options
  • Save briancurt/87a55ca1402a417000c1c6468c4202f0 to your computer and use it in GitHub Desktop.
Save briancurt/87a55ca1402a417000c1c6468c4202f0 to your computer and use it in GitHub Desktop.
AWS ECR login systemd unit and timer
# /etc/systemd/system/ecr_login.service
[Unit]
Description=Docker AWS ECR login daemon
Wants=network-online.target
After=network.target network-online.target docker.service
[Service]
Type=oneshot
User=ubuntu
ExecStart=/bin/bash -c '$$(/usr/bin/aws ecr get-login --no-include-email --region us-east-1)'
[Install]
WantedBy=default.target
# /etc/systemd/system/ecr_login.timer
[Unit]
Description=Docker AWS ECR login timer
[Timer]
OnBootSec=60
OnCalendar=0/12:00:00
[Install]
WantedBy=timers.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment