-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
142 lines (123 loc) · 3.92 KB
/
Copy pathDockerfile
File metadata and controls
142 lines (123 loc) · 3.92 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
FROM ghcr.io/trueforge-org/golang:1.26.2@sha256:0cc15407a61022147e4025d6707343990c17f3e4026ea4c847e07ed8df165ea4 as migrationbuilder
USER root
RUN \
echo "**** build fs-repo-migrations ****" && \
mkdir -p /build-out/usr/bin && \
git clone https://github.com/ipfs/fs-repo-migrations.git && \
cd fs-repo-migrations && \
for BUILD in fs-repo-migrations fs-repo-12-to-13 fs-repo-13-to-14 fs-repo-14-to-15; do \
cd ${BUILD} && \
go build && \
mv fs-repo-* /build-out/usr/bin/ && \
cd .. ; \
done
FROM ghcr.io/trueforge-org/golang:1.26.2@sha256:0cc15407a61022147e4025d6707343990c17f3e4026ea4c847e07ed8df165ea4 as binbuilder
USER root
RUN \
echo "**** build nestool ****" && \
mkdir -p /build-out/usr/local/bin && \
git clone https://github.com/Kreeblah/NES20Tool.git && \
cd NES20Tool && \
go build && \
mv NES20Tool /build-out/usr/local/bin
RUN \
echo "**** grab binmerge ****" && \
BINMERGE_RELEASE=$(curl -sX GET "https://api.github.com/repos/putnam/binmerge/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]') && \
curl -o \
/tmp/binmerge.tar.gz -L \
"https://github.com/putnam/binmerge/archive/${BINMERGE_RELEASE}.tar.gz" && \
tar xf \
/tmp/binmerge.tar.gz -C \
/tmp/ --strip-components=1 && \
chmod +x /tmp/binmerge && \
mv /tmp/binmerge /build-out/usr/local/bin
RUN \
echo "**** build fs-repo-migrations ****" && \
mkdir /build-out/usr/bin && \
git clone https://github.com/ipfs/fs-repo-migrations.git && \
cd fs-repo-migrations && \
for BUILD in fs-repo-migrations fs-repo-12-to-13 fs-repo-13-to-14 fs-repo-14-to-15; do \
cd ${BUILD} && \
go build && \
mv fs-repo-* /build-out/usr/bin/ && \
cd .. ; \
done
FROM ghcr.io/trueforge-org/node:24.15.0@sha256:5d401829d5061483016ca171db4e1d540fc07ba5e4b8722a3b5f272c2b69ffae as nodebuilder
USER root
ARG VERSION
RUN \
echo "**** install build packages ****" && \
apt-get update && \
apt-get install -y --no-install-recommends \
p7zip-full \
zip && \
rm -rf /var/lib/apt/lists/*
RUN \
echo "**** grab emulatorjs ****" && \
mkdir /emulatorjs && \
curl -o \
/tmp/emulatorjs.tar.gz -L \
"https://github.com/linuxserver/emulatorjs/archive/${VERSION}.tar.gz" && \
tar xf \
/tmp/emulatorjs.tar.gz -C \
/emulatorjs/ --strip-components=1
RUN \
echo "**** grab emulatorjs blobs ****" && \
curl -o \
/tmp/emulatorjs-blob.tar.gz -L \
"https://github.com/thelamer/emulatorjs/archive/main.tar.gz" && \
tar xf \
/tmp/emulatorjs-blob.tar.gz -C \
/emulatorjs/frontend/ --strip-components=1
RUN \
echo "**** grab libretro blobs ****" && \
curl -o \
/tmp/custom-cores.tar.gz -L \
"https://github.com/linuxserver/libretro-cores/archive/master.tar.gz" && \
tar xf \
/tmp/custom-cores.tar.gz -C \
/emulatorjs/frontend/ --strip-components=1 && \
rm /emulatorjs/frontend/README.md
RUN \
echo "**** build emulatorjs ****" && \
cd /emulatorjs && \
npm install
# runtime stage
FROM ghcr.io/trueforge-org/python:3.14.5@sha256:c1237b4ee242c9d67a1bae2611ab92f45e8c39da8835a974e4dd49d43077c353
# set version label
ARG VERSION
ARG TARGETARCH
USER root
RUN \
echo "**** install runtime packages ****" && \
apt-get update && \
apt-get install -y --no-install-recommends \
file \
flac \
libcap2-bin \
nginx \
nodejs \
p7zip-full \
python3 \
libsdl2-2.0-0 && \
apt-get install -y --no-install-recommends \
mame-tools && \
mkdir -p /data && \
echo "**** allow non-root nginx to bind low ports ****" && \
setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/* && \
rm -rf /var/lib/apt/lists/*
# add local files and files from buildstage
COPY --from=binbuilder /build-out/ /
COPY --from=migrationbuilder /build-out/ /
COPY --from=nodebuilder /emulatorjs/ /emulatorjs/
USER apps
COPY --chmod=0755 . /
COPY --chmod=0755 root/ /
# ports
EXPOSE 80 3000
WORKDIR /config
VOLUME /config