-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
144 lines (122 loc) · 3.88 KB
/
Dockerfile
File metadata and controls
144 lines (122 loc) · 3.88 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
ARG DOCKER_TAG=qt5 #default tag.
FROM archlinux:base AS base
LABEL org.opencontainers.image.authors='Mykola Dimura <mykola.dimura@gmail.com>'
LABEL org.opencontainers.image.source=https://github.com/mdimura/docker-mingw-arch
LABEL org.opencontainers.image.description="Mingw-based build environment based on arch-linux. Easy cross-compilation for windows target."
LABEL org.opencontainers.image.licenses=MIT
# Create devel user...
RUN useradd -m -d /home/devel -u 1000 -U -G users,tty -s /bin/bash devel
RUN echo 'devel ALL=(ALL) NOPASSWD: /usr/sbin/pacman, /usr/sbin/makepkg' >> /etc/sudoers;
RUN mkdir -p /workdir && chown devel.users /workdir
#Workaround for the "setrlimit(RLIMIT_CORE): Operation not permitted" error
RUN echo "Set disable_coredump false" >> /etc/sudo.conf
RUN pacman -Syyu --noconfirm --noprogressbar
# Add packages to the base system
RUN pacman -S --noconfirm --noprogressbar \
imagemagick make ninja git binutils \
patch base-devel wget \
pacman-contrib expac nano openssh
ENV EDITOR=nano
# Install yay
USER devel
ARG BUILDDIR=/tmp/tmp-build
RUN mkdir "${BUILDDIR}" && cd "${BUILDDIR}" && \
git clone https://aur.archlinux.org/yay.git && \
cd yay && makepkg -si --noconfirm --rmdeps && \
rm -rf "${BUILDDIR}"
USER root
# Add mingw-repo
RUN echo "[ownstuff]" >> /etc/pacman.conf \
&& echo "SigLevel = Optional TrustAll" >> /etc/pacman.conf \
&& echo "Server = https://martchus.no-ip.biz/repo/arch/ownstuff/os/\$arch" >> /etc/pacman.conf \
&& pacman -Sy
# Install essential MingW packages (from ownstuff)
RUN pacman -S --noconfirm --noprogressbar \
mingw-w64-binutils \
mingw-w64-crt \
mingw-w64-gcc \
mingw-w64-headers \
mingw-w64-winpthreads \
mingw-w64-cmake \
mingw-w64-tools \
mingw-w64-zlib
# Cleanup
USER root
RUN pacman -Scc --noconfirm
RUN paccache -r -k0; \
rm -rf /usr/share/man/*; \
rm -rf /tmp/*; \
rm -rf /var/tmp/*;
USER devel
RUN yay -Scc
ENV HOME=/home/devel
WORKDIR /workdir
ONBUILD USER root
ONBUILD WORKDIR /
FROM base AS qt5
USER root
# Install Qt5 and some other MingW packages (from ownstuff)
RUN pacman -S --noconfirm --noprogressbar \
mingw-w64-bzip2 \
mingw-w64-expat \
mingw-w64-fontconfig \
mingw-w64-freeglut \
mingw-w64-freetype2 \
mingw-w64-gettext \
mingw-w64-libdbus \
mingw-w64-libiconv \
mingw-w64-libjpeg-turbo \
mingw-w64-libpng \
mingw-w64-libtiff \
mingw-w64-libxml2 \
mingw-w64-mariadb-connector-c \
mingw-w64-openssl \
mingw-w64-openjpeg \
mingw-w64-openjpeg2 \
mingw-w64-pcre \
mingw-w64-pdcurses \
mingw-w64-pkg-config \
mingw-w64-readline \
mingw-w64-sdl2 \
mingw-w64-sqlite \
mingw-w64-termcap \
mingw-w64-qt5-base \
mingw-w64-qt5-declarative \
mingw-w64-qt5-graphicaleffects \
mingw-w64-qt5-imageformats \
mingw-w64-qt5-location \
mingw-w64-qt5-multimedia \
mingw-w64-qt5-quickcontrols \
mingw-w64-qt5-script \
mingw-w64-qt5-sensors \
mingw-w64-qt5-svg \
mingw-w64-qt5-tools \
mingw-w64-qt5-translations \
mingw-w64-qt5-websockets \
mingw-w64-qt5-winextras
# Install AUR packages
USER devel
RUN yay -S --noconfirm --noprogressbar --needed \
mingw-w64-boost \
mingw-w64-eigen \
mingw-w64-qt5-quickcontrols2 \
mingw-w64-qt5-serialport \
mingw-w64-configure \
mingw-w64-python-bin
# Cleanup
USER root
RUN pacman -Scc --noconfirm
RUN paccache -r -k0; \
rm -rf /usr/share/man/*; \
rm -rf /tmp/*; \
rm -rf /var/tmp/*;
USER devel
RUN yay -Scc
WORKDIR /workdir
ONBUILD USER root
ONBUILD WORKDIR /
FROM ${DOCKER_TAG} AS current
USER devel
WORKDIR /workdir
ONBUILD USER root
ONBUILD WORKDIR /