Skip to content

Commit

Permalink
Merge pull request #110 from CiscoCloud/testing/docker-samples
Browse files Browse the repository at this point in the history
Make all samples work in Docker container
  • Loading branch information
langston-barrett committed Oct 28, 2015
2 parents a4e2972 + c84a65a commit 1a57d72
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 123 deletions.
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gliderlabs/alpine:3.2
FROM ubuntu:wily
MAINTAINER Langston Barrett <[email protected]> (@siddharthist)

# If this file doesn't immedately work for you, please submit a Github issue:
Expand All @@ -10,7 +10,10 @@ MAINTAINER Langston Barrett <[email protected]> (@siddharthist)
# Note that Distributive doesn't have access to certain system information when
# run in a container.

RUN apk update && apk add bash go git php-cli && rm -rf /var/cache/apk/*
RUN apt-get update
# network: net-tools
# misc: lm-sensors, php5-cli
RUN apt-get install -y bash golang git php5-cli lm-sensors net-tools && apt-get clean

WORKDIR /gopath/src/github.com/CiscoCloud/distributive
RUN mkdir -p /gopath/{bin,src}
Expand All @@ -19,11 +22,12 @@ ENV GOBIN /gopath/bin
ENV PATH $PATH:/gopath/bin
RUN go get github.com/tools/godep
ADD . /gopath/src/github.com/CiscoCloud/distributive
# Note: docker-machine on Windows / OS X sometimes gets its time out of sync, which can cause SSL verification failures.
# If this happens, `go get .`, will fail. If you run into this problem, run this command at your terminal:
# Note: docker-machine on Windows / OS X sometimes gets its time out of sync,
# which can cause SSL verification failures. If this happens, `go get .`, will
# fail. If you run into this problem, run this command at your terminal:
# docker-machine ssh ${machine} 'sudo ntpclient -s -h pool.ntp.org'
# After that, you can retry `docker build .`.
RUN go get .
RUN go build .

CMD ["distributive", "-f", "/gopath/src/github.com/CiscoCloud/distributive/samples/filesystem.json", "-d", "", "--verbosity", "info"]
CMD ["distributive", "-d", "/gopath/src/github.com/CiscoCloud/distributive/samples/", "--verbosity", "info"]
17 changes: 2 additions & 15 deletions samples/misc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,9 @@
"Name": "Miscellaneous system checks",
"Checklist" : [
{
"Name": "CPU temperature threshold",
"ID": "temp",
"Parameters": ["80"]
},
{
"Name": "/sbin/init check",
"Name": "shell running check",
"ID" : "running",
"Parameters": ["/sbin/init"]
},
{
"ID" : "module",
"Parameters" : ["ext4"]
},
{
"ID" : "kernelParameter",
"Parameters" : ["kernel.ctrl-alt-del"]
"Parameters": ["ps"]
},
{
"ID" : "phpConfig",
Expand Down
60 changes: 8 additions & 52 deletions samples/network.json
Original file line number Diff line number Diff line change
@@ -1,81 +1,37 @@
{
"Name": "Network checks",
"Checklist" : [
{
"ID": "port",
"Parameters": ["80"]
},
{
"ID": "portTCP",
"Parameters": ["80"]
},
{
"ID": "portUDP",
"Parameters": ["80"]
},
{
"ID" : "interfaceExists",
"Parameters" : ["docker0"]
},
{
"ID" : "interfaceExists",
"Parameters" : ["wlp1s0"]
},
{
"ID" : "interfaceExists",
"Parameters" : ["lo"]
"Parameters" : ["eth0"]
},
{
"ID" : "up",
"Parameters": ["wlp1s0"]
},
{
"ID" : "ip4",
"Parameters" : ["wlp1s0", "10.60.91.12"]
},
{
"ID" : "ip6",
"Parameters" : ["wlp1s0", "fe80::59bf:babe:f7bb:a327"]
},
{
"ID" : "gateway",
"Parameters" : ["192.168.0.1"]
},
{
"ID" : "gatewayInterface",
"Parameters" : ["wlp1s0"]
"Parameters": ["eth0"]
},
{
"ID" : "gatewayInterface",
"Parameters" : ["docker0"]
"Parameters" : ["eth0"]
},
{
"ID" : "host",
"Parameters" : ["google.com"]
"Parameters" : ["github.com"]
},
{
"ID" : "TCP",
"Parameters" : ["google.com:80"]
"Parameters" : ["github.com:80"]
},
{
"ID" : "UDP",
"Parameters" : ["google.com:80"]
"Parameters" : ["github.com:80"]
},
{
"ID" : "UDP",
"Parameters" : ["yahoo.com:80"]
},
{
"ID" : "routingTableDestination",
"Parameters" : ["192.168.0.0"]
"Parameters" : ["github.com:80"]
},
{
"ID" : "routingTableInterface",
"Parameters" : ["docker0"]
},
{
"ID" : "routingTableGateway",
"Parameters" : ["192.168.0.1"]
"Parameters" : ["eth0"]
},
{
"ID" : "tcpTimeout",
Expand Down
14 changes: 1 addition & 13 deletions samples/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,7 @@
"Checklist" : [
{
"ID" : "installed",
"Parameters" : ["urxvt"]
},
{
"ID" : "repoExistsUri",
"Parameters" : ["rpm", "http://apt.sw.be/fedora/$releasever/en/$basearch/dag/"]
},
{
"ID" : "repoexists",
"Parameters" : ["rpm", "core"]
},
{
"ID" : "pacmanIgnore",
"Parameters" : ["pulseaudio"]
"Parameters" : ["git"]
}
]
}
25 changes: 0 additions & 25 deletions samples/systemctl.json

This file was deleted.

14 changes: 1 addition & 13 deletions samples/users-and-groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
"Checklist" : [
{
"ID" : "groupExists",
"Parameters" : ["wheel"]
},
{
"ID" : "userInGroup",
"Parameters" : ["root", "wheel"]
"Parameters" : ["sudo"]
},
{
"ID" : "groupExists",
Expand All @@ -25,17 +21,9 @@
"ID" : "userHasUID",
"Parameters" : ["root", "0"]
},
{
"ID" : "userHasGID",
"Parameters" : ["lb", "100"]
},
{
"ID" : "UserHasHomeDir",
"Parameters" : ["root", "/root"]
},
{
"ID" : "UserHasHomeDir",
"Parameters" : ["lb", "/home/lb"]
}
]
}

0 comments on commit 1a57d72

Please sign in to comment.