Skip to content

Instantly share code, notes, and snippets.

@DanielDaCosta
Created October 14, 2021 16:32
Show Gist options
  • Save DanielDaCosta/c80752481fd20fc03f2e9c7f1c060cd4 to your computer and use it in GitHub Desktop.
Save DanielDaCosta/c80752481fd20fc03f2e9c7f1c060cd4 to your computer and use it in GitHub Desktop.
# Docker commands This means that developers or built scripts using the Docker CLI no
# longer have to explicitly use the ECR API to retrieve a secure token, nor call docker login with this token before pushing or pulling container image.
sudo yum -y install amazon-ecr-credential-helper # https://aws.amazon.com/blogs/containers/amazon-ecr-credential-helper-now-supports-amazon-ecr-public/
mkdir -p /home/ec2-user/.docker
sudo cat <<-END >> /home/ec2-user/.docker/config.json
{
"credHelpers": {
"public.ecr.aws": "ecr-login",
"${ACCOUNT_ID}.dkr.ecr.us-east-1.amazonaws.com/mlflow:latest": "ecr-login"
}
}
END
# Change the user and/or group ownership of a given file, directory, or symbolic link
chown -R ec2-user:ec2-user /home/ec2-user/.docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment