Docker Enterprise Edition is....
In order to run the lab, we have provided a Docker Enterprise Edition Play with Docker environment for you to use. This workshop is only available to people in doing a Hands-on-Lab at DockerCon 2018.
When you open it, it'll look something like this
You won't be using the command line for this lab. If you want to explore that more, check out the other labs.
-
Navigate in your web browser to the URL provided to you.
-
Fill out the form, and click
submit
. You will then be redirected to the PWD environment.It may take a few minutes to provision out your PWD environment.
-
From the main PWD screen click the
UCP
button on the left side of the screenNote: Because this is a lab-based install of Docker EE we are using the default self-signed certs. Because of this your browser may display a security warning. It is safe to click through this warning.
In a production environment you would use certs from a trusted certificate authority and would not see this screen.
-
When prompted enter your username and password (these can be found below the console window in the main PWD screen). The UCP web interface should load up in your web browser.
Note: Once the main UCP screen loads you'll notice there is a red warning bar displayed at the top of the UCP screen, this is an artifact of running in a lab environment. A UCP server configured for a production environment would not display this warning
For this task you will create a service that runs an NGINX webserver. Just the default server, running the default web page. We're going to run it on Swarm.
-
Give the service a name like
web_server
and imagenginx
. Don't clickcreate
just yet. First click over to theNetwork
tab. -
On the
Network
tab, clickPublish Port
so we can expose a port people can use to view the website. Fill in theTarget Port
with 80, and thePublished Port
with8000
. We're using8000
in order to avoid conflicts with the app in Task 2. -
Click
Confirm
and thenCreate
. This will pull the latestnginx
image from Docker Hub, and then deploy it as a service exposing port 8000, routing that to port 80 in the container. Normally you would want to pull your own image from Docker Trusted Registry. You can try that out in one of the other labs. -
Back on the
Services
tab, you will see thatweb_server
is being created. It will have a red dot next to it while it pulls the image and then deploys it. Once it turns green, you will know it is ready.
-
Click on the service and you will see the configuration. Find the link to
Published Endpoints
and click on that. -
This should open up the default NGINX web page.
- If you feel like it, go back to the services tab and remove the
web_server
service.
Task 1 was a great way to get started, but apps are rarely single service. You may have many services running. You could go through and create and configure each one, one-by-one. Or you could use a Stack to create the application all at once, with all the configuration you need. Docker EE makes this really easy.
- Click on
Shared Resources
and thenStacks
. Click onCreate Stack
in the upper right.
- Name the stack
vote
, selectSwarm Services
, and paste the following compose file into the editor. Then clickCreate
in the lower right.
version: "3"
services:
redis:
image: redis:alpine
ports:
- "6379"
networks:
- frontend
deploy:
replicas: 1
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
db:
image: postgres:9.4
volumes:
- db-data:/var/lib/postgresql/data
networks:
- backend
deploy:
placement:
constraints: [node.role == manager]
vote:
image: dockersamples/examplevotingapp_vote:before
ports:
- 5000:80
networks:
- frontend
depends_on:
- redis
deploy:
replicas: 2
update_config:
parallelism: 2
restart_policy:
condition: on-failure
result:
image: dockersamples/examplevotingapp_result:before
ports:
- 5001:80
networks:
- backend
depends_on:
- db
deploy:
replicas: 1
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
worker:
image: dockersamples/examplevotingapp_worker
networks:
- frontend
- backend
deploy:
mode: replicated
replicas: 1
labels: [APP=VOTING]
restart_policy:
condition: on-failure
delay: 10s
max_attempts: 3
window: 120s
placement:
constraints: [node.role == manager]
networks:
frontend:
backend:
volumes:
db-data:
- This will start creating a multi-service voting app. It has several components, as you can see:
redis
a key value store to temporarily store votes
db
a PostGres database
vote
to collect votes
result
to display votes
worker
to collect votes from the redis
service and put them into the database
-
Creating the stack also creates a couple of networks and scales the vote service to 2 replicas, which will spread it out over two containers. Given different distribution strategies, this could spread it to one or two nodes.
-
After you click
Create
, it will take a little while to get started. Each service will be created. Click on theDone
button and make sure you are back onStacks
. You will seevote
there.
- Click over to
Swarm
and thenServices
and you'll see the services gradually turn green.
- If you click on
vote_vote
you can select the endpoint and click to see the voting app.
You'll see the container ID at the bottom. That will change depending on the container and is randomly generated when the container is generated. If you hit refresh, you'll see the second service. Docker EE automatically load-balances between them.
- Go back to UCP. Make sure
vote_vote
is selected, and scroll down the right panel until you see a link for2 task(s)
. Click on that.
- Each task is one container. You'll see taht they are spread over two of the worker nodes. Docker EE did that automatically based on the default distribution strategy.
While you have Docker EE open, check out various tabs and experiment, find out what you can. And, now that you've explored the basics of Docker EE, you can check out other hands-on labs, learning more about specific features of Docker EE. And finally, after DockerCon if you want to try out more Docker EE or suggest it to your colleagues, you can get a 12 hour hosted trial.