1. 离线安装docker
## 下载docker.tar.gz,解压安装
tar -zxvf docker.tar.gz
## 配置为系统服务
## 默认配置文件/etc/docker/daemon.json不可编辑时,指定配置文件启动
dockerd --config-file /data/bonc_zj/app/conf/daemon.json &
2. Dockerfile中添加nginx的依赖包
## 具备外网环境时
FROM centos:centos7
MAINTAINER [email protected]
RUN yum install -y telnet iputils gcc gcc-c++ deltarpm autoconf automake --nogpgcheck make libtool openssl openssl-devel pcre pcre-devel zlib zlib-devel vim unzip
## 内网环境
FROM centos:centos7
MAINTAINER [email protected]
ADD ./soft/autoconf/* /soft/
ADD ./soft/automake/* /soft/
ADD ./soft/deltarpm/* /soft/
ADD ./soft/gcc/* /soft/
ADD ./soft/gcc-c++/* /soft/
ADD ./soft/iputils/* /soft/
ADD ./soft/libtool/* /soft/
ADD ./soft/make/* /soft/
ADD ./soft/openssl/* /soft/
ADD ./soft/openssl-devel/* /soft/
ADD ./soft/pcre/* /soft/
ADD ./soft/pcre-devel/* /soft/
ADD ./soft/telnet/* /soft/
ADD ./soft/unzip/* /soft/
ADD ./soft/vim/* /soft/
ADD ./soft/zlib/* /soft/
ADD ./soft/zlib-devel/* /soft/
ADD ./soft/kernel-headers/* /soft/
ADD ./soft/kernel-devel/* /soft/
RUN rpm -ivh /soft/*.rpm --nodeps --force
3.离线安装gcc
## 服务器具备外网环境时,yum在线安装会自动解决依赖关系
yum install -y telnet iputils gcc gcc-c++ deltarpm autoconf automake make libtool openssl openssl-devel pcre pcre-devel zlib zlib-devel vim unzip --nogpgcheck
## 离线安装
#### 在外网环境将相关依赖包下载到指定文件夹
yumdownloader --resolve --destdir=/root/soft/gcc gcc
#### 将依赖包传输到离线服务器上,相关包一起强制安装
rpm -ivh /root/soft/gcc/*.rpm --nodeps --force
#### 离线服务器测试
gcc -v
# Linux下rpm安装GCC(G++)8.5.0
rpm包下载地址
# rpm包下载&网址&wget 方式下载
4.安装nginx报错
## ./configure: error: C compiler cc is not found
yum -y install gcc gcc-c++ autoconf automake make
## 安装Nginx失败./configure: error: can not define uint32_t问题
缺少kernel-headers kernel-devel
标签:gcc,--,soft,devel,外网,ADD,docker,内网,##
From: https://www.cnblogs.com/route/p/17485815.html