Last active
May 12, 2016 08:17
-
-
Save wrouesnel/f8f295f1e785cee2e31e4ac74cdfa396 to your computer and use it in GitHub Desktop.
Centos7 and naked docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Match] | |
Name=en* | |
[Network] | |
DHCP=yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
docker build --build-arg=http_proxy=http://172.17.0.1:3128 \ | |
--build-arg=https_proxy=http://172.17.0.1:3128 -t zbi/centos7 dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[dockerrepo] | |
name=Docker Repository | |
baseurl=https://yum.dockerproject.org/repo/main/centos/7/ | |
enabled=1 | |
gpgcheck=1 | |
gpgkey=https://yum.dockerproject.org/gpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Docker Application Container Engine | |
Documentation=https://docs.docker.com | |
After=network.target docker.socket | |
Requires=docker.socket | |
[Service] | |
Type=notify | |
EnvironmentFile=-/etc/default/docker | |
ExecStart=/usr/bin/docker daemon -H fd:// -H tcp://0.0.0.0:2375 \ | |
--storage-driver overlay \ | |
--cluster-store etcd://localhost:2379 \ | |
--log-driver journald | |
MountFlags=slave | |
LimitNOFILE=1048576 | |
LimitNPROC=1048576 | |
LimitCORE=infinity | |
[Install] | |
WantedBy=multi-user.target | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM centos:7 | |
RUN echo 'filesystems+="ext4"' > /etc/dracut.conf.d/supported_filesystems.conf | |
RUN yum update -y && \ | |
yum install -y kernel ca-certificates \ | |
systemd-networkd systemd-resolved | |
RUN update-ca-trust | |
# Provision the basic image | |
COPY docker.repo /etc/yum.repos.d/docker.repo | |
RUN yum install -y docker-engine | |
COPY docker.service /etc/systemd/system/docker.service | |
RUN ln -sf /etc/systemd/system/docker.service \ | |
/etc/systemd/system/multi-user.target.wants/docker.service | |
RUN ln -sf /lib/systemd/system/systemd-networkd.service /etc/systemd/system/multi-user.target.wants/systemd-networkd.service ; \ | |
ln -sf /lib/systemd/system/systemd-resolved.service /etc/systemd/system/multi-user.target.wants/systemd-resolved.service | |
COPY all.network /etc/systemd/network/all.network | |
# Debian/Ubuntu add these by default, RedHat do not. | |
RUN ln -sf /boot/$(ls /boot | grep vmlinuz) /vmlinuz && \ | |
ln -sf /boot/$(ls /boot | grep initramfs) /initrd.img | |
RUN echo "root:guest" | chpasswd | |
# Enforce SELinux relabelling on first boot | |
RUN touch /.autorelabel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment