从EC2 AMI创建一个docker图像/容器 [英] Create a docker image/container from EC2 AMI
问题描述
我还设置了一个私有Docker集线器(artifactory),我打算推送图像并使其可用。将AMI导入泊坞站图像的步骤是什么,而不从基本图像开始并进行更新。
指向任何解释的指针也将起作用。
这是我如何做到的。
在描述中找到根卷快照ID $ /
/ dev / sda1 = snap-eb79b0b1:15:true:gp2
启动实例与公共Ubuntu 14.04 AMI
从快照snap-eb79b0b1(在实例运行的相同区域)创建卷。将实例附加到/ dev / sdf
将卷附加到/ mnt
mount / dev / xvdf / mnt
安装Docker
https://docs.docker.com/engine/installation/ubuntulinux/
import docker image从安装的根卷
tar -c -C / mnt /。 | docker import - appcimage-master-1454216413
docker run -t -i 6d6614111fcb03d5ca79541b8a23955202dfda74995d968b5ffb5d45c7e68da9 / bin / bash
I am very new to docker and am trying to import my AWS EC2 AMI into a docker image. The image is a m2 linux image.
I have also setup a private docker hub(artifactory) to which I intend to push the image and make it available for consumption. What are the steps for importing AMI into docker image without starting from a base image and updating.
Pointers to any explanation would work too.
Here is how I did it.
On source AMI locate root volume snapshot id in the description
/dev/sda1=snap-eb79b0b1:15:true:gp2
launch instance with public Ubuntu 14.04 AMI
create volume from snapshot snap-eb79b0b1 (in the same region that the instance runs). attach volume to the instance as /dev/sdf
mount volume to /mnt
mount /dev/xvdf /mnt
install docker
https://docs.docker.com/engine/installation/ubuntulinux/
import docker image from mounted root volume
tar -c -C /mnt/ . | docker import - appcimage-master-1454216413
docker run -t -i 6d6614111fcb03d5ca79541b8a23955202dfda74995d968b5ffb5d45c7e68da9 /bin/bash
这篇关于从EC2 AMI创建一个docker图像/容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!