From bfed6e74a72a1c0ad8c2f94bbc6f24aa99093eb5 Mon Sep 17 00:00:00 2001 From: Manuel Date: Wed, 12 May 2021 07:16:42 +0200 Subject: [PATCH 1/5] Allow container to be run with custom command --- Dockerfile | 2 +- Dockerfile.release | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 624994b..fbf8add 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,4 +34,4 @@ COPY --from=build /opt/myriad . EXPOSE 8081 -CMD ["./myriad"] \ No newline at end of file +ENTRYPOINT ["./myriad"] \ No newline at end of file diff --git a/Dockerfile.release b/Dockerfile.release index 95b951b..e5e0c43 100644 --- a/Dockerfile.release +++ b/Dockerfile.release @@ -16,4 +16,4 @@ COPY --from=build /tmp/myriad . EXPOSE 8081 -CMD ["./myriad"] \ No newline at end of file +ENTRYPOINT ["./myriad"] \ No newline at end of file From 23bfdb65ab77d6b41d180971d82957e875683cae Mon Sep 17 00:00:00 2001 From: Manuel Date: Wed, 12 May 2021 07:30:49 +0200 Subject: [PATCH 2/5] Reduce language image sizes --- languages/brainfuck/Dockerfile | 8 ++++---- languages/c/Dockerfile | 3 +-- languages/cpp/Dockerfile | 3 +-- languages/idris/Dockerfile | 3 ++- languages/lua/Dockerfile | 3 +-- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/languages/brainfuck/Dockerfile b/languages/brainfuck/Dockerfile index 067f601..16300c1 100644 --- a/languages/brainfuck/Dockerfile +++ b/languages/brainfuck/Dockerfile @@ -1,12 +1,12 @@ -FROM alpine AS build +FROM alpine as build -RUN apk update && apk add g++ COPY bf.cpp . -RUN g++ bf.cpp -o bf +RUN apk add --no-cache g++ && \ + g++ bf.cpp -o bf FROM alpine LABEL author="1Computer1" -RUN apk update && apk add libstdc++ +RUN apk add --no-cache libstdc++ COPY --from=build bf /usr/local/bin/ COPY run.sh /var/run/ diff --git a/languages/c/Dockerfile b/languages/c/Dockerfile index 1324766..862b281 100644 --- a/languages/c/Dockerfile +++ b/languages/c/Dockerfile @@ -1,7 +1,6 @@ FROM alpine LABEL author="1Computer1" -RUN apk update -RUN apk add gcc libc-dev +RUN apk add --no-cache gcc libc-dev COPY run.sh /var/run/ diff --git a/languages/cpp/Dockerfile b/languages/cpp/Dockerfile index 37bc37b..2242843 100644 --- a/languages/cpp/Dockerfile +++ b/languages/cpp/Dockerfile @@ -1,7 +1,6 @@ FROM alpine LABEL author="1Computer1" -RUN apk update -RUN apk add g++ +RUN apk add --no-cache g++ COPY run.sh /var/run/ diff --git a/languages/idris/Dockerfile b/languages/idris/Dockerfile index 04b8d8f..418b58f 100644 --- a/languages/idris/Dockerfile +++ b/languages/idris/Dockerfile @@ -2,6 +2,7 @@ FROM alpine:latest RUN echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \ apk update && \ - apk add idris@testing + apk add idris@testing && \ + rm -rf /var/cache/apk/* COPY run.sh /var/run/ diff --git a/languages/lua/Dockerfile b/languages/lua/Dockerfile index 0835675..c15ec01 100644 --- a/languages/lua/Dockerfile +++ b/languages/lua/Dockerfile @@ -1,6 +1,5 @@ FROM alpine -RUN apk update -RUN apk add lua5.3 +RUN apk add --no-cache lua5.3 COPY run.sh /var/run/ From 73d3fce78ac7c7cc0930ef1d376fde09cd0f6d9a Mon Sep 17 00:00:00 2001 From: Manuel Date: Wed, 12 May 2021 07:31:49 +0200 Subject: [PATCH 3/5] Update OpenJDK to latest version --- languages/java/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/java/Dockerfile b/languages/java/Dockerfile index dcc0975..e78541e 100644 --- a/languages/java/Dockerfile +++ b/languages/java/Dockerfile @@ -1,4 +1,4 @@ -FROM openjdk:13-alpine +FROM openjdk:17-alpine LABEL author="1Computer1" COPY run.sh /var/run/ From a51b94913ab193c53ad9d2432b36b85a45c75bda Mon Sep 17 00:00:00 2001 From: Manuel Date: Wed, 12 May 2021 07:33:35 +0200 Subject: [PATCH 4/5] Use swc for TypeScript and don't print by default --- languages/javascript/run.sh | 3 ++- languages/typescript/Dockerfile | 2 +- languages/typescript/run.sh | 4 +--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/languages/javascript/run.sh b/languages/javascript/run.sh index 6e087ee..6629b86 100644 --- a/languages/javascript/run.sh +++ b/languages/javascript/run.sh @@ -1 +1,2 @@ -cat | node -p +cat > program.js +node program.js diff --git a/languages/typescript/Dockerfile b/languages/typescript/Dockerfile index f1eb610..4007da5 100644 --- a/languages/typescript/Dockerfile +++ b/languages/typescript/Dockerfile @@ -1,6 +1,6 @@ FROM node:alpine LABEL author="1Computer1" -RUN yarn global add typescript @types/node +RUN npm install --global --save-dev @swc/core @swc/register COPY run.sh /var/run/ diff --git a/languages/typescript/run.sh b/languages/typescript/run.sh index 4d12a04..77ff51d 100644 --- a/languages/typescript/run.sh +++ b/languages/typescript/run.sh @@ -1,4 +1,2 @@ cat > program.ts -tsc --lib DOM,ESNext --target ES2019 --strict \ - --skipLibCheck --types /usr/local/share/.config/yarn/global/node_modules/@types/node program.ts \ - && cat program.js | node -p +swc-node program.ts From 45d28eb237fb0c38df26701e2b87cdd1c9396f8e Mon Sep 17 00:00:00 2001 From: Manuel Date: Wed, 12 May 2021 07:37:26 +0200 Subject: [PATCH 5/5] Update Haskell image and use stable Debian slim --- languages/haskell/Dockerfile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/languages/haskell/Dockerfile b/languages/haskell/Dockerfile index ad6b169..6039727 100644 --- a/languages/haskell/Dockerfile +++ b/languages/haskell/Dockerfile @@ -1,14 +1,17 @@ -FROM debian:stretch +FROM debian:stable-slim LABEL author="1Computer1" ENV LANG C.UTF-8 RUN apt-get update && \ - apt-get install -y --no-install-recommends gnupg dirmngr && \ - echo 'deb http://downloads.haskell.org/debian stretch main' > /etc/apt/sources.list.d/ghc.list && \ + apt-get install -y --no-install-recommends gnupg dirmngr ca-certificates && \ + echo 'deb https://downloads.haskell.org/debian stretch main' > /etc/apt/sources.list.d/ghc.list && \ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA3CBA3FFE22B574 && \ apt-get update && \ - apt-get install -y --no-install-recommends ghc-8.6.5 + apt-get install -y --no-install-recommends ghc-9.0.1 && \ + apt-get purge -y gnupg dirmngr ca-certificates && \ + apt-get autoremove -y && \ + apt-get autoclean -y -ENV PATH /opt/ghc/8.6.5/bin:$PATH +ENV PATH /opt/ghc/9.0.1/bin:$PATH COPY run.sh /var/run/