generated from azmisahin/azmisahin-software-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.windows
58 lines (46 loc) · 1.36 KB
/
Dockerfile.windows
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
# base operation system image
FROM mcr.microsoft.com/windows/servercore:ltsc2019 as production
# Metadata indicating an image maintainer.
LABEL maintainer="Azmi ŞAHİN <[email protected]>"
# product arguments
ARG ENV="production"
ARG NAME="connector"
# default arguments for build
ARG WORK_DIR="/connector"
ARG BUILD_DIR="build"
ARG DIST_DIR="dist"
# default arguments for application
ARG REMOTE_IP_ADDRESS="198.41.0.4"
ARG REMOTE_PORT="53"
ARG CLIENT_MESSAGE="0"
# product environment
ENV ENV=${ENV}
ENV NAME=${NAME}
# default envionment for build
ENV WORK_DIR=${WORK_DIR}
ENV BUILD_DIR=${BUILD_DIR}
ENV DIST_DIR=${DIST_DIR}
# default environment for application
ENV REMOTE_IP_ADDRESS=${REMOTE_IP_ADDRESS}
ENV REMOTE_PORT=${REMOTE_PORT}
ENV CLIENT_MESSAGE=${CLIENT_MESSAGE}
# make the 'application' folder the current working directory
WORKDIR ${WORK_DIR}
# copy project file the working directory
COPY . .
# install project dependencies
# update
# install build tools
# install clang
# install cmake
# build
RUN mkdir %BUILD_DIR% && \
cd %BUILD_DIR% && \
echo cmake .. &&\
echo make &&\
mkdir %DIST_DIR% && \
mkdir %DIST_DIR%_test && \
echo copy ./%NAME%.exe %DIST_DIR% && \
echo copy ./%NAME%_test.exe %DIST_DIR%_test.exe
# test
RUN echo %WORK_DIR%/%BUILD_DIR%/%DIST_DIR%_test/%NAME%_test.exe %REMOTE_IP_ADDRESS% %REMOTE_PORT% "%CLIENT_MESSAGE%"