feat: add csharp sdk to dockerfile (#929)

* feature: add csharp sdk to dockerfile

* Update docker-compose.yml

* Update Dockerfile

* remove env file

---------

Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
hpstory 2023-11-08 17:35:20 +08:00 committed by GitHub
parent d5ee877fd8
commit 99fd891d76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 7 deletions

View File

@ -5,13 +5,10 @@ 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
RUN apt-get update
RUN apt-get update && apt-get install -y wget
# 设置需要安装的语言,使用空格隔开
# Set the languages to be installed, separated by spaces
ARG LANGS="python cpp"
# Available languagespython cpp java
# Install languages environment
ARG LANGS
RUN for LANG in $LANGS; do \
case "$LANG" in \
python) \
@ -21,6 +18,11 @@ RUN for LANG in $LANGS; do \
apt-get install -y g++ gdb ;; \
java) \
apt-get install -y openjdk-17-jdk ;; \
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 ;; \
# More languages...
*) \
echo "Warning: No installation workflow for $LANG" ;; \

View File

@ -1,7 +1,12 @@
version: '3.8'
services:
hello-algo-code:
build: .
build:
context: .
args:
# 设置需要安装的语言,使用空格隔开
# Set the languages to be installed, separated by spaces
LANGS: "python cpp csharp"
image: hello-algo-code
container_name: hello-algo-code
stdin_open: true