AWS Development — Docker Containers for — Elastic Beanstalk development environment
AWS developers need to install many tools like
sam etc. Workstations become overloaded, and sometimes there are version conflicts. To keep workstations clean, we decided to use Docker containers for different tools.
I hear you say, how about running
eb local run
And here is how we will do that:
- Download Dockerfile from VirtIOGroove repository
- From a folder containing Dockerfile run the following:
docker build -t ubuntu:ebcli.
docker run -v /var/run/docker.sock:/var/run/docker.sock -it ubuntu:ebcli
Now you are in the container.
Let us quick create an Elastic Beanstalk Application from AWS provided examples, by executing the following commands:
eb init #select Docker platform
eb local run & #pushing it to background to get shell
And here is the magic — the new Docker Container starts from your developer Docker Container — but it runs on the host.
If you run
docker container ps from your container or from the host -you will see the same container - this is the result of attaching a Docker daemon socket from the host to the container Docker daemon.
More options for starting container can be found in VirtIOGroove repository
Note: Do not run the container with
Read this blog post from the author of the feature - to understand implications. That is why we are starting container the way recommended in blog post.