

Together these define the foreground process that will run when containers are started from your image. Two vital Dockerfile instructions for CLI tools are ENTRYPOINT and CMD.
#DOCKER RUN IMAGE WITH CLI SOFTWARE#
Add just the packages your software requires, such as its programming language, framework, and dependencies. It’s usually best to start from a minimal base image that runs a streamlined operating system like Alpine. The objective is to provide an image that’s as lightweight as possible while still bundling everything your application needs to operate. Creating a Docker Image for a CLI Appĭocker images for CLI apps are little different to those used for any other type of software. If you’re concerned about locking out users who don’t want to use Docker, you can still provide alternative options via your existing distribution channels. Nowadays many developers will be running it as a matter of course so it’s a fairly safe choice to make.

One natural consequence of Dockerized distribution is the requirement that users already have Docker running on their machine. This could encourage more users to give your app a go. Docker containers have their own private filesystem removing a container leaves no trace of its existence on the host. People can be hesitant to add new packages to their machines lest the software fails to fully clean up after itself when removed. Unlike regular package managers, users can easily run two versions of your software side-by-side by starting containers based on different image tags.Īnother benefit is the ease with which users can safely try out your app without making a long-term commitment to it. Each distinct release you create should get its own immutable tag that uniquely identifies its Docker image.
#DOCKER RUN IMAGE WITH CLI MANUAL#
There’s no manual extraction of tar archives, copying into system folders, or PATH editing involved.ĭockerized software also makes it easy for users to select different versions, perform updates, and initiate rollbacks.

They get to docker run your-app instead of having to look for platform-specific installation instructions. Why Use Docker for CLI Apps?ĭocker can make it quicker and easier for users to get your new utility installed. Here’s how you can use Docker to package CLI apps instead of traditional OS package managers and standalone binary downloads. The Docker ecosystem includes Docker Hub as an available-by-default public registry, giving you a complete tool chain for publishing, updating, and documenting your tools. It creates images that include everything you need to run a particular software, such as its source code, third-party package dependencies, and required environment characteristics.Īs Docker images can run anywhere Docker’s installed, they’re a viable format for distributing your CLI applications. Docker is a popular platform for packaging apps as self-contained distributable artifacts.
