/
Dockerfile
58 lines (43 loc) · 2.74 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# TODO: should migrate to depend only on 'ambrosia' not 'ambrosia-dev':
FROM ambrosia/ambrosia-dev
# For using Tmux inside the container:
# ------------------------------------------
RUN apt-get install -y tmux
# RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8
# ----------------------------------------
# Publish to a local directory:
ENV PATH="${PATH}:/ambrosia/InternalImmortals/PerformanceTestInterruptible/Client/publish:/ambrosia/InternalImmortals/PerformanceTestInterruptible/Server/publish"
# ------------------------------------------------------------
# This Dockerfile is an example of adding the application
# *piece-by-piece* to enable incremental rebuilds.
ADD IJob /ambrosia/InternalImmortals/PerformanceTestInterruptible/IJob
WORKDIR /ambrosia/InternalImmortals/PerformanceTestInterruptible
RUN dotnet publish -o publish $BLDFLAGS IJob/IJob.csproj
# DANGER, WARNING, FIXME: it is UNSAFE to dotnet publish twice to the same absolute path:
ADD API /ambrosia/InternalImmortals/PerformanceTestInterruptible/API
RUN dotnet publish -o publish $BLDFLAGS API/ServerAPI.csproj
# Run the code-generation tool:
RUN rm -rf ./GeneratedSourceFiles && mkdir -p GeneratedSourceFiles
#RUN AmbrosiaCS CodeGen -a IJob/publish/IJob.dll -a API/publish/ServerAPI.dll -p IJob/IJob.csproj -p API/ServerAPI.csproj -o PTIAmbrosiaGeneratedAPI -f netcoreapp3.1 -f net46
RUN AmbrosiaCS CodeGen -a publish/IJob.dll -a publish/ServerAPI.dll -p IJob/IJob.csproj -p API/ServerAPI.csproj -o PTIAmbrosiaGeneratedAPI -f netcoreapp3.1 -f net46
# Be wary: absolute paths have rather different behavior for dotnet publish.
ENV BUILDIT="dotnet publish -o publish $BLDFLAGS"
# Bulid/ppublish the RPC wrappers whose project we just created:
RUN $BUILDIT GeneratedSourceFiles/PTIAmbrosiaGeneratedAPI/latest/PTIAmbrosiaGeneratedAPI.csproj
# publish the client/server executables that we'll actually run:
ADD Client /ambrosia/InternalImmortals/PerformanceTestInterruptible/Client
ADD Server /ambrosia/InternalImmortals/PerformanceTestInterruptible/Server
RUN $BUILDIT Client/Job.csproj
RUN $BUILDIT Server/Server.csproj
# Add the scripts for invoking PTI inside the container:
ADD run_*.sh /ambrosia/InternalImmortals/PerformanceTestInterruptible/
ADD default_var_settings.sh /ambrosia/InternalImmortals/PerformanceTestInterruptible/
env PATH="$PATH:/ambrosia/InternalImmortals/PerformanceTestInterruptible/bin"
# ImmortalCoordinator default port:
EXPOSE 1500
# Trying this secondary port as well:
EXPOSE 50500