Created
April 9, 2020 13:01
-
-
Save briancurt/87a55ca1402a417000c1c6468c4202f0 to your computer and use it in GitHub Desktop.
AWS ECR login systemd unit and timer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /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