Create a zip file necessary as a AWS Layer for Python
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 lines
466 B

#!/bin/bash
IMAGE_NAME=python_aws_layer.image
CONTAINER_NAME=python_aws_layer.container
docker build . -t $IMAGE_NAME:latest
# check if container exists
if [ "$(docker ps -a -q -f name=$CONTAINER_NAME)" ]; then
# cleanup
docker rm $CONTAINER_NAME
fi
docker run \
--name $CONTAINER_NAME \
--platform linux/amd64 \
-dit \
$IMAGE_NAME
docker cp $CONTAINER_NAME:/usr/src/app/python.zip .
docker stop $CONTAINER_NAME
docker rm $CONTAINER_NAME