mirror of
https://github.com/gravitational/teleport
synced 2024-10-21 01:34:01 +00:00
Initial commit of working with the regressions
This commit is contained in:
parent
df7df58749
commit
068d4535de
|
@ -4,10 +4,11 @@ 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
|
||||
ENV DEBUG=1 GOPATH=/root/go
|
||||
|
||||
# htop is useful for testing terminal resizing
|
||||
RUN apt-get install -y htop
|
||||
RUN apt-get install -y htop screen; \
|
||||
mkdir -p /root/go/src/github.com/gravitational/teleport
|
||||
|
||||
VOLUME ["/teleport", "/var/lib/teleport"]
|
||||
COPY .bashrc /root/.bashrc
|
||||
|
|
|
@ -1,38 +1,39 @@
|
|||
TELEBOX=teleport:latest
|
||||
HOMEDIR=$(abspath ..)
|
||||
CONTAINERHOME=/root/go/src/github.com/gravitational/teleport
|
||||
THISDIR=`pwd`
|
||||
NETNAME=telenet
|
||||
DOCKEROPS=--detach=true --net $(NETNAME) -w /teleport -v $(HOMEDIR):/teleport
|
||||
DOCKEROPS=--net $(NETNAME) -w $(CONTAINERHOME) -v $(HOMEDIR):$(CONTAINERHOME)
|
||||
|
||||
#
|
||||
# Default target starts two Teleport clusters
|
||||
#
|
||||
.PHONY:run
|
||||
run:
|
||||
run:
|
||||
# create a docker Teleport image and a network
|
||||
docker build -t $(TELEBOX) .
|
||||
docker network create --subnet=172.10.0.0/16 $(NETNAME)
|
||||
mkdir -p data/one data/two/proxy data/two/node data/two/auth
|
||||
# start the single-node cluster named "one"
|
||||
docker run --name=one \
|
||||
docker run --name=one --detach=true \
|
||||
--hostname one \
|
||||
--ip 172.10.1.1 \
|
||||
--publish 3080:3080 -p 3023:3023 \
|
||||
--volume $(THISDIR)/data/one:/var/lib/teleport \
|
||||
$(DOCKEROPS) $(TELEBOX) build/teleport start -c /teleport/docker/one.yaml
|
||||
# start three-node cluster named "two"
|
||||
docker run --name=two-auth \
|
||||
docker run --name=two-auth --detach=true \
|
||||
--hostname two-auth \
|
||||
--ip 172.10.1.2 \
|
||||
--volume $(THISDIR)/data/two/auth:/var/lib/teleport \
|
||||
$(DOCKEROPS) $(TELEBOX) build/teleport start -c /teleport/docker/two-auth.yaml
|
||||
docker run --name=two-proxy \
|
||||
docker run --name=two-proxy --detach=true \
|
||||
--hostname two-proxy \
|
||||
--ip 172.10.1.3 \
|
||||
--publish 5080:5080 -p 5023:5023 \
|
||||
--volume $(THISDIR)/data/two/proxy:/var/lib/teleport \
|
||||
$(DOCKEROPS) $(TELEBOX) build/teleport start -c /teleport/docker/two-proxy.yaml
|
||||
docker run --name=two-node \
|
||||
docker run --name=two-node --detach=true \
|
||||
--hostname two-node \
|
||||
--ip 172.10.1.4 \
|
||||
--volume $(THISDIR)/data/two/node:/var/lib/teleport \
|
||||
|
@ -44,7 +45,7 @@ run:
|
|||
.PHONY:stop
|
||||
stop:
|
||||
-@docker rm -f one two-auth two-proxy two-node
|
||||
-@docker network rm telenet
|
||||
-@docker network rm $(NETNAME)
|
||||
|
||||
# `make enter-one` gives you shell inside auth server
|
||||
# of cluster "one"
|
||||
|
@ -59,3 +60,18 @@ enter-one:
|
|||
.PHONY:enter-two
|
||||
enter-two:
|
||||
docker exec -ti two-auth /bin/bash
|
||||
|
||||
|
||||
# `make shell` drops you into a bash shell inside an empty container,
|
||||
# without Teleport running. Useful if you want to start it manually
|
||||
# from the inside
|
||||
.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 \
|
||||
$(DOCKEROPS) $(TELEBOX) /bin/bash
|
||||
-@docker network rm $(NETNAME)
|
||||
|
|
|
@ -74,3 +74,17 @@ $ make enter-two
|
|||
|
||||
... and then you can use stuff like `tctl users add`, etc. Make sure to pass
|
||||
the YAML file to `tctl` via `-c` flag.
|
||||
|
||||
### Interactive Usage
|
||||
|
||||
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:
|
||||
|
||||
```bash
|
||||
$ make shell
|
||||
```
|
||||
|
||||
if you get "network already exists" error, do `make stop` first.
|
||||
|
||||
|
|
Loading…
Reference in a new issue