This repository was archived by the owner on Dec 6, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +31
-9
lines changed Expand file tree Collapse file tree 3 files changed +31
-9
lines changed Original file line number Diff line number Diff line change
1
+ FROM alpine:3.8
2
+ COPY entrypoint.sh /entrypoint.sh
3
+ WORKDIR /app
4
+ RUN apk add --no-cache php7 && \
5
+ chmod +x /entrypoint.sh && \
6
+ chown -R nobody:nobody /entrypoint.sh
7
+
8
+ USER nobody
9
+
10
+ ENTRYPOINT ["/entrypoint.sh" ]
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ if [ $# -eq 1 ]; then
3
+ php $1 /a.php
4
+ php $1 /b.php
5
+ exit 1
6
+ elif [ $# -eq 2 ]; then
7
+ php $1 /$2 .php
8
+ exit 1
9
+ else
10
+ echo " Need some parameters."
11
+ fi
12
+
13
+ exec " $@ "
Original file line number Diff line number Diff line change 1
- #! /bin/sh
2
- if [ $# -eq 1 ]; then
3
- docker run --rm -it -v $PWD :/app -w /app php:7.3-rc-cli php $1 /a.php
4
- docker run --rm -it -v $PWD :/app -w /app php:7.3-rc-cli php $1 /b.php
5
- exit 1
6
- fi
7
- if [ $# -eq 2 ]; then
8
- docker run --rm -it -v $PWD :/app -w /app php:7.3-rc-cli php $1 /$2 .php
9
- exit 1
1
+ #! /bin/bash
2
+ IMAGE=greboid/aoc-2018
3
+ docker image inspect $IMAGE > /dev/null 2>&1
4
+ if [ $? -ne 0 ]
5
+ then
6
+ echo " One time setup: building docker image..."
7
+ docker build . -t $IMAGE
10
8
fi
9
+ docker run --rm -it -v $( pwd) :/app $IMAGE $@
You can’t perform that action at this time.
0 commit comments