-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
35 lines (29 loc) · 975 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM mcr.microsoft.com/dotnet/sdk:6.0
RUN set -ex; \
useradd --create-home -u 9999 codewarrior; \
mkdir -p /workspace; \
chown codewarrior:codewarrior /workspace;
COPY --chown=codewarrior:codewarrior workspace /workspace
RUN set -ex; \
echo "#!/bin/sh" > /usr/bin/fsc; \
echo "dotnet /usr/share/dotnet/sdk/$(dotnet --version)/FSharp/fsc.dll \$@" >> /usr/bin/fsc; \
chmod +x /usr/bin/fsc; \
mkdir -p /opt/nuget/packages; \
mkdir -p /opt/nuget/cache; \
chmod -R o+rw /opt/nuget;
USER codewarrior
ENV USER=codewarrior \
HOME=/home/codewarrior \
DOTNET_CLI_TELEMETRY_OPTOUT=1 \
NUGET_PACKAGES=/opt/nuget/packages \
NUGET_HTTP_CACHE_PATH=/opt/nuget/cache
RUN set -ex; \
cd /workspace; \
dotnet restore; \
# Copy all the necessary files to bin/
dotnet build --no-restore; \
# Sanity check
dotnet run; \
# Remove examples
rm Preloaded.fs Solution.fs Tests.fs bin/Debug/net6.0/run.dll;
WORKDIR /workspace