Skip to content

Commit e79fb93

Browse files
committed
feat: add c and c++ image
1 parent 26de11d commit e79fb93

File tree

12 files changed

+90
-0
lines changed

12 files changed

+90
-0
lines changed

Language/c/gcc-12.2.0/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM ghcr.io/labring-actions/devbox/debian-ssh-12.6:501781
2+
3+
RUN cd /home/devbox/project && \
4+
rm -rf ./*
5+
6+
COPY /Language/c/project /home/devbox/project
7+
8+
RUN apt-get update && \
9+
apt-get install -y gcc g++ make && \
10+
apt-get clean && \
11+
rm -rf /var/lib/apt/lists/*
12+
13+
RUN mkdir /root/.devbox
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"recommendations": [
3+
"pomdtr.excalidraw-editor",
4+
"editorconfig.editorconfig",
5+
"lokalise.i18n-ally",
6+
"ms-vscode.cpptools",
7+
"ms-vscode.cpptools-extension-pack",
8+
"ms-vscode.cpptools-themes",
9+
"formulahendry.code-runner"
10+
]
11+
}

Language/c/project/entrypoint.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
gcc hello.c -o hello
3+
./hello

Language/c/project/hello.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include <stdio.h>
2+
3+
int main() {
4+
printf("Hello, World!\n");
5+
return 0;
6+
}

Language/c/update_cn_dockerfile.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
DOCKERFILE=$1
4+
echo "DOCKERFILE: $DOCKERFILE"
5+
TMP_DOCKERFILE="${DOCKERFILE}tmp"
6+
cp $DOCKERFILE $TMP_DOCKERFILE
7+
8+
# 修正sed命令
9+
sed -i '$i\
10+
COPY /OS/debian-ssh/debian.sources /etc/apt/sources.list.d/debian.sources' "$TMP_DOCKERFILE"

Language/cpp/g++12.2.0/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM ghcr.io/labring-actions/devbox/debian-ssh-12.6:501781
2+
3+
RUN cd /home/devbox/project && \
4+
rm -rf ./*
5+
6+
COPY /Language/cpp/project /home/devbox/project
7+
8+
RUN apt-get update && \
9+
apt-get install -y gcc g++ make && \
10+
apt-get clean && \
11+
rm -rf /var/lib/apt/lists/*
12+
13+
RUN mkdir /root/.devbox
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"recommendations": [
3+
"pomdtr.excalidraw-editor",
4+
"editorconfig.editorconfig",
5+
"lokalise.i18n-ally",
6+
"ms-vscode.cpptools",
7+
"ms-vscode.cpptools-extension-pack",
8+
"ms-vscode.cpptools-themes",
9+
"formulahendry.code-runner"
10+
]
11+
}

Language/cpp/project/entrypoint.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
g++ hello.cpp -o hello_cpp
3+
./hello_cpp

Language/cpp/project/hello.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include <iostream>
2+
3+
int main() {
4+
std::cout << "Hello, World!" << std::endl;
5+
return 0;
6+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
DOCKERFILE=$1
4+
echo "DOCKERFILE: $DOCKERFILE"
5+
TMP_DOCKERFILE="${DOCKERFILE}tmp"
6+
cp $DOCKERFILE $TMP_DOCKERFILE
7+
8+
# 修正sed命令
9+
sed -i '$i\
10+
COPY /OS/debian-ssh/debian.sources /etc/apt/sources.list.d/debian.sources' "$TMP_DOCKERFILE"

0 commit comments

Comments
 (0)