Skip to content

Commit d391407

Browse files
authored
Create README.md
1 parent 359ee56 commit d391407

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

gcc/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# GCC
2+
3+
The GNU Compiler Collection is a compiling system that supports several languages.
4+
5+
This image is based on https://github.com/docker-library/gcc
6+
7+
### Compiling your app inside of a container
8+
9+
To compile, but not run your app inside the Docker instance, you can write something like:
10+
11+
```
12+
docker run -it --rm \
13+
--mount type=bind,source="$(pwd)",target=/usr/src/myapp \
14+
--workdir /usr/src/myapp \
15+
docker.io/boxcutter/gcc:13 -std=c++17 -O2 myapp.c -o myapp -Wall
16+
```
17+
18+
### Create a Containerfile in your app project
19+
20+
```
21+
FROM docker.io/boxcutter/gcc:13
22+
23+
WORKDIR /usr/src/myapp
24+
25+
COPY . .
26+
RUN gcc -o myapp main.c
27+
28+
CMD ["./myapp"]
29+
```

0 commit comments

Comments
 (0)