Last active
December 2, 2015 21:53
-
-
Save kennwhite/979cd2f5d5d088083509 to your computer and use it in GitHub Desktop.
Bundle Amazon/CentOS Linux to private Docker image repo
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
#!/usr/bin/env bash | |
# | |
# Bundling a minimal Amazon Linux image to a portable Docker container image | |
# Based on: https://forums.aws.amazon.com/message.jspa?messageID=541030#557755 | |
# | |
# | |
yum install -y wget docker && service docker start | |
wget -q https://raw.githubusercontent.com/dotcloud/docker/master/contrib/mkimage-yum.sh | |
# | |
# Example for bundling AML Minimal HVM EBS Build: amzn-ami-minimal-hvm-2015.03.0.x86_64-ebs (ami-2ccae744) | |
# Image name shown is only suggested | |
bash mkimage-yum.sh amazon-linux-hvm-ebs-20150300-2ccae744 | |
# | |
docker images | |
# | |
# Cache credentials | |
docker login registry.hub.docker.com | |
# | |
# Tag the newly-created image ID with a private repo tag (assumes username/aml private repo are already set up) | |
# Replace [repo-username] with the private repo username, ie, jsmith | |
docker tag [image-ID] registry.hub.docker.com/[repo-username]/aml | |
docker push registry.hub.docker.com/[repo-username]/aml | |
# [Log in to a CoreOS or another Docker container manager] | |
docker pull registry.hub.docker.com/[repo-username]/aml | |
# Create more friendly tag | |
docker tag registry.hub.docker.com/[repo-username]/aml local-aml | |
docker run -it local-aml bash | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment