🐾Create Docker image in 5 simple steps🐾
To use Fargate or Lambda with Docker, you need to create docker image. I won’t go deep into all possible options, but you will be able to create images suitable for most data and ML workloads.
1️⃣ Choose base image to start from it using FROM. It can be an image from Docker Hub, AWS ECR or any other public container registry.
2️⃣ You can use RUN command to install Python packages, Lambda Insights agent or run any other commands during the image build. CMD is used to execute command in a running container (there can be only one CMD).
3️⃣ COPY local files required for correct work of your application, for example, model artefacts, Lambda code, etc.
4️⃣ Create WORKDIR as a starting point from which you will run COPY, RUN and CMD commands.
5️⃣ Save the file and run the command to build your image: docker build [PATH]
If you like this post, you can share APAWS newsletter with friends: