This file contains 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
# | |
# Cookbook:: utility | |
# Recipe:: ecr_auth | |
# | |
# depends 'docker', '~> 4.8.0' | |
# | |
# Required Attributes: | |
# default['aws']['ecr']['registry_id'] = AWS account ID for the registry. | |
# default['aws']['ecr']['region'] = AWS region for the registry. | |
# |
This file contains 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
#!/bin/bash | |
# | |
# A simple bash script to migrate your Docker Hub organization to ECR with pretty minimal effort. | |
# Adapted from kizbitz's original script -- https://gist.github.com/kizbitz/e59f95f7557b4bbb8bf2 | |
# | |
# In order for this to work you must run this from a system that is logged in to both the ECR | |
# repository you are migrating TO and the Docker Hub organization you are migrating FROM. | |
# | |
# Due to how Docker works (pulling / pushing images), this script can be run over and over | |
# without any issues. Note that ECR authentication times out after 24 hours, so if you are |
This file contains 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
cat /dev/null > ${HOME}/instance_storage_devices | |
for device in $(ls -1 /dev/nvme*n[0-1000]); do | |
MNT_TYPE=$(nvme id-ctrl -v $device | grep mn | grep -v mntmt | cut -d":" -f2); | |
[[ "${MNT_TYPE}" == *"NVMe Instance Storage"* ]] && echo -n " ${device}" >> ${HOME}/instance_storage_devices | |
done |