Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new Dockerfile that can be use to build any Centos 7.x docker … #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions images/centos7.x/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ARG BASE_IMAGE=centos:7.8.2003
FROM ${BASE_IMAGE}
ENV container docker

# Delete a number of unit files which might cause issues.
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \
systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /etc/systemd/system/*.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*;

# Install useful things that are missing from the centos:7.4.1708 image.
RUN yum install -y initscripts \
openssh-clients \
openssh-server \
rsyslog \
sudo \
wget \
which && \
yum clean all

# Add pre-created SSH keys into .ssh folder.
ADD ssh /root/.ssh/

# Copy public key into authorized_keys and limit access to the private key to ensure SSH can use it.
RUN cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \
chmod 600 /root/.ssh/id_rsa

# The official CentOS Docker images retain the inclusion of the 20-nproc.conf file that only applies on a real machine.
# This file overrides reasonable defaults for things like the maximum number of user processes when running commands
# as a non-root user. Get rid of it (and see tinyurl.com/zqdfzpg).
RUN rm /etc/security/limits.d/20-nproc.conf

# Disable strict host key checking to /dev/null to make SSH between containers less of a pain.
RUN sed -i -r "s|^Host \*\s*|&\n StrictHostKeyChecking no|" /etc/ssh/ssh_config

CMD ["/usr/sbin/init"]
5 changes: 5 additions & 0 deletions images/centos7.x/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
To build a centos 7.x image, use the folowing command.

docker build . -t clusterdock/topology_nodebase:centos7.8 --build-arg BASE_IMAGE=centos7.8.2003

The build-arg BASE_IMAGE can take any valid centos 7.x tags from the official centos repo on docker hub.
27 changes: 27 additions & 0 deletions images/centos7.x/ssh/id_rsa
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAtj/yZZNF+bv26eqWqsx+vFehSlxBJp/QhIrFWKpjHcpQJ29o
6hJN9moU3Goft2C5w6FoZdjC1TWlzhxUnRS8xeksFnW3ItvkjySLA1Iq6jchYxNd
fZ3HwTdH0rubM1uJ/CnkaijoxBqGBmPSL0TxfqcteaJ8APhslwl0WWJ6b+tBCHDV
pTLATebtggCAfhKmSuAYmn3QIqJ7DFoSGkwhkxpUHuuVCZxUH3CIxLIw+6npArr/
S5gtFo50oi6FXPmvv6mJg6yLqq3VlKcQh6d/COaJopHn+nLed2kECESUlpTruMpr
6IcGESgz4hnkmhop8oTY42sQJhPPF2Ahq9a3aQIDAQABAoIBADSbxPb5SkvKrH3d
j9yB51uq2A5FDzF9FI4OGOV9WdsxmW2oxVo8KnElMhxmLf2bWERWhXJQ3fz53YDf
wLUPVWaz5lwdYt4XJ6UCYXZ185lkjKiy4FvwfccSlBMKwMRUekJmPV8/q+Ff3qxd
i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MLwNbTJ6zA6ohny7r+AiOqNGlP9vBFMhpGs3NFg==
-----END RSA PRIVATE KEY-----
1 change: 1 addition & 0 deletions images/centos7.x/ssh/id_rsa.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC2P/Jlk0X5u/bp6paqzH68V6FKXEEmn9CEisVYqmMdylAnb2jqEk32ahTcah+3YLnDoWhl2MLVNaXOHFSdFLzF6SwWdbci2+SPJIsDUirqNyFjE119ncfBN0fSu5szW4n8KeRqKOjEGoYGY9IvRPF+py15onwA+GyXCXRZYnpv60EIcNWlMsBN5u2CAIB+EqZK4BiafdAionsMWhIaTCGTGlQe65UJnFQfcIjEsjD7qekCuv9LmC0WjnSiLoVc+a+/qYmDrIuqrdWUpxCHp38I5omikef6ct53aQQIRJSWlOu4ymvohwYRKDPiGeSaGinyhNjjaxAmE88XYCGr1rdp clusterdock