一、添加docker加速镜像源:
https://www.cnblogs.com/hackyo/p/9613465.html
二、编写dockerfile
shell> cd /opt
shell> mkdir centos
shell> cd centos
shell> touch Dockerfile
填写以下内容
FROM centos:centos7
RUN yum -y install gcc gcc-c++ kernel-devel libgfortran&&\yum clean all && rm -rf /var/cache/yum \
三、执行dockerfile
shell> docker build -t centos-gcc:v1 ./