Elastic Compute Cloud (EC2)
LocalStack Pro supports the Docker backend for running instances.
The Docker backend uses the Docker Engine to emulate EC2 instances. All limitations that apply to containers apply to EC2 instances backed by the Docker manager, including root access and networking. Access to the Docker socket is required which can be made available to LocalStack by mounting the socket file during launch.
Instances have the Docker socket () mounted inside them, making Docker-in-Docker use cases possible.
LocalStack uses a naming scheme to recognise and manage the containers and images associated with it. Containers are named localstack-ec2.<InstanceId>
, while images are tagged localstack-ec2/<AmiName>:<AmiId>
.
These Docker-backed AMIs have the resource tag and can be listed with the following command:
All other AMIs are ‘mocked’ and are based off the community edition of LocalStack. Attempting to launch Dockerised instances with these AMIs will return InvalidAMIID.NotFound
error.
LocalStack supports assignment of unique private IP addresses for Dockerised instances. To leverage this feature, it is necessary to run the LocalStack daemon process on the host which takes care of creating and managing networking on the host system.
The address for SSH access to the instance is printed in the logs when the instance is initialised.
The LocalStack daemon is supported on Linux and MacOS.
Security Groups are not applied to Dockerised instances. Ports other than 22 (SSH) are currently not exposed.
The Docker backend supports following operations: