DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Docker and IBM Bluemix Containers Reference Sheet

Docker and IBM Bluemix Containers Reference Sheet

For beginners to Docker and IBM Bluemix containers, use this reference sheet to help remember commonly used commands, including how to create Docker images.

Niklas Heidloff user avatar by
Niklas Heidloff
CORE ·
Aug. 18, 15 · Tutorial
Like (1)
Save
Tweet
Share
1.40K Views

Join the DZone community and get the full member experience.

Join For Free

As a developer I prefer graphical tools since I often cannot remember all the different commands for various CLIs (command line interfaces). In cases where I have to use CLIs I write down my own little cheatsheets with the commands I use most often. Below is a minimal set of commands to create Docker images and containers running a Java Liberty application and deploy them to IBM Bluemix.

For more information check out the official Docker CLI documentation and the IBM Containers CLI documentation. To interact with Bluemix I use below the IBM Container plugin for Cloud Foundry which you need to install in addition to Docker and the Cloud Foundry CLI.

Docker


List all images:
docker images

Remove image:
docker rmi _image_tag_

List all containers:
docker ps -a

Remove container:
docker stop _container_name_
docker rm _container_name_

Build image:
docker build -t _image_tag_ .

Run container:
docker run --name _container_name_ -p 80:80 -p 443:443 -d -t _image_tag_

Launch application:
boot2docker ip
browser: http:// _your_ip_

IBM Containers


Login:
cf login
cf ic login

List all images:
cf ic images

Remove image:
cf ic rmi registry.ng.bluemix.net/_your_namespace_/_image_tag_

List all containers:
cf ic ps -a

Remove container:
cf ic stop _container_name_
cf ic rm _container_name_

Push image:
docker tag _image_tag_ registry.ng.bluemix.net/_your_namespace_/_image_tag_
docker push registry.ng.bluemix.net/_your_namespace_/_image_tag_

Run container:
cf ic run --name container_name -p 80:80 -p 443:443 -d -t registry.ng.bluemix.net/_your_namespace_/_image_tag_

Manage IP addresses:
cf ic ip request
cf ic ip list -a
cf ic ip bind _your_ip_ _container_name_

Launch application:
browser: http:// _your_ip_

Sample Liberty Application


I've implemented a simple hello world Liberty application. In order to deploy it to Bluemix you can use the commands above. Here is the Dockerfile which copies the server configuration and the web application.



I've configured Liberty to use the ports 80 and 443, but you can also leave the defaults and change the port mappings in the commands above.






Docker (software) Bluemix CFS (file format) application

Published at DZone with permission of Niklas Heidloff, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • A Brief Overview of the Spring Cloud Framework
  • How Observability Is Redefining Developer Roles
  • Fraud Detection With Apache Kafka, KSQL, and Apache Flink
  • Upgrade Guide To Spring Data Elasticsearch 5.0

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: