blob: 326f17f703da4152d33a2f6d683c59e4783e540d [file] [log] [blame]
Nico Huberc0b52db2022-12-15 12:42:32 +00001FROM manibase
2
3RUN \
4 useradd -p locked -m mani && \
Nico Huber1faffa52024-11-09 22:44:53 +01005 if [ -f /etc/apt/sources.list.d/ubuntu.sources ]; then \
6 true; \
7 elif grep -q main /etc/apt/sources.list; then \
Nico Huberc0b52db2022-12-15 12:42:32 +00008 if ! grep -q universe /etc/apt/sources.list; then \
9 sed -i -e 's/ main$/ main universe/' \
10 /etc/apt/sources.list || exit 1; \
11 fi; \
12 else \
13 url="http://ports.ubuntu.com/" && \
14 cn="$(sed -ne's/DISTRIB_CODENAME=//p' /etc/lsb-release)" && \
15 for t in "" "-updates" "-security"; do \
16 echo "deb ${url} ${cn}${t} main universe" \
17 >>/etc/apt/sources.list || exit 1; \
18 done; \
19 fi && \
20 apt-get -qq update && \
21 apt-get -qq upgrade && \
Nico Huberb115c982023-03-02 23:10:05 +000022 apt-get -qqy install gcc make git doxygen ccache pkg-config meson \
Nico Hubere59061a2023-03-02 23:08:09 +000023 libpci-dev libftdi1-dev libusb-1.0-0-dev && \
Steve Markgraf61899472023-01-09 23:06:52 +010024 { apt-get -qqy install libjaylink-dev libgpiod-dev || true; } && \
Nico Huberc0b52db2022-12-15 12:42:32 +000025 apt-get clean
26
Nico Huberfb433ba2023-03-04 19:09:47 +000027RUN mkdir -p -m 1777 /ccache
28
Nico Huberc0b52db2022-12-15 12:42:32 +000029ENV GIT_SSL_NO_VERIFY=1
30USER mani
31
Nico Huberc3b02dc2023-08-12 01:13:45 +020032ARG ORIGIN=https://review.sourcearcade.org/flashprog.git
Nico Huberc0b52db2022-12-15 12:42:32 +000033RUN \
34 cd && \
35 mkdir .ccache && chown mani:mani .ccache && \
Nico Huberc3b02dc2023-08-12 01:13:45 +020036 git clone ${ORIGIN} flashprog
Nico Huberc0b52db2022-12-15 12:42:32 +000037
Nico Huberfb433ba2023-03-04 19:09:47 +000038ARG IDENT=mani
39ARG CCACHE_MAX=32M
40RUN \
41 ccache --set-config cache_dir=/ccache/${IDENT} && \
42 ccache --set-config max_size=${CCACHE_MAX}
43
Nico Huberc0b52db2022-12-15 12:42:32 +000044ENV DEVSHELL /bin/bash
45COPY mani-wrapper.sh /home/mani/
46ENTRYPOINT ["/bin/sh", "/home/mani/mani-wrapper.sh"]