#### Date : 2017/07/26 ####
## Create FC23 docker for build some old code.
# Download FC24 Docker base image .
wget http://ftp.cuhk.edu.hk/pub/linux/fedora/releases/24/Docker/x86_64/images/Fedora-Docker-Base-24-1.2.x86_64.tar.xz
# run this image on container .
docker run -it --name buildenv --hostname dockerfc24 fedora-docker-base-24-1.2.x86_64 /bin/bash
# 1. Enable ssh function.
~@ dnf install which passwd openssh-server hostname
~@ ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
~@ ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key
~@ ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key
~@ dnf install net-tools iputils
~@ setcap cap_net_raw+ep /usr/bin/ping
~@ adduser jeff
~@ passwd jeff <PASSWD>
~@ passwd root <PASSWD>
~@ /usr/sbin/sshd
# 2. Save this container to image .
docker container commit -m "Enable SSH " buildenv fedora-docker-base-24-1.2.x86_64:sshd
# 3. Run this container again and launch sshd .
docker container start buildenv
docker container attach --detach-keys ctrl-a buildenv
~@ /usr/sbin/sshd
<ctrl+a> => detach
# 4. Install some build essential tools.
~@ su -c 'dnf install make automake gcc gcc-c++ glibc-locale-source \
libtool m4 automake ibus-libs ibus-devel gettext-common-devel intltool '
//---- for build OCTEON-SDK.
~@ su -c 'dnf install tig perl-Env dtc flex bison bc ncurses-devel file cpio \
bzip2 ccache '
//---- add sudo function.
~@ su -c 'dnf install sudo '
~@ su -c ' sudoedit /etc/sudoers '
//-- add <USER> into /etc/sudoers.
//---- for build OpenWrt(QSDK).
~@ su -c 'dnf install zlib-devel unzip wget subversion ocaml sharutils \
xz ocaml-ocamldoc ocaml-findlib redhat-rpm-config uboot-tools ocaml-camlp4-devel '
~@ su -c 'dnf install ntpdate'
~@ su -c 'rm /etc/localtime ; ln -s /usr/share/zoneinfo/Asia/Taipei /etc/localtime'
//---- vim update and add some color.
~@ su -c ' dnf update vim-minimal '
~@ su -c ' dnf install vim-enhanced '
#################################################
最近 Fedora 更新到 28 了, make & gcc 的版本都很新, 遇到舊的 source code 真的需要 docker container 了 , 不過 Fedora 28 的 docker 和舊的不相同了.
回覆刪除下列網址說明如何安裝 docker-ce 版本.
https://www.itzgeek.com/how-tos/linux/fedora-how-tos/how-to-install-docker-on-fedora-25-fedora-24.html