Blog

Top Docker tips from 12 Docker Captains

Sep 28, 2017

Docker is great, but sometimes you need a few pointers. We asked 12 Docker captains their top hack for our favorite container platform. We got some helpful advice and specific instructions on how to avoid problems when using Docker. Read on to find out more!

 

Docker Tip #1

Ajeet Singh Raina

Ajeet Singh Raina is Senior Systems Development Engineer at DellEMC Bengaluru, Karnataka, India. @ajeetraina

How do you use Docker?

Ajeet Singh Raina: Inside DellEMC, I work as Sr. Systems Development Engineer and spend considerable amount of time playing around with datacenter solution. Hardly a day goes by without talking about Docker and its implementation. Be it a system management tool, test certification, validation effort or automation workflow, I work with my team to look at how Docker can simplify the solution and save enormous time of execution. Being part of Global Solution Engineering, one can find me busy talking about the possible proof of concepts around datacenter solution and finding the better way to improve our day to day job.

Also, Wearing a Docker captain’s hat, there is a sense of responsibility to help the community users, hence I spend most of time keeping close eyes on Slack community questions/discussions and contributing in terms of blog posts almost every week.

Raina’s Docker Tip:

Generally, Docker service inspect outputs a huge JSON dump. It becomes quite easy to access individual properties using Docker Service Inspection Filtering & Template Engine. For example, if you want to list out the port which WordPress is using for specific service:

$docker service inspect -f ‘{{with index .Spec.EndpointSpec.Ports 0}}{{.TargetPort}}{{end}}’ wordpressapp

Output:

80

This will fetch just the port number out of huge JSON dump. Amazing, isn’t it?

x

 

Docker Tip #2

Nick Janetakis

Nick Janetakis ist Docker Trainer and creator of www.diveintodocker.com. @nickjanetakis

How do you use Docker?

Nick Janetakis: I use Docker in development for all of my web applications which are mostly written in Ruby on Rails and Flask. I also use Docker in production for a number of projects. These are systems ranging from a single host deploy, to larger systems that are scaled and load balanced across multiple hosts.

Janetakis Docker Tip:

Don’t be afraid of using Docker. Using Docker doesn’t mean you need you need to go all-in with every single high scalability buzz word you can think of. Docker isn’t about deploying a multi-data center load balanced cluster of services with green / blue deploys that allow for zero down deploys with seamless continuous integration and delivery.
Start small by using Docker in development, and try deploying it to a single server. There are massive advantages to using Docker at all levels of skill and scale.

x

 

Docker Tip #3

Gianluca Arbezzano

Gianluca Arbezzano is Page Reliability Engineer at InfluxData Italy. @gianarb

How do you use Docker?

Gianluca Arbezzano: I use Docker to ship applications and services like InfluxDB around big cloud services. The container allows me to ship the same application in a safe way. I use Docker a lot to create and manage environments. With Docker Compose I can start a fresh environment to run smoke tests or integration tests on a specific application in a very simple and easy way. I can put it in my pipeline and delivery process to enforce my release circle.

Arbezzano’s Docker Tip:

Generally, Docker service inspect outputs a huge JSON dump. It becomes quite easy to access individual properties using Docker Service Inspection Filtering & Template Engine. For example, if you want to list out the port which WordPress is using for specific service:

docker run -it -p 8000:8000 gianarb/micro:1.2.0

x

 

 

Check out the Workshop “From 0 to 100 – OpenShift, Kubernetes and Docker for budding DevOps specialists” on DevOpsCon 2017

 

 

Docker Tip #4

Adrian Mouat

Adrian Mouat is Chief Scientist at Container Solutions. @adrianmouat

How do you use Docker?

Adrian Mouat: My daily work is helping others with Docker and associated technologies, so it plays a big role. I also give a lot of presentations, often running the presentation software from within a container itself.

Mouat’s Docker Tip:

I have a whole presentation of tips that I’ll be presenting at DockerConEU! But if you just want one, it would be to set the `docker ps` output format. By default it prints out a really long line that looks messy unless your terminal takes up the whole screen. You can fix this by using the `–format` argument to pick what fields you’re interested in:

docker ps –format \
“table {{.Names}}\\t{{.Image}}\\t{{.Status}}”

And you can make this the default by configuring it in your `.docker/config.json` file.

x

 

Docker Tip #5

Vincent De Smet

Vincent De Smet works as DevOps Engineer at Honestbee, Singapore. @vincentdesmet

How do you use Docker?

Vincent De Smet: Docker adoption started out mainly in the CI/CD pipeline and from there on through staging environments to our production environments. At my current company, developer adoption (using containers to develop new features for existing web services) is still lacking as each developer has their own preferred way of working.
Given containers are prevalent everywhere else and Docker tools for developers keep improving, it will only take time before developer will choose to adopt these into their daily workflow. I personally, as a DevOps engineer in charge of maintaining containerized production environments as well as improve developer workflows, troubleshoot most issues through Docker containers and use containers daily.

De Smet’s Docker Tip:

Make sure to follow “Best practices for writing Dockerfiles”  – these provide very good reasons on why you should do things a certain way and I see way too many existing Dockerfiles that do not follow these.

Anyone slightly more advanced with Docker will also gain a lot from mastering the Linux Alpine distribution and its package manager.

And if you’re getting started, training.play-with-docker.com is an amazing resource

docker run -it -p 8000:8000 gianarb/micro:1.2.0

x

 

 

Check out the Track Container Technologies on DevOpsCon 2017

 

 

Docker Tip #6

Chanwit Kaewkasi

Chanwit Kaewkasi is Docker Swarm Maintainer and has ported Swarm to Windows. @chanwit

How do you use Docker?

Chanwit Kaewkasi: I help companies in South-East Asia and Europe design and implement their application architectures using Docker, and deploy them on a Docker Swarm cluster.

Kaewkasi’s Docker Tip:

`docker system prune -f` always make my day.

x

x

x

 

Docker Tip #7

Kendrick Coleman

Kendrick Coleman is Developer Advocate for {code} by Dell EMC. @kendrickcoleman

How do you use Docker?

Kendrick Coleman: Docker plays a role in my daily job. I am eager to learn the innards to find new corner cases. It makes me excited to know I can turn knobs to make applications work the way I want. There is a misconception that persistent applications can’t or shouldn’t run in containers. I’m proud that the team I work with builds tools to make running persistent application easy and seamless that can be integrated as a part of a tool chain.

Coleman’s Docker Tip:

Start off easy. Always go for the low hanging fruit like a web server and make it work for you. Then take your single host and pick an orchestrator and use that to make your app resilient. After that, move to an application that uses persistent data. This allows you to progress and move all your applications off of VMs and into containers.

x

 

Docker Tip #8

John Zaccone

John Zaccone works as Cloud Engineer and Developer Advocate at IBM. @JohnZaccone

How do you use Docker?

John Zaccone: Right now, I work at IBM as a developer advocate. I work with developers from other companies to help them improve their ability to push awesome business value to production. I focus on adopting DevOps automation, containers, and container orchestration as a big part of that process.

Zaccone’s Docker Tip:

I organize a meetup where I interface with a lot of developers and operators who want to adopt Docker, but find that they either don’t have the time or can’t clearly define the business case for using Docker. My advice to companies (and this applies to all new technologies, not just Docker) is to allow developers some freedom to explore new solutions. Docker is a technology where the benefits are not 100% realized until you get your hands on it and understand exactly how it will benefit you in your use case.

x

 

 

Check the full program of DevOpsCon 2017

 

 

Docker Tip #9

Nicolas De Loof

Nicolas De Loof is Docker enthusiast at CloudBees. @ndeloof

How do you use Docker?

Nicolas De Loof: For my personal use I rely on Docker for various tests, so I ensure I have a reproducible environment I can share with others, as well as prevent impacts on my workstation. My company also offers a Docker based elastic CI/CD solution “CloudBees Jenkins Enterprise” and as a Docker expert I try to make it adopt best Docker features.

De Loof’s Docker Tip:

Considering immutable infrastructure, there’s many middleware who use filesystem as a cache, and on might want to avoid making this persistent. So I like to constrain them running as a read-only container (docker run –read-only) to know exactly where they need to access filesystem, then to create a volume for the actual persistent data directory and a tmpfs for everything else, typically caches or log files.

x

 

Docker Tip #10

Lorenzo Fontana

Lorenzo Fontana is DevOps expert at Kiratech. @fntlnz

How do you use Docker?

Lorenzo Fontana: My company is writing an open source for Docker and other containerization technologies, I’m also daily involved in Docker doing mainly reviews on issues and PRs.
I do a lot of consultancy to help companies using Containers and Docker by reflection.
I used Docker for a while to spawn GUI software on my computer, and then I switched to systemd-nspawn. In the future, I’ll probably go to runc.

Fontana’s Docker Tip:

Not many people already know about multi staged builds, another cool thing is the fact that now Docker handles configs and secrets.
Also a lot happens in the implementation, just get one project under the Docker or the Moby organizations on GitHub, there are a lot of implemented things that can open your eyes on how things works.

x

 

Docker Tip #11

Brian Christner

Brian Christner is Cloud Advocate and Cloud architect at Swisscom. @idomyowntricks

How do you use Docker?

Brian Christner: I personally use Docker for every new project I’m working on. My personal blog runs Docker and the monitoring projects I’m working on to creating applications for IoT on RasperryPi’s. At work, Docker is being used across several teams. We use it to provision our Database as a Service offerings and for development purposes. It is very versatile and used across multiple verticals within our company. Here is one of our use cases that is on Docker’s website –“Swisscom goes from 400 vms to 20 vms, maximizing infrastructure efficiency with Docker”.

De Loof’s Docker Tip:

I share all my favorite tips via my blog.

x

 

Docker Tip #12

Antonis Kalipetis

Antonis Kalipetis is CTO at SourceLair, a Docker based Online-IDE. @akalipetis

How do you use Docker?

Antonis Kalipetis: I use Docker for all sorts of things, as a tool to create awesome developer tools at SourceLair, in my local development workflow and for deploying production systems for our customers.

Kalipetis’ Docker Tip:

My tip would be to always use Docker Swarm, or another orchestrator, for deployment, even if you have a single machine “cluster”. The foundations of Swarm are well-thought and works perfectly on just one machine, if you’re not using it because you don’t have a “big enough” cluster, you’re shooting yourself in the foot.

x

 

 

Stay tuned:

Behind the Tracks

 

Kubernetes Ecosystem

Docker, Kubernetes & Co

Microservices & Software Architecture

Maximize development productivity

Continuous Delivery & Automation

Build, test and deploy agile

Cloud Platforms & Serverless

Cloud-based & native apps

Monitoring, Traceability & Diagnostics

Handle the complexity of microservices applications

Security

DevSecOps for safer applications

Business & Company Culture

Radically optimize IT

Organizational Change

Overcome obstacles on the road to DevOps

Live Demo #slideless

Showing how technology really works