forked from RealDeviceMap/RealDeviceMap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
82 lines (62 loc) · 2.19 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
# ================================
# Build image
# ================================
FROM swift:5.2 as build
WORKDIR /build
# Perfect-COpenSSL
RUN apt-get -y update && apt-get install -y libssl-dev
# Perfect-libcurl
RUN apt-get -y update && apt-get install -y libcurl4-openssl-dev
# Perfect-mysqlclient-Linux
RUN apt-get -y update && apt-get install -y libmysqlclient-dev && sed -i -e 's/-fabi-version=2 -fno-omit-frame-pointer//g' /usr/lib/x86_64-linux-gnu/pkgconfig/mysqlclient.pc
# Perfect-LinuxBridge
RUN apt-get -y update && apt-get install -y uuid-dev && rm -rf /var/lib/apt/lists/*
# ImageMagick for creating raid images
RUN apt-get -y update && apt-get install -y imagemagick && cp /usr/bin/convert /usr/local/bin
# MySQL Client
RUN apt-get -y update && apt-get install -y mysql-client-5.7
# WGet
RUN apt-get -y update && apt-get install -y wget
# Pre-Build
COPY Package.swift Package.swift
RUN swift package update
COPY .emptysources Sources
COPY .emptytests Tests
RUN swift build \
--enable-test-discovery \
-c release \
-Xswiftc -g
RUN rm -rf Sources
RUN rm -rf Tests
# Build with optimizations
COPY Sources Sources
COPY Tests Tests
RUN swift build \
--enable-test-discovery \
-c release \
-Xswiftc -g
# ================================
# Run image
# ================================
FROM swift:5.2
WORKDIR /app
# Perfect-COpenSSL
RUN apt-get -y update && apt-get install -y libssl-dev
# Perfect-libcurl
RUN apt-get -y update && apt-get install -y libcurl4-openssl-dev
# Perfect-mysqlclient-Linux
RUN apt-get -y update && apt-get install -y libmysqlclient-dev && sed -i -e 's/-fabi-version=2 -fno-omit-frame-pointer//g' /usr/lib/x86_64-linux-gnu/pkgconfig/mysqlclient.pc
# Perfect-LinuxBridge
RUN apt-get -y update && apt-get install -y uuid-dev && rm -rf /var/lib/apt/lists/*
# ImageMagick for creating raid images
RUN apt-get -y update && apt-get install -y imagemagick && cp /usr/bin/convert /usr/local/bin
# MySQL Client
RUN apt-get -y update && apt-get install -y mysql-client-5.7
# WGet
RUN apt-get -y update && apt-get install -y wget
# Copy build artifacts
COPY --from=build /build/.build/release .
COPY resources resources
COPY .gitsha .
COPY .gitref .
ENTRYPOINT ["./RealDeviceMap"]