Docker EE for IBM Cloud (Beta) Quick Start

Estimated reading time: 6 minutes

Docker Enterprise Edition for IBM Cloud (Beta) Quick Start

Are you ready to orchestrate Docker Enterprise Edition swarm clusters that are enhanced with the full suite of secure IBM Cloud platform, infrastructure, and Watson services? Great! Let’s get you started.

To request access to the closed beta, email IBM.

Getting started with Docker for IBM Cloud in 4 easy steps

Step 1: Get all your accounts in order

  1. Set up your IBM Cloud account:

  2. Get your IBM Cloud infrastructure credentials:

  3. If you have not already, create an organization and space to use when using IBM Cloud services. You must be the account owner or administrator to complete this step.

  4. Get the Docker EE URL associated with your subscription. Email IBM to get a trial subscription during the beta.

  5. Set your environment variables to use your IBM Cloud infrastructure credentials and your Docker EE installation URL. For example:

     export SOFTLAYER_USERNAME=user.name.1234567
     export SOFTLAYER_API_KEY=api-key
     export D4IC_DOCKER_EE_URL=my_docker-ee-url
    

Now let’s download some Docker for IBM Cloud tools.

Step 2: Install the CLIs

  1. Install the IBM Cloud CLI.

  2. Install the Docker for IBM Cloud plug-in. The prefix for running commands is bx d4ic.

     $ bx plugin install docker-for-ibm-cloud -r Bluemix
    
  3. Optional: To manage a private IBM Cloud Container Registry, install the plug-in. The prefix for running commands is bx cr.

     $ bx plugin install container-registry -r Bluemix
    
  4. Verify that the plug-ins have been installed properly:

     $ bx plugin list
    

Now we’re ready to get to the fun stuff: making a cluster!

Step 3: Create clusters

Create a Docker EE swarm cluster in IBM Cloud. During the beta, your cluster can have a maximum of 20 nodes, up to 14 of which can be worker nodes. If you need more nodes than this, work with your Docker representative to acquire an additional Docker EE license.

  1. Log in to the IBM Cloud CLI. If you have a federated ID, use the --sso option.

     $ bx login [--sso]
    
  2. Target the IBM Cloud org and space:

     $ bx target --cf
    
  3. Create the cluster. Use the --swarm-name flag to name your cluster, and fill in the credentials, SSH, and Docker EE installation URL variables with the information that you previously retrieved.

    $ bx d4ic create --swarm-name my_swarm \
    --sl-user user.name.1234567 \
    --sl-api-key api_key \
    --ssh-label my_ssh_label \
    --ssh-key filepath_to_my_ssh_key \
    --docker-ee-url my_docker-ee-url
    

    Customize your cluster

    You can customize your cluster by using other flags and options with bx d4ic help create, but for now, we’ll just stick with a basic swarm.

  4. Note the cluster Name and ID.

Congrats! Your Docker EE for IBM Cloud cluster is provisioning. First, the manager node is deployed. Then, the rest of the infrastructure resources are deployed, including the worker nodes, DTR nodes, load balancers, subnet, and NFS volume.

  • To check manager node status: docker logs cluster-name_ID.
  • To check infrastructure resources: bx d4ic show --swarm-name cluster-name --sl-user user.name.1234567 --sl-api-key api_key.

Step 4: Use UCP

Check it out: Docker for IBM Cloud uses Docker Universal Control Plane (UCP) to help you manage your cluster through a simple web UI!

Step 4a: Access UCP

  1. Get your UCP password from the Docker logs Outputs:

    $ docker logs cluster-name_ID
    ...
    ucp_password = UCP-password
    ...
    
  2. Retrieve your cluster’s UCP URL:

     $ bx d4ic list --sl-user user.name.1234567 --sl-api-key api_key
    
  3. Copy the UCP URL for your swarm from the bx d4ic list command, and in your browser navigate to it.

  4. Log in to UCP. Your credentials are admin and the UCP password from the docker logs command, or the credentials that your admin created for you.

We’re almost done! We just need to download the UCP certificate bundle so that you can create and deploy services from your local Docker client to the cluster.

Step 4b: Download client certificates

  1. From the UCP GUI under your user name (for example, admin), click My Profile.

  2. Click Client Bundles > New Client Bundle. A zip file is generated.

  3. In the GUI, you are shown a labeland public key. You can edit the label by clicking the pencil icon and giving it a name, e.g., d4ic-ucp.

  4. In a terminal, navigate and unzip the client bundle:

    $ cd Downloads && unzip ucp-bundle-admin.zip
    

    Keep your client bundle handy

    Move the certificate environment variable directory to a safe and accessible location on your machine. You’ll use it a lot!

  5. From the client bundle directory, update your DOCKER_HOST and DOCKER_CERT_PATH environment variables by loading the env.sh script contents into your environment.:

    $ source env.sh
    

    Set your environment to use Docker EE for IBM Cloud

    Repeat this to set your environment variables each time you enter a new terminal session, or after you unset your variables, to connect to the Docker EE for IBM Cloud swarm.

That’s it! Your Docker EE for IBM Cloud cluster is provisioned, connected to UCP, and ready to go.

What’s next, you ask? Why not try to:

ibm, ibm cloud, quickstart, iaas, tutorial