Skip to footer content
USING IRONSECUREDOC

Docker Container List (How It Works For Developers)

In today’s fast-paced software development landscape, efficient deployment and management of applications are crucial. Docker has emerged as a leading solution for automating the deployment of applications within lightweight, portable containers. By encapsulating an application and its dependencies, Docker ensures consistent performance across different environments, from local development to production.

This containerization technology simplifies scalability and resource management, making it an essential tool in modern DevOps practices and continuous integration/continuous deployment (CI/CD) pipelines. In this article, we will explore the fundamentals of Docker, the concept of containers, and how it enhances the deployment process for applications, along with a closer look at IronSecureDoc, a document security tool that leverages Docker for scalable solutions.

What is Docker?

Docker is an open-source environment that automates the deployment of applications inside lightweight, portable containers. Containers package the application with all its dependent packages such that it will run exactly the same way irrespective of where the application executes; whether it is on a developer's laptop, a test server, or even in a production environment. Docker brings efficiency by keeping applications isolated from the underlying infrastructure, allowing multiple containers to run parallelly on the same host.

Docker Container List (How It Works For Developers): Figure 1 - Use-case for a Docker container

This simplifies scalability and resource management; with Docker, the development-to-production workflow is made easier and streamlined, hence a key player in modern DevOps and CI/CD pipelines.

What is a Container?

A container is a lightweight, self-contained, executable package containing everything needed to run software—from code and runtime to system tools, libraries, and settings in one bundle. This is an isolated environment from the host and other containers but shares the same operating system kernel, making it much more efficient and faster compared to traditional virtual machines.

Docker Container List (How It Works For Developers): Figure 2 - Visualization of a Docker Container

Docker containers are designed for portability. If a software developer can run it on their laptop for development and a tester can run it on a server for testing, then ideally a cloud environment or production environment can run that same stack of containers. The portability combined with the isolation and scalability of containers makes Docker an essential tool for modern software deployment and CI/CD pipelines.

Containers happen to be the core of Docker's functionality through which developers can assure that applications will work the same, regardless of where they will be deployed.

Listing Docker Containers

Among the operations you will carry out using Docker is listing containers, so you may be able to monitor their status or even manage them better. There are Docker commands for such an action, and this depends on whether you wish to print only running containers or all containers, including stopped ones.

Here is how you can list Docker containers:

1. Listing Running Containers

To list only the currently running containers, use the following docker ps command:

docker ps
docker ps
SHELL

This command will give the following columns:

  • Container ID: A unique identifier for a container.
  • Image: The Docker image based on which the container has been created.
  • Command: The command that the container is running.
  • Created: How long ago the container was created.
  • Status: Whether the container is running or exited.
  • Ports: A mapping of the port of the host with the container.
  • Names: The name assigned to the container, which may be generated automatically or set manually.

Docker Container List (How It Works For Developers): Figure 3 - Example of 'docker ps' command output

You can also use the newer command 'docker container ls', but we will be focusing on the 'docker ps' command syntax.

2. Listing All Containers (Running and Stopped)

To show all running and stopped containers, use the -a flag:

docker ps -a
docker ps -a
SHELL

This command returns the same columns as docker ps but includes stopped or exited containers, or all created containers. This command is handy for managing stopped containers or troubleshooting issues in containers that have crashed or exited.

Docker Container List (How It Works For Developers): Figure 4 - Output for the command 'docker ps -a'

3. Listing Container IDs Only

If you only need to display container IDs (which can be useful for scripting or automating actions), you can use the -q flag:

docker ps -q
docker ps -q
SHELL

The command docker ps -q will print only the running container IDs, allowing you to easily feed the IDs to other Docker commands for batch actions.

For example, one could stop every running container by combining this with docker stop:

docker stop $(docker ps -q)
docker stop $(docker ps -q)
SHELL

Docker Container List (How It Works For Developers): Figure 5 - Output of the command 'docker ps -q'

4. Filtering the List of Containers

You can also filter the output of the docker ps command based on specified criteria using the --filter option. Below is an example for only listing containers by status:

docker ps -f "status=exited"
docker ps -f "status=exited"
SHELL

This will only list containers that have exited. You can filter by the image name, labels, or any other custom criteria like ports or names.

Docker Container List (How It Works For Developers): Figure 6 - Output of the filtering command

5. Formatting the Output

For readability or custom output, Docker allows you to format the result using the --format option. For instance, to list only the container's ID and name, you can use:

docker ps --format "{{.ID}}: {{.Names}}"
docker ps --format "{{.ID}}: {{.Names}}"
SHELL

This is especially helpful when you are using Docker container management in scripts or tools where you may need certain pieces of information.

Docker Container List (How It Works For Developers): Figure 7 - Output of formatted docker ps command

What is IronSecureDoc?

IronSecureDoc is a document security tool designed to protect sensitive files by providing encryption, redaction, and digital signing features. It lets users secure PDF documents, controlling personal and confidential data in their possession. Some features include password protection, compliance with standards such as PDF/A, and digital certification, which is often used in legal, healthcare, or financial fields. The software is available as a REST API, making it highly integrative into different workflows, and it can be deployed on Docker for scalable, cloud-friendly security solutions.

Docker Container List (How It Works For Developers): Figure 8 - IronSecureDoc webpage

Features of IronSecureDoc

IronSecureDoc is quite impressive in terms of PDF security handling and document management. Its features include encryption, redaction, and digital signing:

  • Encryption: It offers PDF document encryption with 128 or 256-bit encryption with password-based security to maintain data confidentiality.
  • Redaction: This feature removes confidential data such as personal identifiers or other sensitive information, thus ensuring compliance with privacy standards and regulations.
  • Digital Signing: This has a digital signing feature with notarization of PDFs supporting .pfx or .p12, ensuring the document’s authenticity.
  • Compliance: It ensures compliance with PDF/A and PDF/UA standards, which is beneficial for archival and accessibility.
  • REST API: It has a flexible REST API that allows integration with other software and workflows.
  • Document Version Control: Provides version control to track all changes and version management for better document control.
  • Docker Integration: Native integration with Docker facilitates easier deployment in scalable cloud or on-premises environments.

These features make it a powerhouse tool for handling sensitive documents in law, health services, or financial sectors.

How to Pull IronSecureDoc into the Docker Container

Open a terminal window or Command Prompt and use this command to pull the IronSecureDoc Docker image from the repository:

docker pull ironsoftwareofficial/ironsecuredoc
docker pull ironsoftwareofficial/ironsecuredoc
SHELL

Docker Container List (How It Works For Developers): Figure 9 - Console output from pulling the IronSecureDoc Docker image

Running IronSecureDoc From a Container

Now that a container has pulled an image, we can run another command to initiate a running container called IronSecureDoc. We can use the -p flag for port mapping or the --rm flag to delete containers after stopping:

docker container run --rm -p 8080:8080 -e IronSecureDoc_LicenseKey=<IRONSECUREDOC_LICENSE_KEY> -e ENVIRONMENT=Development -e HTTP_PORTS=8080 ironsoftwareofficial/ironsecuredoc:latest
docker container run --rm -p 8080:8080 -e IronSecureDoc_LicenseKey=<IRONSECUREDOC_LICENSE_KEY> -e ENVIRONMENT=Development -e HTTP_PORTS=8080 ironsoftwareofficial/ironsecuredoc:latest
SHELL

Docker Container List (How It Works For Developers): Figure 10 - Console output from running IronSecureDoc from a container

Using IronSecureDoc with Docker Container

IronSecureDoc can be used to redact, certify, and encrypt documents using its REST API after it has been installed and launched in Docker, as previously mentioned. Visit this link for API endpoints and documentation with Swagger UI once you have launched IronSecureDoc in a Docker container: http://localhost:8080/swagger/index.html.

Docker Container List (How It Works For Developers): Figure 11 - Swagger UI for API endpoints interaction

For example, you can send a POST request to the IronSecureDoc API to submit a document for encryption:

curl -X 'POST' \
  'http://localhost:8080/v1/document-services/pdfs/encrypt?user_password=demo' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@test.pdf;type=application/pdf'
curl -X 'POST' \
  'http://localhost:8080/v1/document-services/pdfs/encrypt?user_password=demo' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@test.pdf;type=application/pdf'
SHELL

This request sends the document to IronSecureDoc, applying the desired encryption.

Conclusion

Commands such as 'docker ps' and 'docker ps -a' make the management of Docker containers efficient by allowing easy monitoring, maintenance, and administration of running and stopped containers. Such commands help developers and system administrators filter, format, and manipulate containers in different environments, thereby enabling effective application management.

IronSecureDoc facilitates the deployment and scaling of document security features like encryption, redaction, and digital signing as a Docker container, ensuring maintained performance and security across different platforms. To know more about IronSecureDoc licensing, click here. Moreover, Iron Software offers various products to uplift your development project that you can further learn about here.

Frequently Asked Questions

What is Docker?

Docker is an open-source environment that automates the deployment of applications inside lightweight, portable containers. It packages the application with all its dependencies, ensuring consistent performance across different environments.

What is a container?

A container is a lightweight, self-contained, executable package containing everything needed to run software. It shares the host operating system kernel, making it more efficient and faster than traditional virtual machines.

How do I list running Docker containers?

To list only the currently running containers, use the `docker ps` command. This will display columns such as Container ID, Image, Command, Created, Status, Ports, and Names.

How can I list all Docker containers, including stopped ones?

Use the `docker ps -a` command to show all running and stopped containers. This command is useful for managing stopped containers or troubleshooting issues.

How do I filter Docker containers by specific criteria?

Docker allows you to filter container listings using the `--filter` option. For example, `docker ps -f "status=exited"` lists only the containers that have exited.

What is a document security tool that can be deployed in Docker?

IronSecureDoc is a document security tool designed to protect sensitive files by providing features like encryption, redaction, and digital signing. It can be deployed on Docker for scalable, cloud-friendly security solutions.

How do I pull a document security tool's Docker image?

Open a terminal and use the command `docker pull ironsoftwareofficial/ironsecuredoc` to pull the IronSecureDoc Docker image from the repository.

How does a document security tool integrate with Docker?

IronSecureDoc can be installed and run within a Docker container, allowing users to leverage its document security features with the flexibility and scalability of Docker environments.

What are some features of a document security tool that supports Docker?

IronSecureDoc offers features such as PDF encryption, redaction, digital signing, compliance with PDF standards, a REST API for integration, and document version control.

How can I format Docker command output?

Use the `--format` option with Docker commands to customize the output. For example, `docker ps --format "{{.ID}}: {{.Names}}"` lists only the container's ID and name.

Chaknith Bin
Software Engineer
Chaknith works on IronXL and IronBarcode. He has deep expertise in C# and .NET, helping improve the software and support customers. His insights from user interactions contribute to better products, documentation, and overall experience.
Talk to an Expert Five Star Trust Score Rating

Ready to Get Started?