Permalink
Browse files

Docker benchmarking for Shane

  • Loading branch information...
cnorthwood committed Dec 2, 2018
1 parent b83392d commit 785e08e8246b86ce88dc7766a628ec59ea94c19c
Showing with 37 additions and 0 deletions.
  1. +14 −0 docker.sh
  2. +11 −0 docker/Dockerfile
  3. +12 −0 docker/entrypoint.sh
@@ -0,0 +1,14 @@
#!/bin/bash

IMAGE=cnorthwood/aoc

docker image inspect $IMAGE >/dev/null 2>&1
if [ $? -ne 0 ]
then
echo "One time setup: building docker image..."
cd docker
docker build . -t $IMAGE
cd ..
fi

docker run --rm -it $IMAGE /entrypoint.sh $@
@@ -0,0 +1,11 @@
FROM pypy:3

ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN mkdir /code
RUN chown nobody /code

USER nobody

RUN git clone https://github.com/cnorthwood/adventofcode.git /code
CMD /entrypoint.sh
@@ -0,0 +1,12 @@
#!/bin/bash

set +ex

YEAR="${1}"
DAY="${2}"

cd /code
git pull
git checkout ${YEAR}day${DAY}

time sh -c './part1.py; ./part2.py'

0 comments on commit 785e08e

Please sign in to comment.