Basically I want to create a "snapshot" of my current Ubuntu box, which has compiled binaries and various apt-get packages installed on it. I want to create a docker instance of this as a file that I can distribute to my AWS ec2 instances which will be stored on S3 bucket that will be mounted by the ec2.

Is it possible to achieve this, and how do you get started?

有帮助吗?

解决方案

You won't be able to take a snapshot of a current box and use it as a docker container, but you can certainly create a container to use on your EC2 instances.

  1. Create a Dockerfile that builds the system exactly as you want it.
  2. Once you've created the perfect Dockerfile, export a container to a tarball
  3. Upload the tarball to S3
  4. On your EC2 instances, download the tarball and import it as a Docker container.

Are you planning to use something like s3fs to mount an S3 bucket? Otherwise you can just copy the tarball from your bucket either as a userdata boot script or during a chef/puppet/ansible provisioning step. Depends how you want to structure it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top