From fa1b113cc8ae88e1df5e453bfff79e697f32f646 Mon Sep 17 00:00:00 2001 From: Ev Kontsevoy Date: Thu, 23 Feb 2017 16:58:55 -0800 Subject: [PATCH] Minor dockerile/make changes --- docker/.screenrc | 2 ++ docker/Dockerfile | 3 ++- docker/Makefile | 12 ++++++------ docker/README.md | 9 +++++++-- 4 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 docker/.screenrc diff --git a/docker/.screenrc b/docker/.screenrc new file mode 100644 index 00000000000..8d1c73e95fd --- /dev/null +++ b/docker/.screenrc @@ -0,0 +1,2 @@ +# forcefully make bash the default shell +defshell -bash diff --git a/docker/Dockerfile b/docker/Dockerfile index 18c21f280f8..f76b212f535 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -4,7 +4,7 @@ FROM teleport-buildbox:latest # DEBUG=1 is needed for the Web UI to be loaded from static assets instead # of the binary -ENV DEBUG=1 GOPATH=/root/go +ENV DEBUG=1 GOPATH=/root/go PATH=$PATH:/root/go/src/github.com/gravitational/teleport/build # htop is useful for testing terminal resizing RUN apt-get install -y htop screen; \ @@ -12,6 +12,7 @@ RUN apt-get install -y htop screen; \ VOLUME ["/teleport", "/var/lib/teleport"] COPY .bashrc /root/.bashrc +COPY .screenrc /root/.screenrc # expose only proxy ports (SSH and HTTPS) EXPOSE 3023 3080 diff --git a/docker/Makefile b/docker/Makefile index 332a7f84480..415a43030d4 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -68,10 +68,10 @@ enter-two: .PHONY:shell shell: docker build -t $(TELEBOX) . - docker network create --subnet=172.10.0.0/16 $(NETNAME) - docker run --name=teleport-shell --rm=true -ti \ - --hostname two-node \ - --ip 172.10.1.4 \ - --volume $(THISDIR)/data/two/node:/var/lib/teleport \ + -docker network create --subnet=172.10.0.0/16 $(NETNAME) + -docker run --name=one --rm=true -ti \ + --hostname one \ + --ip 172.10.1.1 \ + --volume $(THISDIR)/data/one:/var/lib/teleport \ $(DOCKEROPS) $(TELEBOX) /bin/bash - -@docker network rm $(NETNAME) + -docker network rm $(NETNAME) diff --git a/docker/README.md b/docker/README.md index ff2d78e2fb5..97d94529784 100644 --- a/docker/README.md +++ b/docker/README.md @@ -80,11 +80,16 @@ the YAML file to `tctl` via `-c` flag. Also you can start an empty container from which you can manually invoke `teleport start`. This is similar to launching an empty Linux VM with a Teleport binary. -Do: +To get shell inside the same "one" (single-node cluster) container without +Teleport running: ```bash $ make shell ``` -if you get "network already exists" error, do `make stop` first. +NOTE: If you get "network already exists" error, do `make stop` first. + +Once inside, you'll get the same `/var/lib/teleport` as "one", so you +can start (and even build) `teleport` daemon manually. This container also +comes with a fully configured `screen` so you can treat it as a real VM.