Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
certificates
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
smallstep
certificates
Commits
74b7a54f
Commit
74b7a54f
authored
6 years ago
by
Mariano Cano
Browse files
Options
Downloads
Patches
Plain Diff
Use docker-composer up/down
parent
d4e9812a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/README.md
+35
-14
35 additions, 14 deletions
examples/README.md
examples/docker/Makefile
+7
-1
7 additions, 1 deletion
examples/docker/Makefile
with
42 additions
and
15 deletions
examples/README.md
+
35
−
14
View file @
74b7a54f
...
...
@@ -335,13 +335,33 @@ This example creates 3 different docker images:
To run this test you need to have docker daemon running. With docker running
swith to the
`examples/docker directory`
and just run
`make`
```
sh
```
certificates $ cd examples/docker/
docker $ make
GOOS=linux go build -o ca/step-ca github.com/smallstep/certificates/cmd/step-ca
GOOS=linux go build -o renewer/step github.com/smallstep/cli/cmd/step
docker build -t nginx-test:latest nginx
...
docker-compose up
WARNING: The Docker Engine you're using is running in swarm mode.
Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node.
To deploy your application across the swarm, use `docker stack deploy`.
Creating network "docker_default" with the default driver
Creating docker_ca_1 ... done
Creating docker_renewer_1 ... done
Creating docker_nginx_1 ... done
Attaching to docker_ca_1, docker_renewer_1, docker_nginx_1
ca_1 | 2018/11/12 19:39:16 Serving HTTPS on :443 ...
nginx_1 | Setting up watches.
nginx_1 | Watches established.
...
```
Make will build the binaries for step and step-ca, create the images,
and deploy
them using docker composer.
Make will build the binaries for step and step-ca, create the images,
create the
containers and start
them using docker composer.
NGINX will be listening on your local machine on https://localhost:4443, but to
make sure the cert is right we need to add the following entry to
`/etc/hosts`
:
...
...
@@ -385,7 +405,7 @@ Now you can use `make inspect` to inspect the certificate to see how the
certificate gets updated every minute:
```
sh
docker
$
make inspect
docker
$
make inspect
|
head
step certificate inspect https://localhost:4443
--insecure
Certificate:
Data:
...
...
@@ -396,7 +416,7 @@ Certificate:
Validity
Not Before: Nov 10 02:13:00 2018 UTC
Not After : Nov 11 02:13:00 2018 UTC
mariano@endor docker
(
docker-nginx
)
*
$
make inspect |
head
docker
$
make inspect |
head
step certificate inspect https://localhost:4443
--insecure
Certificate:
Data:
...
...
@@ -409,15 +429,16 @@ Certificate:
Not After : Nov 11 02:14:00 2018 UTC
```
Finally, to remove the containers and volumes you can use
`make
clea
n`
:
Finally, to remove the containers and volumes you can use
`make
dow
n`
:
```
sh
docker
$
make clean
docker service
rm
steplab_ca steplab_nginx steplab_renewer
steplab_ca
steplab_nginx
steplab_renewer
sleep
20
docker volume
rm
-f
steplab_certificates
steplab_certificates
docker
$
make down
docker-compose down
Stopping docker_nginx_1 ...
done
Stopping docker_renewer_1 ...
done
Stopping docker_ca_1 ...
done
Removing docker_nginx_1 ...
done
Removing docker_renewer_1 ...
done
Removing docker_ca_1 ...
done
Removing network docker_default
```
This diff is collapsed.
Click to expand it.
examples/docker/Makefile
+
7
−
1
View file @
74b7a54f
all
:
binaries build
deploy
all
:
binaries build
up
binaries
:
GOOS
=
linux go build
-o
ca/step-ca github.com/smallstep/certificates/cmd/step-ca
...
...
@@ -13,6 +13,12 @@ build-ca:
build-renewer
:
docker build
-t
step-renewer-test:latest renewer
up
:
docker-compose up
down
:
docker-compose down
deploy
:
docker stack deploy
-c
docker-compose.yml steplab
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment