Navigation Menu

Search code, repositories, users, issues, pull requests..., provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications You must be signed in to change notification settings

Beginners Guide

This guide will take you through setting up Yacht, adding your first template, and deploying your first app.

Setting Up Yacht

Running Yacht is as simple as running the following two commands:

After that you can access Yacht on port 8000 on your server in a web browser.

If you're using Yacht alongside portainer you'll want to change the 8000 on the left of the : to 8001, then it will be available on that port on your host.

Once you're at the login page you can login with the username [email protected] and the password pass .

Template Variables

We'll setup template variables so that if you're using a template built for Yacht, you'll be able to have all of your files mounted in the correct places.

Click on the Settings cog in the left sidebar and then click on Template Variables along the top.

Replace the paths on the right with where you want each variable to be mounted. (This will typically be in your file shares if you're using a NAS).

Add any additional Variables you would like and when you're done, hit save at the bottom.

Adding a Template

To add a template, click on the Folder icon in the left sidebar and then on "New Template". If you don't have a template added yet it'll recommend you add the one that I maintain for Yacht. Once you've entered a name and URL you'll click submit.

Now that you're on the "View Templates" page you can click on the template you added to see all the apps included with your template.

From the "View Templates" page you can also click on the 3 dots and from there you can update if there are any changes, view the template, or delete the template.

Deploying from a Template

Now that you have a template added let's deploy an application. Click on your template to view it. Then pick an app to deploy. You can click on view to see any details about the application.

One you've got an app in mind click on deploy and you'll be taken to the deploy form. Everything should be filled out for you but double check that everything looks correct. Click on continue until you get to the last page and then click on Deploy.

Now you'll see your running app. You can click on it to view more detailed stats or click on the Arrow to the right of the name to perform an action with it.

Install Yacht via docker-compse

The following is an example docker-compose.yml file to deploy Yacht:

Clone this wiki locally

Developer Tools

Engage with us.

  • As Seen on TFIR 55
  • Cloud Simplified 56
  • Craft of Code 37
  • DIY Cloud 51
  • HackerSploit 32
  • In the Node Newsletter 42
  • Learnk8s Labs 8
  • Linode Kubernetes with Helm 11
  • OpenAI Versus Project 9
  • Partner Roundups 26
  • Super User 162
  • Tech With Tim Linux Beginners Series 14
  • Terraforming Kubernetes 6
  • Top Docs 75
  • Alexis Ahmed (HackerSploit) 33
  • Andrew Burke 1
  • Austin Gil 21
  • Billy Thompson 14
  • Brandon Hopkins 25
  • Chris Nesbitt-Smith 2
  • Chris Psaltis 1
  • Code with Harry 31
  • Code with Tomi 13
  • Daniele Polencic 2
  • Darcy Declute 1
  • David Burgess 16
  • David Flanagan 1
  • Florian Walther 1
  • Gardiner Bryant 60
  • James Steel 26
  • Jay LaCroix 76
  • Jay Lyman 1
  • Jérôme Petazzoni (Tiny Shell Script) 11
  • Jose Portilla 1
  • Josh | KeepItTechie 21
  • Justin Mitchel 29
  • Kevin Cunningham 1
  • Liam Eagle 2
  • Mauricio “Salaboy” Salatino 2
  • Mike Jung 3
  • Nelson Djalo 6
  • Salman Iqbal 3
  • Sam Hawley 2
  • Sid Palas 10
  • Swapnil Bhartiya 50
  • Talia Nassi 1
  • Tech with Tim 27
  • Walt Ribeiro 17
  • zSecurity 1
  • Customer Stories 37
  • Email Newsletters 42
  • Project Brief 1
  • Webinars 26
  • Cloud Overviews 19
  • Containers (Kubernetes, Docker) 107
  • Databases 27
  • Developer Tools 147
  • Multicloud 3
  • Networking 14
  • Open Source 16
  • Partner Network 40
  • Security 57

In order to see embedded YouTube videos, you must have "performance" cookies enabled in your cookie preferences .

Manage Docker Containers from a Web UI with Yacht Interactive Dashboards

In this video, Brandon from @TechHut shows you how to install and use Yacht, an interactive dashboard for installing and managing Docker containers on your system. Yacht is great for visualizing and maintaining your Docker infrastructure.

Chapters: 0:00 – Introduction 0:18 – What is Yacht? 1:00 – Installing Yacht 3:32 – Logging into Yacht 4:28 – Installing a SSL Certificate 7:42 – Connecting to the Yacht GUI 8:28 – Adding Tools to Yacht 9:00 – Install Librespeed 12:44 – Conclusion

New to Linode? Get started here with a $100 credit! Check out Yacht on the Web. Check out the Yacht Documentation. Subscribe to get notified of new episodes as they come out!

#Linode #Yacht #Docker #AlternativeCloud #OpenSource Product: Linode, Cloud Computing, Yacht; TechHut;

Open Source

yacht in docker

AWESOME Linux Tiling Terminal Emulator | Control Multiple Servers in a Single Window

yacht in docker

Python Web App From Scratch Round 2 With Justin Mitchel!

You might also like….

Open source plays a crucial role in cloud computing explosion featuring Billy Thompson, featured image.

Open Source Plays A Crucial Role In Cloud Computing Explosion | Billy Thompson – Akamai

yacht in docker

Jason Rohrer

yacht in docker

Kasm Workspaces Streams Apps in the Browser as Easy as Opening Apps on your Desktop

yacht in docker

How to Install PiHole on a Linode VPS | Free Open Source DNS sinkhole

Sign up for the “in the node” newsletter.

  • How to manage your docker containers with yacht

How to manage your Docker containers with Yacht

  • User by AddictiveTips Team
  • Calendar Sep 13, 2022
  • Comment No Comments

Docker is a beautiful tool, but it can be hard to manage if you’re unfamiliar with it. Yacht is a program that tries to make things easier by giving users a web UI that can be used to deploy, modify, and manage containers. Here’s how to set up Yacht on your Linux system.

Before we begin

Yacht is an easy-to-use UI for Docker containers . You can use it to edit containers, deploy new ones, manage volumes, and even modify configuration files. However, this software is under heavy development and can sometimes be unstable.

We highly suggest only using Yacht in settings where you aren’t worried about losing valuable data. Be sure to back up your data before using Yacht.

Installing Docker on Linux

Yacht is provided to users through Dockerhub as an image. However, you must install Docker on your system before you attempt to run it. To install Docker on your system, open a terminal window on your server and follow the installation instructions below.

We’ll use Docker via a Snap package on Linux in this guide. Snap is being used because it takes a lot of the difficulty of setting up Docker. To start, you must enable the Snap runtime on your Linux system.

To enable the Snap runtime on Linux, follow our guide on the subject . This guide will go over, in detail, how to set up the Snap package runtime. After setting up the Snap runtime, you can install Docker on your server using the snap install command.

With the Docker tool installed, you can use it as root. However, if you want to use Docker without root, you must enter the following commands in a terminal window.

Pulling the Yacht docker image

You’ll need to pull the Yacht docker image directly from Dockerhub. To pull it to your server (or Linux PC), log into the server’s root account. You can log into root with su .

You likely have the root account locked if you cannot log into the root account. Therefore, you will need to enable it. To enable the root account, do the following.

Set the root password to something secure and memorable. Then, log out of sudo -s with exit.

After logging into the root account, use the following command to create the “yacht” docker volume. This volume will hold all of the Yacht data on the server.

With the new volume created, use the docker run command to pull down your system’s Yacht image from Dockerhub.

Once the image is pulled from Dockerhub, Docker will deploy the image as a container on your system. It will run Yacht on port 8000. You can access the Yacht web UI in any browser with the following URL.

HTTP://local-lan-ip-of-server:8000

Starting the Yacht docker container after installation

Using the docker run command above, Yacht will be deployed via the Docker image and started on Port 8000. However, this command only works for the initial deployment.

If you restart your Linux system, you must use the docker start command to run Yacht. Here’s how.

First, log into the root account using the su – command.

Once logged into the root account, run the docker ps -a command. This command will list all containers on your system. Find the “CONTAINER ID” column and the Yacht container ID.

After copying the Yacht container ID, you can start it up with:

Or, shut it down with:

Logging into Yacht

You’ll need to use the default password and username to log into Yacht. Then, access Yacht via the URL below, enter [email protected] as the user and pass as the password.

Using Yacht

Once you log into Yacht, you’ll be presented with the dashboard. This dashboard will show all running Docker images and their CPU and memory usage.

To manage the containers, click on the Yacht sidebar, select “Applications,” and select your container. Then, once you’ve chosen the container, you’ll see detailed information, including port information, control buttons, running processes, logs, etc.

Manage volumes

It is possible to manage Docker volumes in Yacht. To do it, select the Yacht sidebar, choose “Resources,” and select “Volumes.” From here, you’ll be able to access both used and unused Docker volumes.

Manage Networks

Need to access your Docker network settings? Select the Yacht sidebar, and select the “Network” option. Once you’ve accessed this area, you’re free to modify networking settings, interfaces, etc.

Manage images

If you need to manage Docker images, select the Yacht sidebar, choose the “Resources” button, and click on “Images.” Once inside “Images,” Yacht will let you manage your Docker images.

default avatar image

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed .

Searching for something else?

Chances are, we can find what you're looking for:

DB Tech Reviews

Yacht Installed on Docker – Portainer Alternative

In OpenMediaVault , Tutorials , Video by dbtech September 24, 2020

In this video we’re going to take a look at a Docker application called Yacht.

“Yacht is an alternative to Portainer that aims to make docker more accessible to the everyday person and is focused on selfhosters instead of the enterprise.” – SelfHostedPro

While Yacht operates very much like Portainer, I feel like the interface is more user-friendly and information is more easily available on Yacht than on Portainer.

About Yacht

Yacht’s home screen is a dashboard of all your running containers with information about the memory and CPU being used by each container in real time.

yacht dashboard

From there, you can click the title of any of the containers and get more information about it.

yacht container stats

There are a couple of different ways to install applications. The first way to install an application is by clicking on the “New Application” button on the left side and then filling in each of the black fields for the 4 different steps.

yacht manual install steps

Once you fill out each page, you can then click the “Continue” button and move to the next step. When you get to step 4, you can then deploy the container as you would in Portainer.

Another way is to use templates, again like in Portainer. I’m using the template that was shared on SelfHostedPro’s Yacht page as it’s a great starting point.

yacht templates

Click on the “Deploy” button under the application you’d like to install and you’ll be presented with a familiar screen, but this time, most of the data is already filled out!

yacht template filled out

That’s the basic idea behind Yacht. Please keep in mind that this is still in early development so there may be bugs or things to report. Bugs can be reported via Github or Discord .

Installing Yacht

Installing Yacht is pretty simple as it only takes 2 SSH commands to install.

First, we’ll create a volume:

Then we’ll install the container:

You might need to change the 8000 port to something else if you already have Portainer installed on port 8000.

That’s all there is to installing Yacht. The login credentials are:

  • [email protected]

This has been tested to work with x86 processors as well as Arm processors, so you should be able to install it on just about any hardware you have laying around.

Github: https://github.com/SelfhostedPro/Yacht

Discord: https://discord.gg/srRUF5S

OpenMediaVault Tutorials

If you’re interested in other tutorials for your home server, check here: https://dbtechreviews.com/category/openmediavault/

/=========================================/

Like what I do? Want to be generous and help support my channel?

Here are some ways to support:

Patreon: https://dbte.ch/patreon

Ko-fi: https://dbte.ch/kofi

Remember to leave a like on this video and subscribe if you want to see more!

Twitter: https://dbte.ch/tw

Facebook: https://dbte.ch/fb

Subscribe: https://dbte.ch/ytsub

Virtualization Howto

Yacht vs. Portainer – Docker dashboard comparison

f50b052b cc32 46c3 9fe0 d37121b3b121

  • A call out to a feature that I would like to see on a Yacht machine is the ability to access your containers CLI from the Yacht GUI.
  • When you start working with Docker or containers in general, one of the first things you will probably want is some type of GUI to help with day-to-day workflows and operations for managing Docker containers and Docker apps with an easy-to-access web interface.
  • It is considered to be a Portainer alternative and provides many of the same features in a yacht compare Portainer comparison.

When you start working with Docker or containers in general, one of the first things you will probably want is some type of GUI to help with day-to-day workflows and operations for managing Docker containers and Docker apps with an easy-to-access web interface. There are a couple of solutions out there providing great Docker containers dashboard solutions, Yacht and Portainer. Let’s look at Yacht vs. Portainer and see what features and capabilities each offers.

Take a look at my video comparison of the two products here:

Why a Docker containers dashboard solution?

As you get into working with Docker containers, having a GUI tool to interact with your containers saves time and helps to visualize the Docker app’s infrastructure. Docker has a very robust command line interface, allowing you to do basically anything you need to do from the command line.

However, for newbies starting out and day-to-day management, the command line can be cumbersome for carrying out the required activities. A point-and-click interface to navigate your Docker infrastructure offers many advantages for managing Docker applications.

What is Yacht?

To begin, what is Yacht? Yacht is a web interface for managing Docker containers and focuses on templating. With templates, you can have one-click deployments of dockerized applications.

yacht in docker

Yacht refers to this as a decentralized app store for servers for which you can make packages in your environment. It is considered to be a Portainer alternative and provides many of the same features in a yacht compare Portainer comparison.

Features of Yacht

Comparing Yacht vs. Portainer, Yacht provides many features for those wanting to manage their Docker apps and containers. Those include the following:

Templating functionality (Portainer compatible)

Container management (basic features)

Updating templates

Use template variables for one-click deployment

Container deployment wizard

Docker containers dashboard for seeing all containers in one place

Docker compose support and editor

One-click editing of containers and lifecycle management

Ability to view logs

Create Projects (Docker compose)

Nice menu driven interface from the left side

So, Yacht allows you to run multi-container applications with a GUI dashboard interface to interact with your containers from a simple website interface.

Compose Support

Yacht does include Docker compose support, using the built-in Projects included with Yacht. Using the Projects feature, you can enter a new Compose Template.

yacht in docker

Missing features currently

A call out to a feature that I would like to see on a Yacht machine is the ability to access your containers CLI from the Yacht GUI. This is a feature that Yacht mentions are coming soon.

The features marked as “coming soon” currently include the following:

User Management

Container CLI attachment

Another feature in Yacht that isn’t quite as good as Portainer is the App

Podman support

One cool feature that I like with Yacht is it is compatible with Podman. You can perform the same installation with Podman as you can with Docker:

Yacht install

If you are not installing in a self-hosted Docker server , there are a few options for installing Yacht. These include Docker, OpenMediaVault, Docker Compose, or DockSTARTer. The process to install Yacht in a self-hosted environment is super simple.

Self-hosted Yacht install example

For a self-hosted Docker instance, you have two lines to enter to get up and running:

Many who want to try out Yacht may already be running Portainer. If that is the case, you will need to adjust the external port 8000 to 8001 or something else to run them side-by-side.

yacht in docker

Log in with the [email protected] pass credentials.

yacht in docker

What is Portainer?

Portainer is a well-known container management platform providing a rich GUI interface to work with your containers, applications, templates, config maps, secrets, etc. It helps to reduce the complexity of container adoption and addresses security challenges.

Portainer works with more than Docker

Comparing Yacht vs. Portainer, Portainer is not only a tool that understands Docker apps, it also understands and works with Docker, Swarm, Nomad, and Kubernetes. Comparing Portainer to Yacht, it is a much more fully-featured tool that is also much more polished in its look and feel. It has been around longer and shows from a feature and useability standpoint.

Below is the overview dashboard of the Portainer connected to a Docker host.

yacht in docker

Looking at your list of running containers.

yacht in docker

Portainer features

Portainer has many great features, including:

Overview dashboard

Image management

Built-in app templates

Visibility of Docker networking

Volumes, events, and host configuration

Ability to implement stacks using Docker Compose

Docker exec console – Managing Docker containers

Using the Docker exec console provides a great way to access the Docker CLI when needed from the Docker dashboard. As this is currently a feature missing from Yacht, Portainer is the tool of choice if this is a requirement. Honestly, it is a great feature to be able to expect to the console when needed directly from your Docker container dashboard.

Portainer install

The Portainer installation is very similar to Yacht. It is a couple of commands to get started with a self-hosted environment:

Portainer Community Edition vs. Business Edition

There are two versions of Portainer available – Community Edition and Business Edition. To note the difference between those two versions, Community Edition is free and open-source software. It is designed for individuals, home lab users, or very small environments that want to use Portainer.

Business Edition is commercially supported software. It includes features with Security, Access Management, Permissions, Auditing, and making ensuring you want to take Portainer into production.

Final Thoughts comparing Yacht vs. Portainer

Looking at Yacht vs. Portainer, both Yacht and Portainer are excellent free and open-source tools allowing you to manage and configure your Docker containers in a web interface using a modern GUI. Yacht is definitely the newer and less fully-featured tools of the two. I really like what I see with Yacht. However, it is missing some of the bells and whistles provided by Portainer, like exec CLI support from the interface.

Portainer also provides Kubernetes integration which does not appear to be supported by Yacht. Yacht has documented support for Podman, which isn’t shown with Portainer, although several blog posts cover how to install Portainer with Podman.

Check out Yacht here: Welcome To Yacht | Yacht

Check out Portainer here: Powerful container management software for Platform Teams, DevOps, Dev ( portainer.io )

Subscribe to VirtualizationHowto via Email 🔔

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Email Address

Photo of Brandon Lee

Brandon Lee

Related articles.

yacht in docker

Best docker containers for Synology NAS

The best Docker container commands you need to know

Best Docker Containers Commands You Need to Know

yacht in docker

Docker Desktop Starting Forever Windows 11 or 10 Error

Docker architecture and components

Best Docker Containers for Home Server

Leave a reply cancel reply.

Your email address will not be published. Required fields are marked *

Notify me of new posts by email.

This site uses Akismet to reduce spam. Learn how your comment data is processed .

Getting Started

Beginners guide ​.

This guide will take you through setting up Yacht, adding your first template, and deploying your first app.

Setting Up Yacht ​

Running Yacht is as simple as running the following two commands:

After that you can access Yacht on port 8000 on your server in a web browser.

  • If you're using Yacht alongside portainer, you'll want to change the 8000 on the left of the : to 8001, then it will be available on that port on your host.
  • If SELinux is enabled on the host, you'll need to pass the --privileged flag to docker when deploying Yacht.

Once you're at the login page you can login with the username [email protected] and the password pass .

Template Variables ​

We'll setup template variables so that if you're using a template built for Yacht, you'll be able to have all of your files mounted in the correct places.

Click on the Settings cog in the left sidebar and then click on Template Variables along the top.

Replace the paths on the right with where you want each variable to be mounted. (This will typically be in your file shares if you're using a NAS).

Add any additional Variables you would like and when you're done, hit save at the bottom.

Adding a Template ​

To add a template, click on the Folder icon in the left sidebar and then on "New Template". If you don't have a template added yet it'll recommend you add the one that I maintain for Yacht. Once you've entered a name and URL you'll click submit.

Now that you're on the "View Templates" page you can click on the template you added to see all the apps included with your template.

From the "View Templates" page you can also click on the 3 dots and from there you can update if there are any changes, view the template, or delete the template.

Deploying from a Template ​

Now that you have a template added let's deploy an application. Click on your template to view it. Then pick an app to deploy. You can click on view to see any details about the application.

Once you've got an app in mind click on deploy and you'll be taken to the deploy form. Everything should be filled out for you but double check that it all looks correct. Click on continue until you get to the last page and then click on Deploy.

Now you'll see your running app. You can click on it to view more detailed stats or click on the Arrow to the right of the name to perform an action with it.

  • Beginners Guide
  • Setting Up Yacht
  • Template Variables
  • Adding a Template
  • Deploying from a Template

Docker Best Practices: Choosing Between RUN, CMD, and ENTRYPOINT

yacht in docker

Jay Schmidt

Docker’s flexibility and robustness as a containerization tool come with a complexity that can be daunting. Multiple methods are available to accomplish similar tasks, and users must understand the pros and cons of the available options to choose the best approach for their projects.

One confusing area concerns the RUN , CMD , and ENTRYPOINT Dockerfile instructions. In this article, we will discuss the differences between these instructions and describe use cases for each.

2400x1260 choosing between run cmd and entrypoint

The RUN instruction is used in Dockerfiles to execute commands that build and configure the Docker image. These commands are executed during the image build process, and each RUN instruction creates a new layer in the Docker image. For example, if you create an image that requires specific software or libraries installed, you would use RUN to execute the necessary installation commands.

The following example shows how to instruct the Docker build process to update the apt cache and install Apache during an image build:

RUN instructions should be used judiciously to keep the image layers to a minimum, combining related commands into a single RUN instruction where possible to reduce image size.

The CMD instruction specifies the default command to run when a container is started from the Docker image. If no command is specified during the container startup (i.e., in the docker run command), this default is used. CMD can be overridden by supplying command-line arguments to docker run .

CMD is useful for setting default commands and easily overridden parameters. It is often used in images as a way of defining default run parameters and can be overridden from the command line when the container is run. 

For example, by default, you might want a web server to start, but users could override this to run a shell instead:

Users can start the container with docker run -it <image> /bin/bash to get a Bash shell instead of starting Apache.  

The ENTRYPOINT instruction sets the default executable for the container. It is similar to CMD but is overridden by the command-line arguments passed to docker run . Instead, any command-line arguments are appended to the ENTRYPOINT command.

Note: Use ENTRYPOINT when you need your container to always run the same base command, and you want to allow users to append additional commands at the end. 

ENTRYPOINT is particularly useful for turning a container into a standalone executable. For example, suppose you are packaging a custom script that requires arguments (e.g., “my_script extra_args” ). In that case, you can use ENTRYPOINT to always run the script process ( “my_script” ) and then allow the image users to specify the “extra_args” on the docker run command line. You can do the following:

Combining CMD and ENTRYPOINT

The CMD instruction can be used to provide default arguments to an ENTRYPOINT if it is specified in the exec form. This setup allows the entry point to be the main executable and CMD to specify additional arguments that can be overridden by the user.

For example, you might have a container that runs a Python application where you always want to use the same application file but allow users to specify different command-line arguments:

Running docker run myimage --user-arg executes python /app/my_script.py --user-arg .

The following table provides an overview of these commands and use cases.

Command description and use cases

Defines the default executable of a Docker image. It can be overridden by arguments.Utility images allow users to pass different executables and arguments on the command line.
Defines the default executable. It can be overridden by the arguments.Images built for a specific purpose where overriding the default executable is not desired.
Executes commands to build layers.Building an image

What is PID 1 and why does it matter?

In the context of Unix and Unix-like systems, including Docker containers, PID 1 refers to the first process started during system boot. All other processes are then started by PID 1, which in the process tree model is the parent of every process in the system. 

In Docker containers, the process that runs as PID 1 is crucial, because it is responsible for managing all other processes inside the container. Additionally, PID 1 is the process that reviews and handles signals from the Docker host. For example, a SIGTERM into the container will be caught and processed by PID 1, and the container should gracefully shut down.

When commands are executed in Docker using the shell form, a shell process ( /bin/sh -c ) typically becomes PID 1. Still, it does not properly handle these signals, potentially leading to unclean shutdowns of the container. In contrast, when using the exec form, the command runs directly as PID 1 without involving a shell, which allows it to receive and handle signals directly. 

This behavior ensures that the container can gracefully stop, restart, or handle interruptions, making the exec form preferable for applications that require robust and responsive signal handling.

Shell and exec forms

In the previous examples, we used two ways to pass arguments to the RUN , CMD , and ENTRYPOINT instructions. These are referred to as shell form and exec form. 

Note: The key visual difference is that the exec form is passed as a comma-delimited array of commands and arguments with one argument/command per element. Conversely, shell form is expressed as a string combining commands and arguments. 

Each form has implications for executing commands within containers, influencing everything from signal handling to environment variable expansion. The following table provides a quick reference guide for the different forms.

Shell and exec form reference

Takes the form of . or
Takes the form of . or

In the shell form, the command is run in a subshell, typically /bin/sh -c on Linux systems. This form is useful because it allows shell processing (like variable expansion, wildcards, etc.), making it more flexible for certain types of commands (see this shell scripting article for examples of shell processing). However, it also means that the process running your command isn’t the container’s PID 1, which can lead to issues with signal handling because signals sent by Docker (like SIGTERM for graceful shutdowns) are received by the shell rather than the intended process.

The exec form does not invoke a command shell. This means the command you specify is executed directly as the container’s PID 1, which is important for correctly handling signals sent to the container. Additionally, this form does not perform shell expansions, so it’s more secure and predictable, especially for specifying arguments or commands from external sources.

Putting it all together

To illustrate the practical application and nuances of Docker’s RUN , CMD , and ENTRYPOINT instructions, along with the choice between shell and exec forms, let’s review some examples. These examples demonstrate how each instruction can be utilized effectively in real-world Dockerfile scenarios, highlighting the differences between shell and exec forms. 

Through these examples, you’ll better understand when and how to use each directive to tailor container behavior precisely to your needs, ensuring proper configuration, security, and performance of your Docker containers. This hands-on approach will help consolidate the theoretical knowledge we’ve discussed into actionable insights that can be directly applied to your Docker projects.

RUN instruction

For RUN , used during the Docker build process to install packages or modify files, choosing between shell and exec form can depend on the need for shell processing. The shell form is necessary for commands that require shell functionality, such as pipelines or file globbing. However, the exec form is preferable for straightforward commands without shell features, as it reduces complexity and potential errors.

CMD and ENTRYPOINT

These instructions control container runtime behavior. Using exec form with ENTRYPOINT ensures that the container’s main application handles signals directly, which is crucial for proper startup and shutdown behavior.   CMD can provide default parameters to an ENTRYPOINT defined in exec form, offering flexibility and robust signal handling.

Signal handling and flexibility

Using ENTRYPOINT in exec form and CMD to specify parameters ensures that Docker containers can handle operating system signals gracefully, respond to user inputs dynamically, and maintain secure and predictable operations. 

This setup is particularly beneficial for containers that run critical applications needing reliable shutdown and configuration behaviors. The following table shows key differences between the forms.

Key differences between shell and exec

Commands without brackets. Run by the container’s shell, e.g., .Commands with brackets. Run directly, not through a shell.
Inherits environment variables from the shell, such as and .Does not inherit shell environment variables but behaves the same for instruction variables.
Supports sub-commands, piping output, chaining commands, I/O redirection, etc.Does not support shell features.
Most shells do not forward process signals to child processes.Directly traps and forwards signals like .
Can cause issues with signal forwarding.Recommended due to better signal handling.
Not possible with the shell form.If the first item in the array is not a command, all items are used as parameters for the .

Figure 1 provides a decision tree for using RUN , CMD , and ENTRYPOINT in building a Dockerfile.

2400x1260 run cmd entrypoint

Figure 2 shows a decision tree to help determine when to use exec form or shell form.

2400x1260 decision tree exec vs shell

The following section will walk through the high-level differences between CMD and ENTRYPOINT . In these examples, the RUN command is not included, given that the only decision to make there is easily handled by reviewing the two different formats.

Test Dockerfile

First build.

We will build this image and tag it as ab .

Run with CMD ab

Without any arguments, we get a usage block as expected.

However, if I run ab and include a URL to test, I initially get an error:

The issue here is that the string supplied on the command line — https://jayschmidt.us — is overriding the CMD instruction, and that is not a valid command, resulting in an error being thrown. So, we need to specify the command to run:

Run with ENTRYPOINT

In this run, we remove the CMD ab instruction from the Dockerfile, replace it with ENTRYPOINT ["ab"] , and then rebuild the image.

This is similar to but different from the CMD command — when you use ENTRYPOINT , you cannot override the command unless you use the –entrypoint flag on the docker run command. Instead, any arguments passed to docker run are treated as arguments to the ENTRYPOINT .

What about syntax?

In the example above, we use ENTRYPOINT ["ab"] syntax to wrap the command we want to run in square brackets and quotes. However, it is possible to specify ENTRYPOINT ab (without quotes or brackets). 

Let’s see what happens when we try that.

Your first thought will likely be to re-run the docker run command as we did for CMD ab above, which is giving both the executable and the argument:

This is because ENTRYPOINT can only be overridden if you explicitly add the –entrypoint argument to the docker run command. The takeaway is to always use ENTRYPOINT when you want to force the use of a given executable in the container when it is run.

Wrapping up: Key takeaways and best practices

The decision-making process involving the use of RUN , CMD , and ENTRYPOINT , along with the choice between shell and exec forms, showcases Docker’s intricate nature. Each command serves a distinct purpose in the Docker ecosystem, impacting how containers are built, operate, and interact with their environments. 

By selecting the right command and form for each specific scenario, developers can construct Docker images that are more reliable, secure, and optimized for efficiency. This level of understanding and application of Docker’s commands and their formats is crucial for fully harnessing Docker’s capabilities. Implementing these best practices ensures that applications deployed in Docker containers achieve maximum performance across various settings, enhancing development workflows and production deployments.

  • Stay updated on the latest Docker news! Subscribe to the Docker Newsletter .
  • Get the latest release of Docker Desktop .
  • New to Docker? Get started .
  • Have questions? The Docker community is here to help .

Docker Desktop 4.32: Beta Releases of Compose File Viewer, Terminal Shell Integration, and Volume Backups to Cloud Providers

How an ai assistant can help configure your project’s git hooks, how to run hugging face models programmatically using ollama and testcontainers.

Jul 15, 2024

  • Engineering

IMAGES

  1. A Step-by-Step Guide to Installing the Yacht Docker GUI

    yacht in docker

  2. Yacht

    yacht in docker

  3. Yacht Installed on Docker

    yacht in docker

  4. Yacht vs Portainer

    yacht in docker

  5. Yacht Docker Management Install and Overview! (Portainter Alternative!)

    yacht in docker

  6. Manage Docker Containers with Yacht Web Interface

    yacht in docker

VIDEO

  1. €899,000 Trawler Style Explorer Yacht ‘Poolster’ (3,000 NM Range)

  2. SEI NUOVE MISSIONI DELLO YACHT GTA 5 ONLINE

  3. Red Hat Quay: Building a Docker/Container image for Quay in Red Hat OpenShift

  4. My New Command!!!

  5. Why This Vessel??? Live

  6. NAS case for Raspberry pi4 DeskPi Pro v2

COMMENTS

  1. Welcome To Yacht

    Yacht lets you focus on what apps you want to run instead of worrying about how to deploy them. Compose Support Out of The Box. Managing large docker projects has never been easier. Import compose projects you're already using or write new ones easily using the built in editor. Docs. Getting Started; Projects;

  2. Install Yacht

    Installing Yacht via OpenMediaVault can be done through OMV-Extras. Installation instructions for OMV-Extras can be found here. Once OMV-Extras is installed you'll need to do the following steps: In OMV go to OMV-Extras -> Docker; Click on "Docker" and then "Install" (Optional) Click on advanced under "Yacht (Alpha)" and select the port you ...

  3. Getting Started

    After that you can access Yacht on port 8000 on your server in a web browser. If you're using Yacht alongside portainer you'll want to change the 8000 on the left of the : to 8001, then it will be available on that port on your host.. Once you're at the login page you can login with the username [email protected] and the password pass.. Template Variables

  4. GitHub

    A web interface for managing docker containers with an emphasis on templating to provide 1 click deployments. Think of it like a decentralized app store for servers that anyone can make packages for. - SelfhostedPro/Yacht

  5. Beginners Guide · SelfhostedPro/Yacht Wiki · GitHub

    A web interface for managing docker containers with an emphasis on templating to provide 1 click deployments. Think of it like a decentralized app store for servers that anyone can make packages for. - Beginners Guide · SelfhostedPro/Yacht Wiki

  6. A Step-by-Step Guide to Installing the Yacht Docker GUI

    5. Execute the docker run command below to download the Yacht Docker GUI image from Docker Hub and create a container called yacht (arbitrary) based on the image.. Once completed, you will have a Yacht Docker GUI container running, which is accessible through port 8000 with the following command breakdown:. d - This flag runs the container in the background (detached mode) without attaching ...

  7. Manage Docker Containers from the Web with Yacht

    Manage Docker Containers from a Web UI with Yacht Interactive Dashboards. In this video, Brandon from @TechHut shows you how to install and use Yacht, an interactive dashboard for installing and managing Docker containers on your system. Yacht is great for visualizing and maintaining your Docker infrastructure. Chapters: 0:00 - Introduction.

  8. Install Yacht

    Click on "Docker" and then "Install" (Optional) Click on advanced under "Yacht (Alpha)" and select the port you want to use. Once docker is installed click on "Yacht" and then "Install" Once it's installed you can use the button to open Yacht. via Docker Compose The following is an example docker-compose.yml file to deploy Yacht:

  9. Manage Docker Containers from a Web UI with Yacht Interactive ...

    In this video, Brandon from @TechHut shows you how to install and use Yacht, an interactive dashboard for installing and managing Docker containers on your ...

  10. How to manage your Docker containers with Yacht

    First, log into the root account using the su - command. su -. Once logged into the root account, run the docker ps -a command. This command will list all containers on your system. Find the "CONTAINER ID" column and the Yacht container ID. After copying the Yacht container ID, you can start it up with:

  11. Intro

    Features #. Container templating compatibility (Portainer compatible) Basic container management. Easy template updating. Template Variables to allow for a one-click experience. Guided container deployment. Dashboard for monitoring all of your docker containers in one place. Docker-compose compatibility and editor. One click editing of containers.

  12. Yacht Installed on Docker

    "Yacht is an alternative to Portainer that aims to make docker more accessible to the everyday person and is focused on selfhosters instead of the enterprise." - SelfHostedPro. While Yacht operates very much like Portainer, I feel like the interface is more user-friendly and information is more easily available on Yacht than on Portainer.

  13. Intro

    Intro | Yacht. Welcome. Intro. Intro. A web interface for managing docker containers with an emphasis on templating to provide one-click deployments of dockerized applications. Think of it like a decentralized app store for servers that anyone can make packages for. Additional support and community assistance can be found in our Discord group ...

  14. How to Manage Docker Containers with a GUI using Yacht

    Introduction. Yacht is a container management tool that offers a graphical user interface (GUI) for easy deployment of Docker containers. It uses templates to offer 1 click deployment of containers for easy setup and management on your server.

  15. Yacht

    About Press Copyright Contact us Creators Advertise Developers Terms Privacy Policy & Safety How YouTube works Test new features NFL Sunday Ticket Press Copyright ...

  16. Yacht vs. Portainer

    Comparing Portainer to Yacht, it is a much more fully-featured tool that is also much more polished in its look and feel. It has been around longer and shows from a feature and useability standpoint. Below is the overview dashboard of the Portainer connected to a Docker host. Looking at your list of running containers.

  17. Getting Started

    After that you can access Yacht on port 8000 on your server in a web browser. If you're using Yacht alongside portainer, you'll want to change the 8000 on the left of the : to 8001, then it will be available on that port on your host.; If SELinux is enabled on the host, you'll need to pass the --privileged flag to docker when deploying Yacht.; Once you're at the login page you can login with ...

  18. Docker Hub Container Image Library

    Yacht is a Docker management tool that allows you to easily deploy and manage containerized applications. With Yacht, you can browse, search, and run images from Docker Hub, the world's largest container registry, or from your own private repositories. Yacht also provides a web interface, a REST API, and a CLI for managing your containers.

  19. Projects

    Projects. Docker-compose projects are a container orchestration tool to help manage containers that need to talk to each other. Yacht provides an in browser docker-compose editor as well as a way to manage them easily via the projects tab in the yacht UI. The easiest way to get started is to find a project that you want to launch, then click on ...

  20. Yacht One-click deployment for docker images : r/docker

    Yacht is fully community based and focused on making it easy for anyone to get into docker. I try to stick to official terminology (ie. docker-compose projects vs 'stacks') for everything and use the built in docker apis in order to keep terminology consistent when you want to move to more advanced stuff.

  21. How to install Yacht on Linux Server for Docker

    In this post, I'll show you how to install Yacht on your Linux server. yacht is a web interface for managing Docker containers that offers an easy-to-use dashboard to monitor and manage your containers. Table of Contents: What is Yacht? Install Docker; Install Yacht; Change the default login credentials; Reset Yacht Password/Username(optional)

  22. Advanced Projects

    More advanced projects often require that you clone an entire git repository and pass through a veriety of files. As an example of such project you can look at docker-elk. For a larger project like this, it is best to directly access Yacht's configuration folder and clone the repository inside. For easy editing and persistance you will need to ...

  23. Docker Best Practices: Choosing Between RUN, CMD, and ENTRYPOINT

    Users can start the container with docker run -it <image> /bin/bash to get a Bash shell instead of starting Apache.. ENTRYPOINT. The ENTRYPOINT instruction sets the default executable for the container. It is similar to CMD but is overridden by the command-line arguments passed to docker run.Instead, any command-line arguments are appended to the ENTRYPOINT command.

  24. Requirements

    The latest version of docker is recommended. Instructions for how to install it are available here. Edit this page. Previous « Intro. Next. Install Yacht » ...