
Maintained by:
https://github.com/docker-library/gcc
Where to get help:
the Docker Community Slack, Server Fault, Unix & Linux, or Stack Overflow
Dockerfile linkshttps://github.com/docker-library/gcc/blob/915af5ccbb6b09575e244f280c26925e77172039/15/Dockerfile
https://github.com/docker-library/gcc/blob/280306a58a2ff0c21a95ed8abe882ac483d03c8b/14/Dockerfile
https://github.com/docker-library/gcc/blob/118c07a8e6467baababb4634b6cfde14a67c24b0/13/Dockerfile
https://github.com/docker-library/gcc/blob/7070981b23d22d3ca790f87bff26f13f3614dd4c/12/Dockerfile
Where to file issues:
https://github.com/docker-library/gcc/issues?q=
Supported architectures: (https://github.com/docker-library/official-images#architectures-other-than-amd64)
https://hub.docker.com/r/amd64/gcc/, https://hub.docker.com/r/arm32v5/gcc/, https://hub.docker.com/r/arm32v7/gcc/, https://hub.docker.com/r/arm64v8/gcc/, https://hub.docker.com/r/ppc64le/gcc/, https://hub.docker.com/r/s390x/gcc/
Published image artifact details:
https://github.com/docker-library/repo-info/blob/master/repos/gcc (https://github.com/docker-library/repo-info/commits/master/repos/gcc)
(image metadata, transfer size, etc)
Image updates:
https://github.com/docker-library/official-images/issues?q=label%3Alibrary%2Fgcc
https://github.com/docker-library/official-images/blob/master/library/gcc (https://github.com/docker-library/official-images/commits/master/library/gcc)
Source of this description:
https://github.com/docker-library/docs/tree/master/gcc (https://github.com/docker-library/docs/commits/master/gcc)
The GNU Compiler Collection (GCC) is a compiler system produced by the GNU Project that supports various programming languages. GCC is a key component of the GNU toolchain. The Free Software Foundation (FSF) distributes GCC under the GNU General Public License (GNU GPL). GCC has played an important role in the growth of free software, as both a tool and an example.
***.org/wiki/GNU_Compiler_Collection
!https://raw.githubusercontent.com/docker-library/docs/60b29a700d22613526487c7d5fcf4d723ed2ef0a/gcc/logo.png
The most straightforward way to use this image is to use a gcc container as both the build and runtime environment. In your Dockerfile, writing something along the lines of the following will compile and run your project:
dockerfileFROM gcc:4.9 COPY . /usr/src/myapp WORKDIR /usr/src/myapp RUN gcc -o myapp main.c CMD ["./myapp"]
Then, build and run the Docker image:
console$ docker build -t my-gcc-app . $ docker run -it --rm --name my-running-app my-gcc-app
There may be occasions where it is not appropriate to run your app inside a container. To compile, but not run your app inside the Docker instance, you can write something like:
console$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp gcc:4.9 gcc -o myapp myapp.c
This will add your current directory, as a volume, to the container, set the working directory to the volume, and run the command gcc -o myapp myapp.c. This tells gcc to compile the code in myapp.c and output the executable to myapp. Alternatively, if you have a Makefile, you can instead run the make command inside your container:
console$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp gcc:4.9 make
View license information for the software contained in this image.
As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).
Some additional license information which was able to be auto-detected might be found in https://github.com/docker-library/repo-info/tree/master/repos/gcc.
As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务