Skip to content

Commit

Permalink
Updated README.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlesage committed Jul 5, 2024
1 parent 9bc78f9 commit a69d541
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ docker run [-d] \
| Parameter | Description |
|-----------|-------------|
| -d | Run the container in the background. If not set, the container runs in the foreground. |
| -e | Pass an environment variable to the container. See the [Environment Variables](#environment-variables) section for more details. |
| -v | Set a volume mapping (allows to share a folder/file between the host and the container). See the [Data Volumes](#data-volumes) section for more details. |
| -p | Set a network port mapping (exposes an internal container port to the host). See the [Ports](#ports) section for more details. |
| -d | Run the container in the background. If not set, the container runs in the foreground. |
| -e | Pass an environment variable to the container. See the [Environment Variables](#environment-variables) section for more details. |
| -v | Set a volume mapping (allows to share a folder/file between the host and the container). See the [Data Volumes](#data-volumes) section for more details. |
| -p | Set a network port mapping (exposes an internal container port to the host). See the [Ports](#ports) section for more details. |
### Environment Variables
To customize some properties of the container, the following environment
variables can be passed via the `-e` parameter (one for each variable). Value
variables can be passed via the `-e` parameter (one for each variable). Value
of this parameter has the format `<VARIABLE_NAME>=<VALUE>`.
| Variable | Description | Default |
Expand All @@ -108,7 +108,7 @@ of this parameter has the format `<VARIABLE_NAME>=<VALUE>`.
#### Deployment Considerations
Many tools used to manage Docker containers extract environment variables
defined by the Docker image and use them to create/deploy the container. For
defined by the Docker image and use them to create/deploy the container. For
example, this is done by:
- The Docker application on Synology NAS
- The Container Station on QNAP NAS
Expand All @@ -120,33 +120,33 @@ variables to fit its needs, it can also be confusing and dangerous to keep all
of them.
A good practice is to set/keep only the variables that are needed for the
container to behave as desired in a specific setup. If the value of variable is
kept to its default value, it means that it can be removed. Keep in mind that
container to behave as desired in a specific setup. If the value of variable is
kept to its default value, it means that it can be removed. Keep in mind that
all variables are optional, meaning that none of them is required for the
container to start.
Removing environment variables that are not needed provides some advantages:
- Prevents keeping variables that are no longer used by the container. Over
- Prevents keeping variables that are no longer used by the container. Over
time, with image updates, some variables might be removed.
- Allows the Docker image to change/fix a default value. Again, with image
- Allows the Docker image to change/fix a default value. Again, with image
updates, the default value of a variable might be changed to fix an issue,
or to better support a new feature.
- Prevents changes to a variable that might affect the correct function of
the container. Some undocumented variables, like `PATH` or `ENV`, are
required to be exposed, but are not meant to be changed by users. However,
the container. Some undocumented variables, like `PATH` or `ENV`, are
required to be exposed, but are not meant to be changed by users. However,
container management tools still show these variables to users.
- There is a bug with the Container Station on QNAP and the Docker application
on Synology, where an environment variable without value might not be
allowed. This behavior is wrong: it's absolutely fine to have a variable
without value. In fact, this container does have variables without value by
default. Thus, removing unneeded variables is a good way to prevent
allowed. This behavior is wrong: it's absolutely fine to have a variable
without value. In fact, this container does have variables without value by
default. Thus, removing unneeded variables is a good way to prevent
deployment issue on these devices.
### Data Volumes
The following table describes data volumes used by the container. The mappings
are set via the `-v` parameter. Each mapping is specified with the following
The following table describes data volumes used by the container. The mappings
are set via the `-v` parameter. Each mapping is specified with the following
format: `<HOST_DIR>:<CONTAINER_DIR>[:PERMISSIONS]`.
| Container path | Permissions | Description |
Expand All @@ -158,8 +158,8 @@ format: `<HOST_DIR>:<CONTAINER_DIR>[:PERMISSIONS]`.
Here is the list of ports used by the container.
When using the default bridge network, ports can be mapped to the host via the
`-p` parameter (one per port mapping). Each mapping is defined with the
following format: `<HOST_PORT>:<CONTAINER_PORT>`. The port number used inside
`-p` parameter (one per port mapping). Each mapping is defined with the
following format: `<HOST_PORT>:<CONTAINER_PORT>`. The port number used inside
the container might not be changeable, but you are free to use any port on the
host side.
Expand All @@ -178,7 +178,7 @@ As can be seen, environment variables, volume and port mappings are all specifie
while creating the container.
The following steps describe the method used to add, remove or update
parameter(s) of an existing container. The general idea is to destroy and
parameter(s) of an existing container. The general idea is to destroy and
re-create the container:
1. Stop the container (if it is running):
Expand All @@ -205,7 +205,7 @@ docker rm nginx-proxy-manager
Here is an example of a `docker-compose.yml` file that can be used with
[Docker Compose](https://docs.docker.com/compose/overview/).
Make sure to adjust according to your needs. Note that only mandatory network
Make sure to adjust according to your needs. Note that only mandatory network
ports are part of the example.
```yaml
Expand All @@ -223,11 +223,11 @@ services:
## Docker Image Versioning
Each release of a Docker image is versioned. Prior to october 2022, the
Each release of a Docker image is versioned. Prior to october 2022, the
[semantic versioning](https://semver.org) was used as the versioning scheme.
Since then, versioning scheme changed to
[calendar versioning](https://calver.org). The format used is `YY.MM.SEQUENCE`,
[calendar versioning](https://calver.org). The format used is `YY.MM.SEQUENCE`,
where:
- `YY` is the zero-padded year (relative to year 2000).
- `MM` is the zero-padded month.
Expand All @@ -238,10 +238,10 @@ where:
Because features are added, issues are fixed, or simply because a new version
of the containerized application is integrated, the Docker image is regularly
updated. Different methods can be used to update the Docker image.
updated. Different methods can be used to update the Docker image.
The system used to run the container may have a built-in way to update
containers. If so, this could be your primary way to update Docker images.
containers. If so, this could be your primary way to update Docker images.
An other way is to have the image be automatically updated with [Watchtower].
Watchtower is a container-based solution for automating Docker image updates.
Expand Down Expand Up @@ -279,12 +279,12 @@ container image.
2. Click on *Registry* in the left pane.
3. In the search bar, type the name of the container (`jlesage/nginx-proxy-manager`).
4. Select the image, click *Download* and then choose the `latest` tag.
5. Wait for the download to complete. A notification will appear once done.
5. Wait for the download to complete. A notification will appear once done.
6. Click on *Container* in the left pane.
7. Select your Nginx Proxy Manager container.
8. Stop it by clicking *Action*->*Stop*.
9. Clear the container by clicking *Action*->*Reset* (or *Action*->*Clear* if
you don't have the latest *Docker* application). This removes the
you don't have the latest *Docker* application). This removes the
container while keeping its configuration.
10. Start the container again by clicking *Action*->*Start*. **NOTE**: The
container may temporarily disappear from the list while it is re-created.
Expand All @@ -300,8 +300,8 @@ For unRAID, a container image can be updated by following these steps:
## User/Group IDs
When using data volumes (`-v` flags), permissions issues can occur between the
host and the container. For example, the user within the container may not
exist on the host. This could prevent the host from properly accessing files
host and the container. For example, the user within the container may not
exist on the host. This could prevent the host from properly accessing files
and folders on the shared volume.
To avoid any problem, you can specify the user the application should run as.
Expand Down

0 comments on commit a69d541

Please sign in to comment.