Skip to content

Commit 6904a78

Browse files
André DietrichAndré Dietrich
authored andcommitted
fix: io build and reduced container size
1 parent 0cfecb2 commit 6904a78

1 file changed

Lines changed: 33 additions & 19 deletions

File tree

Dockerfile

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ RUN apt-get install -y --no-install-recommends \
5656
# Elixir
5757
erlang-dev elixir \
5858
# Latex
59-
texlive-latex-extra \
59+
texlive-latex-base \
6060
# COBOL
6161
gnucobol \
6262
# Fortran
@@ -132,7 +132,9 @@ RUN apt-get install -y --no-install-recommends \
132132
r-base \
133133
r-cran-car \
134134
r-cran-mapdata \
135-
r-cran-reshape
135+
r-cran-reshape && \
136+
apt-get clean && \
137+
rm -rf /var/lib/apt/lists/*
136138

137139
##################################################################################
138140
### JAVA
@@ -148,27 +150,30 @@ RUN curl -fsSL https://install.julialang.org | sh -s -- -y \
148150
&& ln -s /root/.juliaup/bin/julia /usr/local/bin/julia
149151

150152
### Zig
151-
RUN curl -fLO https://ziglang.org/download/0.14.0/zig-linux-x86_64-0.14.0.tar.xz \
152-
&& tar -xf zig-linux-x86_64-0.14.0.tar.xz \
153-
&& rm zig-linux-x86_64-0.14.0.tar.xz \
154-
&& mv zig-linux-x86_64-0.14.0/ /opt/ \
155-
&& ln -s /opt/zig-linux-x86_64-0.14.0/zig /usr/local/bin/zig
153+
RUN curl -fLO https://ziglang.org/download/0.16.0/zig-x86_64-linux-0.16.0.tar.xz \
154+
&& tar -xf zig-x86_64-linux-0.16.0.tar.xz \
155+
&& rm zig-x86_64-linux-0.16.0.tar.xz \
156+
&& mv zig-x86_64-linux-0.16.0/ /opt/ \
157+
&& ln -s /opt/zig-x86_64-linux-0.16.0/zig /usr/local/bin/zig
156158

157159
### Nim
158160
RUN curl -O https://nim-lang.org/choosenim/init.sh -sSf \
159161
&& sh init.sh -y \
160-
&& ln -s /root/.nimble/bin/nim /usr/local/bin/nim
162+
&& ln -s /root/.nimble/bin/nim /usr/local/bin/nim \
163+
&& rm init.sh \
164+
&& rm -rf /root/.choosenim/downloads
161165

162166
### V-lang
163167
RUN git clone https://github.com/vlang/v
164168
RUN cd v &&\
165169
make && \
166-
./v symlink
170+
./v symlink && \
171+
rm -rf .git
167172

168173
### Python3
169174
# Install the latest version of meson
170-
RUN pip3 install --upgrade meson \
171-
&& pip3 install \
175+
RUN pip3 install --no-cache-dir --upgrade meson \
176+
&& pip3 install --no-cache-dir \
172177
matplotlib \
173178
numpy \
174179
opencv-python opencv-contrib-python \
@@ -195,14 +200,18 @@ RUN curl -O https://www.dyalog.com/uploads/php/download.dyalog.com/download.php?
195200

196201
### IO
197202
# Install dependencies
198-
RUN apt-get install -y libffi-dev \
203+
RUN apt-get update && \
204+
apt-get install -y --no-install-recommends \
205+
libffi-dev \
199206
libpcre3-dev \
200207
libxml2-dev \
201208
libssl-dev \
202-
zlib1g-dev
209+
zlib1g-dev && \
210+
apt-get clean && \
211+
rm -rf /var/lib/apt/lists/*
203212

204-
# Clone the Io language repository with submodules
205-
RUN git clone --recurse-submodules https://github.com/IoLanguage/io.git && \
213+
# Clone the Io language repository with submodules (native branch for CMake build)
214+
RUN git clone --recurse-submodules --branch native https://github.com/IoLanguage/io.git && \
206215
cd io && \
207216
mkdir build && \
208217
cd build && \
@@ -213,7 +222,8 @@ RUN git clone --recurse-submodules https://github.com/IoLanguage/io.git && \
213222
rm -rf io
214223

215224
# Solidity
216-
RUN npm install --global solc
225+
RUN npm install --global solc && \
226+
npm cache clean --force
217227

218228
# Q# (Quantum)
219229
RUN dotnet tool install -g Microsoft.Quantum.IQSharp
@@ -225,7 +235,9 @@ RUN curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
225235
&& git clone --recursive https://github.com/andre-dietrich/SelectScriptC.git \
226236
&& cd SelectScriptC \
227237
&& make \
228-
&& make install
238+
&& make install \
239+
&& cd / \
240+
&& rm -rf SelectScriptC
229241

230242
RUN apt-get update && \
231243
apt-get install -y --no-install-recommends \
@@ -234,13 +246,15 @@ RUN apt-get update && \
234246
gnustep-devel \
235247
libgnustep-base-dev \
236248
libblocksruntime-dev \
237-
clang
249+
clang && \
250+
apt-get clean && \
251+
rm -rf /var/lib/apt/lists/*
238252

239253
#############################################################################################
240254
COPY . /coderunner
241255
WORKDIR "/coderunner"
242256

243-
RUN pip3 install -r requirements.txt
257+
RUN pip3 install --no-cache-dir -r requirements.txt
244258

245259
RUN chmod u+s /usr/bin/firejail
246260

0 commit comments

Comments
 (0)