-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added linux support for NetworkManager/dnsmasq and libnss-resolver to the DNS command * Added some Linux distros for testing * go fmt * Refactored to split network routing and dns resoution config * go fmt * removed soem extra log messages * consolidated bip discovery
- Loading branch information
Showing
7 changed files
with
227 additions
and
47 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM centos:latest | ||
|
||
RUN yum install -y yum-utils \ | ||
device-mapper-persistent-data \ | ||
lvm2 | ||
RUN yum-config-manager \ | ||
--add-repo \ | ||
https://download.docker.com/linux/centos/docker-ce.repo | ||
RUN yum install -y docker-ce | ||
|
||
# Add services to test dns resolution | ||
RUN yum -y install sudo NetworkManager dnsmasq | ||
|
||
# To use run: `docker run --privileged -it --name dind -d docker:dind` to start a docker server | ||
# Then add `--link dind:docker` to the run of this container to connect to it | ||
ENV DOCKER_HOST tcp://docker:2375 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM fedora:latest | ||
|
||
RUN dnf -y install dnf-plugins-core | ||
RUN dnf config-manager \ | ||
--add-repo \ | ||
https://download.docker.com/linux/fedora/docker-ce.repo | ||
RUN dnf -y install docker-ce | ||
|
||
# Add services to test dns resolution | ||
RUN dnf -y install sudo NetworkManager dnsmasq | ||
RUN rpm -i https://github.com/azukiapp/libnss-resolver/releases/download/v0.3.0/fedora23-libnss-resolver-0.3.0-1.x86_64.rpm | ||
|
||
|
||
# To use run: `docker run --privileged -it --name dind -d docker:dind` to start a docker server | ||
# Then add `--link dind:docker` to the run of this container to connect to it | ||
ENV DOCKER_HOST tcp://docker:2375 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM ubuntu:latest | ||
|
||
RUN apt-get update | ||
RUN apt-get -y install \ | ||
apt-transport-https \ | ||
ca-certificates \ | ||
curl \ | ||
software-properties-common | ||
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - | ||
RUN apt-key fingerprint 0EBFCD88 | ||
RUN add-apt-repository \ | ||
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | ||
$(lsb_release -cs) \ | ||
stable" | ||
RUN apt-get update | ||
RUN apt-get -y install docker-ce | ||
|
||
# Add services to test dns resolution | ||
RUN apt-get -y install sudo network-manager dnsmasq | ||
RUN curl -o /tmp/libnss-resolver.deb -L https://github.com/azukiapp/libnss-resolver/releases/download/v0.3.0/ubuntu16-libnss-resolver_0.3.0_amd64.deb \ | ||
&& dpkg -i /tmp/libnss-resolver.deb | ||
|
||
# To use run: `docker run --privileged -it --name dind -d docker:dind` to start a docker server | ||
# Then add `--link dind:docker` to the run of this container to connect to it | ||
ENV DOCKER_HOST tcp://docker:2375 | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Linux Images for testing | ||
|
||
The Dockerfiles in this directory are used for testing certain Linux commands. Some things don't work perfect, such as | ||
restarting systemd services (there is no systemd in the container) or connecting dnsdock to the Docker Bridge IP, but | ||
other code that checks for platform, etc. should run fine. | ||
|
||
The way you use them is as follows. | ||
|
||
## Build the Linux images | ||
|
||
* For each Dockerfile, build the image | ||
* `docker build -t test-fedora -f Dockerfile.fedora .` | ||
* `docker build -t test-ubuntu -f Dockerfile.ubuntu .` | ||
* `docker build -t test-centos -f Dockerfile.centos .` | ||
|
||
|
||
## Build rig for Linux | ||
|
||
* `GOARCH=amd64 GOOS=linux go build -o build/linux/rig cmd/main.go` | ||
|
||
|
||
## Run the images (and Docker in Docker) | ||
|
||
* Start Docker in Docker | ||
* `docker run --privileged -it --name dind -d docker:dind` | ||
* Start the container for the distro you want, mounting a linux targeted `rig` into it and linking it to the Docker in Docker image. | ||
* `docker run -it -v $PWD/build/linux/rig:/usr/bin/rig --link dind:docker test-centos bash` | ||
* You are now at a shell in the Linux container with `rig` in `/usr/bin/rig` |
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