Compare commits

..

No commits in common. '39ceb97e87448eb69a5c5ee03e7367f6aa416ab6' and '215f68903bf504d93c13148215c1e5a90a67226d' have entirely different histories.

  1. 5
      Dockerfile
  2. 4
      requirements.txt
  3. 18
      run.sh

@ -5,8 +5,7 @@ COPY requirements.txt ./
RUN apt update
RUN apt install -y zip
RUN mkdir -p ./python
RUN pwd
RUN pip install -r requirements.txt -t python/
RUN zip -r python.zip python
RUN pip install --no-cache-dir -r requirements.txt -t python/
RUN zip -r python_layer.zip python
# ENTRYPOINT ["tail", "-f", "/dev/null"]

@ -1 +1,3 @@
seaborn
pandas
scikit-learn
numpy

@ -3,17 +3,17 @@
IMAGE_NAME=python_aws_layer.image
CONTAINER_NAME=python_aws_layer.container
docker build . -t $IMAGE_NAME:latest
docker buildx build . -t $IMAGE_NAME:latest
# check if container exists
if [ "$(docker ps -a -q -f name=$CONTAINER_NAME)" ]; then
# cleanup
docker rm $CONTAINER_NAME
if [ ! "$(docker ps -a -q -f name=$CONTAINER_NAME)" ]; then
# check if it exited
if [ "$(docker ps -aq -f status=exited -f name=$CONTAINER_NAME)" ]; then
# cleanup
docker rm $CONTAINER_NAME
fi
# run your container
docker run --name $CONTAINER_NAME $IMAGE_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

Loading…
Cancel
Save