-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
76 lines (67 loc) · 1.79 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
ARG DISTR
# Container image that runs your code
FROM $DISTR
ARG USER_ID
ARG GROUP_ID
RUN apt-get update \
&& apt-get install -y git \
gear \
hasher \
hasher-priv \
hasher-rich-chroot \
hasher-rich-chroot-user-utils \
rpm-utils \
rpm-build \
rpm-build-licenses \
rpm-macros-cmake \
rpm-macros-make \
rpm-macros-generic-compat \
apt-repo \
apt-repo-tools \
cmake \
rpm-macros-cmake \
cmake-modules \
gcc-c++ \
qt5-base-devel \
qt5-declarative-devel \
qt5-tools-devel \
libsmbclient-devel \
libsmbclient \
qt5-base-common \
doxygen \
libxerces-c-devel \
xsd \
boost-devel-headers \
desktop-file-utils \
ImageMagick-tools \
libqt-mvvm-devel \
xorg-xvfb \
xvfb-run \
sudo \
&& export CURRENT_PWD=`pwd` \
&& if [ $(getent group $GROUP_ID) ]; then \
echo "group $GROUP_ID exists."; \
else \
groupadd --gid $GROUP_ID builder2; \
fi \
&& useradd --uid $USER_ID --gid $GROUP_ID -ms /bin/bash builder2 \
&& groupadd sudo \
&& usermod -aG rpm builder2 \
&& usermod -aG sudo root \
&& usermod -aG sudo builder2 \
&& echo "root ALL=(ALL) NOPASSWD:ALL" | tee -a /etc/sudoers \
&& echo "builder2 ALL=(ALL) NOPASSWD:ALL" | tee -a /etc/sudoers \
&& hasher-useradd builder2 || : \
&& mkdir /app \
&& chown $USER_ID:$GROUP_ID /app
RUN chmod a=rwx,u+t /tmp
# Copies your code file from your action repository to the filesystem path `/` of the container
COPY script/build.sh /build.sh
ARG ARCH
RUN if [ "$ARCH" = "i386" ]; then \
sed -i 's/gear-rpm -ba/gear-rpm -ba --target=i386/g' build.sh; \
fi
USER builder2
WORKDIR /home/builder2
# Code file to execute when the docker container starts up (`build.sh`)
ENTRYPOINT ["/build.sh"]