2023-11-08 03:20:29 +08:00
|
|
|
FROM ubuntu:latest
|
|
|
|
|
|
|
|
# Use Ubuntu image from Aliyun
|
|
|
|
RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list && \
|
|
|
|
sed -i 's/security.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list && \
|
|
|
|
sed -i 's/ports.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
|
|
|
|
|
2023-11-08 17:35:20 +08:00
|
|
|
RUN apt-get update && apt-get install -y wget
|
2023-11-08 03:20:29 +08:00
|
|
|
|
2023-11-08 17:35:20 +08:00
|
|
|
# Install languages environment
|
|
|
|
ARG LANGS
|
2023-11-08 03:20:29 +08:00
|
|
|
RUN for LANG in $LANGS; do \
|
2023-11-14 21:27:35 +08:00
|
|
|
case $LANG in \
|
2023-11-08 03:20:29 +08:00
|
|
|
python) \
|
|
|
|
apt-get install -y python3.10 && \
|
|
|
|
update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 ;; \
|
|
|
|
cpp) \
|
|
|
|
apt-get install -y g++ gdb ;; \
|
|
|
|
java) \
|
|
|
|
apt-get install -y openjdk-17-jdk ;; \
|
2023-11-08 17:35:20 +08:00
|
|
|
csharp) \
|
|
|
|
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
|
|
|
|
dpkg -i packages-microsoft-prod.deb && \
|
|
|
|
apt-get update && \
|
|
|
|
apt-get install -y dotnet-sdk-6.0 ;; \
|
2023-11-08 03:20:29 +08:00
|
|
|
# More languages...
|
|
|
|
*) \
|
|
|
|
echo "Warning: No installation workflow for $LANG" ;; \
|
|
|
|
esac \
|
|
|
|
done
|
|
|
|
|
|
|
|
WORKDIR /codes
|
|
|
|
COPY ./ ./
|
|
|
|
|
|
|
|
CMD ["/bin/bash"]
|