Permalink
Browse files

I can be a cool-kid and use alpine as well.

  • Loading branch information...
ShaneMcC committed Dec 3, 2018
1 parent b1b0b96 commit 507507ff0ccd5962f30b557994ab42bc1bb0d72f
Showing with 18 additions and 11 deletions.
  1. +12 −8 common/common.php
  2. +1 −1 docker.sh
  3. +5 −2 docker/Dockerfile
@@ -28,15 +28,19 @@
function getInputFilename() {
global $__CLIOPTS;
if (!posix_isatty(STDIN)) {
return 'php://stdin';
} else if (isset($__CLIOPTS['file']) && file_exists($__CLIOPTS['file'])) {
return $__CLIOPTS['file'];
}
if (getenv("TIMED") !== FALSE) {
return realpath(dirname($_SERVER['PHP_SELF'])) . '/input.txt';
} else {
if (!posix_isatty(STDIN)) {
return 'php://stdin';
} else if (isset($__CLIOPTS['file']) && file_exists($__CLIOPTS['file'])) {
return $__CLIOPTS['file'];
}
$default = realpath(dirname($_SERVER['PHP_SELF'])) . '/' . basename(isTest() ? 'test.txt' : 'input.txt');
if (file_exists($default)) {
return $default;
$default = realpath(dirname($_SERVER['PHP_SELF'])) . '/' . basename(isTest() ? 'test.txt' : 'input.txt');
if (file_exists($default)) {
return $default;
}
}
die('No valid input found.');
@@ -1,6 +1,6 @@
#!/bin/bash

IMAGE=shanemcc/aoc-2018-03
IMAGE=shanemcc/aoc-2018-04

docker image inspect $IMAGE >/dev/null 2>&1
if [ $? -ne 0 ]
@@ -1,7 +1,10 @@
FROM php:7.3-rc-cli
FROM alpine:3.8

ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

RUN apk add --no-cache php7 bash && \
chmod +x /entrypoint.sh && \
chown -R nobody:nobody /entrypoint.sh

USER nobody

0 comments on commit 507507f

Please sign in to comment.