Skip to content

Commit

Permalink
Update dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosnils committed Nov 4, 2018
1 parent 9d44ff7 commit b938e64
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 11 deletions.
27 changes: 20 additions & 7 deletions dockerfiles/dind/Dockerfile.dind-ee
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
ARG VERSION=franela/docker:18.01-dind-ubuntu
ARG VERSION=franela/docker:18.09-ee-dind
#ARG VERSION=franela/docker:17.06.2-dind-ubuntu
#ARG VERSION=franela/docker:18.01-dind-ubuntu

FROM ${VERSION}

RUN apt-get update \
&& apt-get install -y git tmux apache2-utils vim curl jq bash-completion tree zip \
&& apt-get install -y git tmux python-pip apache2-utils vim curl jq bash-completion tree zip \
&& rm -rf /var/lib/apt/lists/*

# Add kubectl client
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.8.6/bin/linux/amd64/kubectl \
&& chmod +x ./kubectl \
&& mv ./kubectl /usr/local/bin/kubectl

ENV COMPOSE_VERSION=1.22.0

RUN pip install docker-compose==${COMPOSE_VERSION}
RUN curl -L https://github.com/docker/machine/releases/download/${MACHINE_VERSION}/docker-machine-Linux-x86_64 \
-o /usr/bin/docker-machine && chmod +x /usr/bin/docker-machine


# Install a nice vimrc file and prompt (by soulshake)
COPY ["docker-prompt", "sudo", "ucp-beta.sh", "/usr/local/bin/"]
COPY [".vimrc",".profile", ".inputrc", ".gitconfig", "workshop_beta.lic", "./root/"]
COPY ["motd", "/etc/motd"]
COPY ["ee/daemon.json", "/etc/docker/"]
COPY ["ee/cert.pem", "/opt/pwd/certs/"]
COPY ["ee/key.pem", "/opt/pwd/certs/"]
COPY ["ee/config.json", "/root/.docker/"]
COPY ["ee/cert.pem", "ee/key.pem", "/opt/pwd/certs/"]
COPY ["ee/ucp-key.pem", "./root/key.pem"]
COPY ["ee/ucp-cert.pem", "./root/cert.pem"]

# Move to our home
WORKDIR /root

# Setup certs and uploads folders
RUN mkdir -p /opt/pwd/certs /opt/pwd/uploads /var/lib/kubelet

VOLUME ["/var/lib/kubelet"]

# Remove IPv6 alias for localhost and start docker in the background ...
CMD cat /etc/hosts >/etc/hosts.bak && \
sed 's/^::1.*//' /etc/hosts.bak > /etc/hosts && \
Expand All @@ -35,8 +46,10 @@ CMD cat /etc/hosts >/etc/hosts.bak && \
sed -i "s/\DOCKER_TLSCERT/$DOCKER_TLSCERT/" /etc/docker/daemon.json && \
sed -i "s/\DOCKER_TLSKEY/$DOCKER_TLSKEY/" /etc/docker/daemon.json && \
mount -t securityfs none /sys/kernel/security && \
mount --make-shared -t tmpfs tmpfs /run && \
mount --make-shared -t tmpfs tmpfs /var/lib/kubelet && \
mount --make-rshared / && \
#mount --make-shared -t tmpfs tmpfs /run && \
#mount --make-shared -t tmpfs tmpfs /var/lib/kubelet && \
#mount --make-shared /var/lib/docker && \
dockerd > /docker.log 2>&1 & \
while true ; do script -q -c "/bin/bash -l" /dev/null ; done
# ... and then put a shell in the foreground, restarting it if it exits
9 changes: 6 additions & 3 deletions dockerfiles/dind/ucp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ function wait_for_url {

function deploy_ucp {
wait_for_url "https://localhost:2376"
docker run --rm --name ucp \
docker run --rm -i --name ucp \
-v /var/run/docker.sock:/var/run/docker.sock \
docker/ucp:2.2.3 install --force-insecure-tcp \
docker/ucp:3.0.5 install --debug --force-insecure-tcp \
--san *.direct.${PWD_HOST_FQDN} \
--license $(cat $HOME/workshop.lic) \
--swarm-port 2375 \
--admin-username admin \
--admin-password admin1234

rm $HOME/workshop.lic
echo "Finished deploying UCP"
}

function get_instance_ip {
Expand Down Expand Up @@ -48,7 +51,7 @@ function deploy_dtr {
local dtr_url=$(get_direct_url_from_ip $dtr_ip)
local ucp_url=$(get_direct_url_from_ip $ucp_ip)

docker run --rm docker/dtr install \
docker run -i --rm docker/dtr:2.5.5 install \
--dtr-external-url $dtr_url \
--ucp-node $1 \
--ucp-username admin \
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/dind/workshop.lic
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"key_id":"TLuxNP8EboMqcs360bc81rF6Ex3Wx4N1C8tH1ZTdkgzi","private_key":"K4LcPo3AT8n8sbcVRYiu2bLmyw09Wq36wiXzSk1g82XW","authorization":"ewogICAicGF5bG9hZCI6ICJleUpsZUhCcGNtRjBhVzl1SWpvaU1qQXhPQzB4TUMwd00xUXhOVG93TnpvME0xb2lMQ0owYjJ0bGJpSTZJamRDUVd0Rk5rbFJXVTlKYmtWeVZYWnJUa1EwY0dsYWRrVXhla1ZKZWtrM016VkpYemxYVEZWamEyYzlJaXdpYldGNFJXNW5hVzVsY3lJNk5Dd2ljMk5oYm01cGJtZEZibUZpYkdWa0lqcDBjblZsTENKc2FXTmxibk5sVkhsd1pTSTZJazltWm14cGJtVWlMQ0owYVdWeUlqb2lVSEp2WkhWamRHbHZiaUo5IiwKICAgInNpZ25hdHVyZXMiOiBbCiAgICAgIHsKICAgICAgICAgImhlYWRlciI6IHsKICAgICAgICAgICAgImp3ayI6IHsKICAgICAgICAgICAgICAgImUiOiAiQVFBQiIsCiAgICAgICAgICAgICAgICJrZXlJRCI6ICJKN0xEOjY3VlI6TDVIWjpVN0JBOjJPNEc6NEFMMzpPRjJOOkpIR0I6RUZUSDo1Q1ZROk1GRU86QUVJVCIsCiAgICAgICAgICAgICAgICJraWQiOiAiSjdMRDo2N1ZSOkw1SFo6VTdCQToyTzRHOjRBTDM6T0YyTjpKSEdCOkVGVEg6NUNWUTpNRkVPOkFFSVQiLAogICAgICAgICAgICAgICAia3R5IjogIlJTQSIsCiAgICAgICAgICAgICAgICJuIjogInlkSXktbFU3bzdQY2VZLTQtcy1DUTVPRWdDeUY4Q3hJY1FJV3VLODRwSWlaY2lZNjczMHlDWW53TFNLVGx3LVU2VUNfUVJlV1Jpb01OTkU1RHM1VFlFWGJHRzZvbG0ycWRXYkJ3Y0NnLTJVVUhfT2NCOVd1UDZ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y3JIYjlEVG05eVcyd09FN0kxYVZLYXRKbjZrSGprM1FSWGVNbnRNQnJ6TGlzanBjZnlBYzdGNlc1YnBTSUtXaUQtd2o5QTRlY0FPbFNxc0NBS3lkaWxnR2lqQTNPY1dOZHhvV0NhV1MzaXFvakFBTE1JNHlsOFlpdG50ckVMVFNuUDFFS08wTGFaaTJxVURfU0lBSmFOUlRPTVIzblRqQUNwd1ZwYXAyU3lkOEZwc1pFVllTZFJVLWJVZDJybmN1ZHZfcC1XdFZpYWVsQ3BvTWstdURzWGhud2JyWFB6Y3dkVHVobmg0V2kxMmRTcjRUQ3ZMRktSMklCaklwam1VZWt4MFBTazlKUkNXc2R2bjY0dElCZnV6dVZSRkVkSVBidnBZd2pWOUZZc19VQWJvVE85a2E1OWZmNm1zOThHYXVTbE9sYnkwSWE0TlBxTTRKY2ZvSFUiLAogICAgICAgICAicHJvdGVjdGVkIjogImV5Sm1iM0p0WVhSTVpXNW5kR2dpT2pFM05Dd2labTl5YldGMFZHRnBiQ0k2SW1aUklpd2lkR2x0WlNJNklqSXdNVGd0TURVdE1UWlVNREU2TURNNk1qTmFJbjAiCiAgICAgIH0KICAgXQp9"}
2 changes: 2 additions & 0 deletions dockerfiles/k8s/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ RUN curl -Lf -o /usr/bin/jq https://github.com/stedolan/jq/releases/download/jq-
&& chmod +x /usr/bin/jq /usr/bin/docker-compose


VOLUME ["/var/lib/kubelet"]

COPY ./kube* /etc/systemd/system/
COPY ./wrapkubeadm.sh /usr/local/bin/kubeadm
COPY ./tokens.csv /etc/pki/tokens.csv
Expand Down
1 change: 1 addition & 0 deletions dockerfiles/k8s/daemon.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"experimental": true,
"debug": true,
"log-level": "info",
"storage-driver": "vfs",
"insecure-registries": ["127.0.0.1"],
"hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2375"]
}

0 comments on commit b938e64

Please sign in to comment.