如何在centos6.6 docker 容器中安装最新版本的make
How to install latest version of make in centos6.6 docker container
我想在 docker centos6.6 容器中安装 3.82 或更新版本的 make
[root@046f4766b93f build]# make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for x86_64-redhat-linux-gnu
谁能告诉我如何在我的 docker centos6.6 容器中使用 yum 安装最新的 make 版本?
[root@046f4766b93f build]# yum install make
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.unifiedlayer.com
* extras: centos.mirrors.hoobly.com
* updates: mirrors.kernel.org
Package 1:make-3.81-23.el6.x86_64 already installed and latest version
Nothing to do
您可以按照 this page 中列出的步骤进行操作。不过,它使用位于 Russian Fedora Fixes
存储库中的为 CentOS 6
制作的 RPM,因此请注意这一点。
我这样试过,效果很好:
# docker run --rm -it centos:6.6 bash
[root@1857c0d2c37b /]# yum -y update
[root@1857c0d2c37b /]# curl http://mirror.yandex.ru/fedora/russianfedora/russianfedora/fixes/el/releases/6/Everything/i386/os/russianfedora-fixes-release-6-2.R.noarch.rpm > russianfedora-fixes-release-6-2.R.noarch.rpm
[root@1857c0d2c37b /]# rpm -Uvh russianfedora-fixes-release-6-2.R.noarch.rpm
[root@1857c0d2c37b /]# yum install -y make
之后make
的版本是3.82:
[root@1857c0d2c37b /]# make --version
GNU Make 3.82
Built for x86_64-redhat-linux-gnu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
如果你想把它放在容器中,只需将命令放入 Dockerfile
中,如下所示:
FROM centos:6.6
WORKDIR /root
RUN yum -y update && yum clean all; \
curl http://mirror.yandex.ru/fedora/russianfedora/russianfedora/fixes/el/releases/6/Everything/i386/os/russianfedora-fixes-release-6-2.R.noarch.rpm > russianfedora-fixes-release-6-2.R.noarch.rpm && \
rpm -Uvh russianfedora-fixes-release-6-2.R.noarch.rpm && \
yum install -y make
CMD bash
然后构建并 运行 您的图像。
通过 rpmfind.net
查找包显示 make 3.82
从 CentOS 7
开始可用。我也试过安装那个,但是有太多未满足的依赖项。
我想在 docker centos6.6 容器中安装 3.82 或更新版本的 make
[root@046f4766b93f build]# make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for x86_64-redhat-linux-gnu
谁能告诉我如何在我的 docker centos6.6 容器中使用 yum 安装最新的 make 版本?
[root@046f4766b93f build]# yum install make
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.unifiedlayer.com
* extras: centos.mirrors.hoobly.com
* updates: mirrors.kernel.org
Package 1:make-3.81-23.el6.x86_64 already installed and latest version
Nothing to do
您可以按照 this page 中列出的步骤进行操作。不过,它使用位于 Russian Fedora Fixes
存储库中的为 CentOS 6
制作的 RPM,因此请注意这一点。
我这样试过,效果很好:
# docker run --rm -it centos:6.6 bash
[root@1857c0d2c37b /]# yum -y update
[root@1857c0d2c37b /]# curl http://mirror.yandex.ru/fedora/russianfedora/russianfedora/fixes/el/releases/6/Everything/i386/os/russianfedora-fixes-release-6-2.R.noarch.rpm > russianfedora-fixes-release-6-2.R.noarch.rpm
[root@1857c0d2c37b /]# rpm -Uvh russianfedora-fixes-release-6-2.R.noarch.rpm
[root@1857c0d2c37b /]# yum install -y make
之后make
的版本是3.82:
[root@1857c0d2c37b /]# make --version
GNU Make 3.82
Built for x86_64-redhat-linux-gnu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
如果你想把它放在容器中,只需将命令放入 Dockerfile
中,如下所示:
FROM centos:6.6
WORKDIR /root
RUN yum -y update && yum clean all; \
curl http://mirror.yandex.ru/fedora/russianfedora/russianfedora/fixes/el/releases/6/Everything/i386/os/russianfedora-fixes-release-6-2.R.noarch.rpm > russianfedora-fixes-release-6-2.R.noarch.rpm && \
rpm -Uvh russianfedora-fixes-release-6-2.R.noarch.rpm && \
yum install -y make
CMD bash
然后构建并 运行 您的图像。
通过 rpmfind.net
查找包显示 make 3.82
从 CentOS 7
开始可用。我也试过安装那个,但是有太多未满足的依赖项。