Regenerated the kernel config from container, which bumped the kernel version and included some other fixes. Also bumps the check-config container to check for VSYSCALL_NATIVE Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Compile Moby for AWS (Amazon Machine Image)
Requirements
To compile, the requirements are:
- Must be working on a EC2 instance
- Must have
dockeranddocker-composeinstalled - Must have configured Amazon credentials on instances (
aws configure)
(The build will mount ~/.aws into the build container).
Building
To bake the AMI:
$ make ami
Inside of the alpine/ subdirectory of the main Moby repo.
This will:
- Clean up any remaining artifacts of old AMI builds
- Creates a new EBS volume and attaches it to the build instance
- Formats and partitions the volume for installation of Linux
- Sets up artifacts (
initrd.imgandvmlinuz64) inside the new partition for booting - Installs MBR to boot syslinux to the device
- Takes snapshot of EBS volume with Moby installed
- Turns the snapshot into an AMI
Testing
Once the AMI has been created a file, aws/ami_id.out will be written which
contains its ID.
You can boot a small AWS instance from this AMI using the aws/run-instance.sh
script.
There is no SSH available today, but inbound access on the Docker API should work if you configure a proper security group and attach it to the instance.
For instance, allow inbound access on :2375 and a command such as this from
your compiler instance should work to get a "root-like" shell:
$ docker -H 172.31.2.176:2375 \
run -ti \
--privileged \
--pid host \
debian \
nsenter -t 1 -m
Alternatively, you can also have the aws/run-instance.sh script create a
security group and Swarm for you automatically (including worker/agent
instances to join the cluster).
To do so, set the JOIN_INSTANCES environment variable to any value, and
specify how many "joiners" (worker nodes) you want to also spin up using the
JOINERS_COUNT environment variable (the default is 1). e.g.:
$ JOIN_INSTANCES=1 JOINERS_COUNT=3 ./aws/run-instance.sh
This will give you a 4 node cluster with a manager named
docker-swarm-manager, and workers named docker-swarm-joiner-0,
docker-swarm-joiner-1, and so on.