-
Notifications
You must be signed in to change notification settings - Fork 25
/
Dockerfile
83 lines (59 loc) · 2.21 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# ARGUMENTS --------------------------------------------------------------------
##
# Board architecture
##
ARG IMAGE_ARCH=
##
# Base container version
##
ARG BASE_VERSION=3-6.12.0
##
# Directory of the application inside container
##
ARG APP_ROOT=
# ARGUMENTS --------------------------------------------------------------------
# BUILD ------------------------------------------------------------------------
FROM --platform=linux/${IMAGE_ARCH} \
commontorizon/mono-sdk:${BASE_VERSION} AS build
ARG IMAGE_ARCH
ARG APP_ROOT
RUN apt-get -y update && apt-get install -y --no-install-recommends \
# ADD YOUR PACKAGES HERE
# DO NOT REMOVE THIS LABEL: this is used for VS Code automation
# __torizon_packages_build_start__
# __torizon_packages_build_end__
# DO NOT REMOVE THIS LABEL: this is used for VS Code automation
&& \
apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/*
COPY . ${APP_ROOT}
WORKDIR ${APP_ROOT}
# build
RUN msbuild
# BUILD ------------------------------------------------------------------------
# DEPLOY -----------------------------------------------------------------------
FROM --platform=linux/${IMAGE_ARCH} \
commontorizon/mono-runtime:${BASE_VERSION} AS deploy
ARG IMAGE_ARCH
ARG APP_ROOT
RUN apt-get -y update && apt-get install -y --no-install-recommends \
libmono-system-windows4.0-cil \
libmono-system-windows-forms4.0-cil \
libgtk2.0 \
# ADD YOUR PACKAGES HERE
# DO NOT REMOVE THIS LABEL: this is used for VS Code automation
# __torizon_packages_prod_start__
# __torizon_packages_prod_end__
# DO NOT REMOVE THIS LABEL: this is used for VS Code automation
&& \
apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/*
USER torizon
COPY ./assets ${APP_ROOT}/assets
# Copy the application compiled in the build step to the $APP_ROOT directory
# path inside the container, where $APP_ROOT is the torizon_app_root
# configuration defined in settings.json
COPY --from=build ${APP_ROOT}/bin/Debug ${APP_ROOT}
# "cd" (enter) into the APP_ROOT directory
WORKDIR ${APP_ROOT}
# Command executed in runtime when the container starts
CMD ["mono", "__change__.exe"]
# DEPLOY -----------------------------------------------------------------------