Flux7 Flux7
  • Digital Innovation
      • Digital Innovation
      Enable Software Innovation
      • CI/CD: Accelerate Deployments Through Pipelines
      • Containers Infrastructure:Improve Agility with Containers
      • Build:Custom Toolchain Deployment
      • Microservices: Speed Application Development
      • HPC:Product Design & Simulation
      • Renovate:Application Migration to the Cloud
      • Serverless:Innovate at the Speed of the Market
      Scale Enterprise DevOps
      • AWS DevOps Consulting:  Refactor Large Quantities of Apps to AWS
      • Cloud-Native Architectures: Accelerate Business with Cloud-Native Services
  • Operational Excellence
      • Services
      Cloud Implementation Services
      • Cloud Migration Services: Streamline Your Cloud Migration
      • Build Cloud Foundations: Accelerate Adoption with Strong Cloud Foundations
      • ISV Workloads on Cloud: Defined Solutions and Proven IP
      • High-Performance Computing Services: Exploit Cloud Elasticity and Scalability
      Enforce Security and Compliance
      • Automate Compliance: Meet Corporate and Legal Requirements
      • Web Application Firewall:Protect Vital Data and Functions

      Our landing zones on AWS emphasizes training, documentation, and resources to help teams new to AWS get the skills they need for long-term business agility.

      Gain a Landing Zone That Fits Your Needs Today

  • Industries
      • Industries
       
      • Energy:Cloud Solutions for the Energy Industry
      • Finance: Secure Infrastructure for Improved Customer Service and Analytics
      • Healthcare & Life Sciences: Meet Security & Compliance Requirements
      • Hospitality: Increase Customer Acquisition
       
      • Manufacturing: Innovation with Digital Transformation
      • Retail:Grow Customer Loyalty and Lifetime Value
      • Semiconductor: Legacy Modernization Services
      • Software:Grow Developer Agility and Application Reliability
       

      Read our industry success stories and the benefits our customers saw

      Read the Case Studies

  • Tech
      • Tech
      Flux7 Tech
      • DevOps Toolchain: Reduce DevOps Challenges
      • Amazon Web Services: Reduce Complexities and Risks in AWS Architectures
      • AWS Database Services: Design and Implementation of Infrastructure for Cloud-Based Databases
      Configuration
      • Cloud Configuration: Gain Greater Consistency, Repeatability & Agility
      • HashiCorp Terraform: Defining Infrastructure as Code 
      • AWS CloudFormation: Reduce Maintenance and Improve Security
      Containers
      • Container Infrastructure: Improve Agility with Containers
      • Docker: Build, Ship and Run Applications Anywhere
      • Kubernetes: Container Consulting Services
      • Red Hat OpenShift: Speed Code Delivery

      Rapidly adopt technology to achieve Infrastructure as Code and continuous delivery and support of applications and workloads.

      Create Your DevOps Toolchain

  • Resources
      • Resources
      Research & Reports
      • Analyst Insights & Reports
      • Blog
      • Case Studies
      • White Papers
      News & Events
      • Events Calendar
      • Newsroom
      • Press Releases
      Flux7 Academy
      • Tech Tutorials

      Read about what we do, how we do it and how our customer's benefit from our solutions.

      Read and Download Our Case Studies

  • About
      • About Flux7
      Get To Know Us
      • About Flux7
      • Awards & Recognitions
      • Meet Our Team
      Work With Us
      • Careers
      • Our Culture
      Partner With Us
      • Flux7 partners with technology vendors who deliver solutions to help our customers address scalability, security, reduce the cost of infrastructure delivery and improve speed to market.

      Welcome to Flux7! Get to know us a bit better and discover what makes us different than other DevOps Consultants.

      Discover What Makes Us Different

  • Contact us
An NTT DATA Company

Login Contact us

Docker Tutorial Series, Part 6: The Next 15 Docker Commands

Array ( [0] => WP_Term Object ( [term_id] => 90 [name] => Blog [slug] => blog [term_group] => 0 [term_taxonomy_id] => 90 [taxonomy] => category [description] => [parent] => 0 [count] => 635 [filter] => raw ) )

Docker Tutorial Series, Part 6: The Next 15 Docker Commands

By Flux7 Labs
June 12, 2014

In an earlier post for the Docker Tutorial Series, we discussed the first 15 Docker commands. We shared some hands-on experience in how they are used and what they do. In this post, we will talk about another 15 Docker commands, leading us to a more practical experience using Docker.

daemon:

Docker daemon is the persistent background process that helps manage containers. In general, daemon is a long-running process servicing requests for services.

-d flag is used to run the daemon

build:

As discussed before, Docker images can be built using Dockerfiles. A simple command for the build is as follows:

docker build [options] PATH | URL

There are also some interesting options that Docker provides, such as:

–rm=true; all intermediate containers are removed after a successful build

–no-cache=false; avoids using cache during build

The following screenshot depicts the use of the Docker build command.

rer

attach:

Docker allows interaction with running containers using the attach command. The command also allows viewing of daemonized processes. Detaching from the container can be done in two ways:

Ctrl+c – for a quiet exit

Ctrl- – to detach with a stack trace

The syntax for attach is

docker attach container

This screenshot shows a simple execution of the attach command.

Docker-attach

diff:

Docker provides a very powerful command diff which lists the changes in the files and directories. The changes include addition, deletion and those represented by the A, D and C flags, respectively. This command improves debugging processes and allows faster sharing of environments.

The syntax is

docker diff container

Here’s a screenshot of the diff command executed.

Docker-Diff

events:

Real-time details of events can be collected from the server by specifying the duration for which the real-time data needs to be collected.

import:

Docker allows imports from remote locations and a local file or directory. Import from remote locations is done using http, and imports from local files or directories are accomplished using the “-” parameter.

The syntax for import from a remote location is

docker import http://example.com/example.tar

The following image illustrates import from a local file.

Docker-Import

export:

Similar to import, the export command is used to transfer the contents of the filesystem as a tar file. The following image depicts a simple execution of the same.

Docker-Export

cp:

This command copies files from the containers filesystems to the specified path. The syntax for the cp command is

docker cp container:path hostpath.

This image depicts the working of the cp command.

Docker-CP

login:

A simple command to login the Docker registry server is Docker login with the following syntax:

docker login [options] [server]

To login a self-hosted registry use the command

docker login localhost:8080

Docker-Login

inspect:

Low-level information about containers and images can be collected using the Docker inspect command. Information, including the following, can be gathered using the inspect command:

IP address of an instance

List of port bindings

Search for specific port mapping

Collect configuration details

The syntax for inspect is

docker inspect container/image

Docker-Inspect

 

kill:

The container’s main process is killed by sending the SIGKILL signal. The syntax is

docker kill [options] container

Docker-Kill

rmi:

Removing one or more images can be achieved using the rmi command. The syntax is as follows:

docker rmi image

An image can have multiple tags linked to it. On deletion of an image, you should make sure all tags are removed to avoid errors. The following image shows an example usage of the rmi command.

fz

wait:

Docker provides a simple wait command to print the exit code only after the container exits.

docker wait

load:

Load an image or a repository in tar form to STDIN, which can be achieved using the command docker load.

This screenshot shows loading the app_box.tar file to the STDIN.

ff

save:

Similar to load, an image can be saved as tar and sent to the STDOUT. This can be done using the save command

docker save image

A simple illustration for this is:

Docker-Save

Learn about how Docker can be used to support a microservices strategy here. 

Did you find this useful?  

Interested in getting tips, best practices and commentary delivered regularly? Click the button below to sign up for our blog and set your topic and frequency preferences.

Subscribe to the Flux7 Blog

Other Tutorials in this series:


Docker Tutorial Series, Part 1: An Introduction | Docker Components

 

Docker Tutorial Series, Part 2: The 15 Commands

 

Docker Tutorial Series, Part 3: Automation is the Word Using DockerFile

 

Docker Tutorial Series, Part 4: Registry & Workflows

 

Docker Tutorial Series, Part 5: Docker Security

 

Docker Tutorial Series, Part 7: Ultimate Guide for Docker APIs

 

Docker Tutorial Series, Part 8: Docker Remote API

Categories:
Tags: Docker, Docker Tutorials, Lowering Maintenance
Share This Article
Facebook Twitter Pinterest Linkedin
Prev Post
Next Post

Related Articles

re:Invent Round-Up of AWS DevOps Announcements
By Flux7 Labs
December 21, 2020

re:Invent Round-Up of AWS DevOps Announcements

READ MORE
How Will SASE Change Networking in 2021?
By Flux7 Labs
December 16, 2020

How Will SASE Change Networking in 2021?

READ MORE

Recent Posts

  • re:Invent Round-Up of AWS DevOps Announcements

  • How Will SASE Change Networking in 2021?

  • AWS re:Invent Machine Learning Round-Up

  • How to Publish Managed Images to the Azure Marketplace

  • AWS re:Invent News Round-Up

  • Shave Days off Azure Marketplace Publishing with Automated Testing

  • IT Modernization and DevOps News Week in Review 11.30.2020

  • How To: Multi-Cluster Monitoring in Amazon EKS

  • IT Modernization and DevOps News Week in Review 11.16.2020

  • When to Migrate from AWS Landing Zone to AWS Control Tower

Flux7
  • About Flux7
  • Contact Us
  • Careers at Flux7
  • Newsroom
  • Meet our Team
Services
  • Enable Software Innovation
  • Enforce Security and Compliance
  • Adopt Cloud
  • Cloud Migration Services
  • Secure the Cloud
Resources
  • Analysts Reports
  • Case Studies
  • White Papers
About Flux7

Flux7, an NTT DATA Company, helps enterprises reduce the complexities of new and evolving cloud automation strategies. Agile and DevOps-native, Flux7’s robust IT services portfolio prioritizes a fast path to ROI, is transformation focused and creates secure and stable pathways for operational excellence.

Follow Us
Flux7, an NTT DATA Company | All Rights Reserved | Privacy Policy