USING IRONSECUREDOC

Docker Container List (How It Works For Developers)

Published December 16, 2024
Share:

Introduction

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; be it on a developer's laptop, a test server, or even in some kind of production. It brings efficiency for several reasons, and the first one is by keeping the applications isolated from the underlying infrastructure, so one container can run in parallel with others at the very 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?

Container: 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, so if a software developer can run it on his 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. It is the portability combined with the isolation and scalability of containers that 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 your 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
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'docker ps
VB   C#

This command will give the following columns:-

  • Container ID: It is a unique identifier for a container.
  • Image: This is a Docker image based on which the container has been created.
  • Command: It is the command that the container is running.
  • Created: How long ago the container was created
  • Status: Whether the container is running or exited and how much it has been up.
  • Ports: A mapping of the port of the host with the container.
  • Names: The assumed 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' which is a newer command, 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 -a:

docker ps -a
docker ps -a
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'docker ps -a
VB   C#

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

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

3. Listing Container IDs Only

If all you really need is to only display container IDs (they can be of use if one is scripting or otherwise automating actions) then it's handy to simply use the -q flag:

docker ps -q
docker ps -q
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'docker ps -q
VB   C#

The command 'docker ps -q' will print only the running container ID image, which makes it nice and easy to feed the IDs to other Docker commands for batch acting.

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

docker stop $(docker ps -q)
docker stop $(docker ps -q)
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'docker @stop $(docker ps -q)
VB   C#

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 output of the docker ps command based on specified criteria using the docker ps filter option. Below is an example for only listing containers by status:

docker ps -f "status=exited"
docker ps -f "status=exited"
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'docker ps -f "status=exited"
VB   C#

This will only list containers that have exited. You can filter by the name of the image, 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 option --format. For instance, to list only the container's ID and name, one can use:

docker ps --format "{{.ID}}: {{.Names}}"
docker ps --format "{{.ID}}: {{.Names}}"
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'docker ps --format "{{.ID}}: {{.Names}}"
VB   C#

This is especially helpful when you're using Docker container management in some other 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 will let users secure PDF documents for 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 very integrated 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 thus pretty 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 prevent the confidentiality of data.

Redaction: This feature removes confidential data such as personal identifiers or other sensitive information, hence keeping in line with the privacy standards and regulations.

Digital Signing: This has a digital signing feature with notarization of PDFs because it supports .pfx or.p12 to ensure the document is authentic.

Compliance: It too ensures this is compliant with PDF/A and PDF/UA standards, which makes it good for archival and accessibility.

REST API: This has a flexible REST API that allows integration with other software and workflows.

Document Version Control: Version control to track all changes, and version management for better control of the documents.

Docker Integration: Native integration with Docker to make easier deployment in scalable applications and scalable in cloud or on-premises environments.

Listed here are some features that make it a powerhouse tool for sensitive documents that are law-based, health services, or in the 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
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'docker pull ironsoftwareofficial/ironsecuredoc
VB   C#

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 yet another running container called IronSecureDoc. We can replace the -p flag with our port mapping, or replace the --rm to delete however many running containers as you want on the Docker host.

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
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'docker container run --rm -p 8080:8080 -e IronSecureDoc_LicenseKey=<IRONSECUREDOC_LICENSE_KEY> -e ENVIRONMENT=Development -e HTTP_PORTS=8080 ironsoftwareofficial/ironsecuredoc:latest
VB   C#

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 was 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 you to interact with API endpoints

For instance, 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'
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'curl -X 'POST' \ 'http: -H 'accept: */ *' \ -H 'Content-Type: multipart/form-data' \ -F 'pdf_file=@test.pdf;type=application/pdf'
VB   C#

By doing this, IronSecureDoc will receive the document and apply the desired encryption.

Conclusion

Thus, listing commands, including 'docker ps' and 'docker ps -a' make the management of Docker containers efficient in that they enable easy checking, maintenance, and administration of running and stopped containers. Such commands help developers and system administrators filter, format, and manipulate containers in different environments, thereby making proper application management effective.

IronSecureDoc makes it pretty easy for the document security features of encryption, redaction, and digital signing to get deployed and scaled as a Docker container. It lets it deploy and scale easily while ensuring that the performance and security levels are maintained across different platforms. To know more about the IronSecureDoc licencing click here. Also, Iron Software offers various products to uplift your development project that you can further learn about here.

< PREVIOUS
Zabbix Docker (How it Works for Developers)
NEXT >
Docker Compose Environment Variables (Developer Tutorial)

Ready to get started? Version: 2024.10 just released

Free DownloadView Licenses >