<commit_before># Docker Image Tag Deployment

> New as of 0.4.0

```
tags <app>                                     # List all app image tags
tags:create <app> <tag>                        # Add tag to latest running app image
tags:deploy <app> <tag>                        # Deploy tagged app image
tags:destroy <app> <tag>                       # Remove app image tag
```

The Dokku tags plugin allows you to add docker image tags to the currently deployed app image for versioning and subsequent deployment.

> When triggering `dokku ps:rebuild APP` on an application deployed via the `tags` plugin, the following may occur:
>
> - Applications previously deployed via another method (`git`/`tar`): The application may revert to a state before the latest custom image tag was deployed.
> - Applications that were only ever deployed via the `tags` plugin: No action will be taken against your application.
>
> Please use the `tags:deploy` command when redeploying an application deployed via docker image.

## Usage

### Exposed ports

See the [port management documentation](/docs/networking/port-management.md).

### Listing tags for an application

For example, you can list all tags for a given application:

```shell
dokku tags node-js-app
```

```
=====> Image tags for dokku/node-js-app
REPOSITORY          TAG                 IMAGE ID            CREATED              VIRTUAL SIZE
dokku/node-js-app   latest              936a42f25901        About a minute ago   1.025 GB
```

### Creating a tag

You can also create new tags for that app using the `tags:create` function. Tags should conform to the docker tagging specification for your docker version. As of 1.10, that specification is available [here](https://github.com/docker/docker/blob/master/image/spec/v1.1.md), while users of older versions can check the documentation [here](https://github.com/docker/docker/blob/master/image/spec/v1.md).

```shell
dokku tags:create node-js-app v1
```

```
=====> Added v1 tag to dokku/node-js-app
```

Once the tag is created, you can see the output by running the `tags` command again.

```shell
dokku tags node-js-app
```

```
=====> Image tags for dokku/node-js-app
REPOSITORY          TAG                 IMAGE ID            CREATED              VIRTUAL SIZE
dokku/node-js-app   latest              936a42f25901        About a minute ago   1.025 GB
dokku/node-js-app   v1                  936a42f25901        About a minute ago   1.025 GB
```

### Deploying an image tag

Finally, you can also deploy a local image using the `tags:deploy` command. When specifying a tag that is not `latest`, the released image will be retagged as the `latest` image tag for the app.

```shell
dokku tags:deploy node-js-app v1
```
<commit_msg>docs: add a warning concerning the addition of layers to herokuish-based images that are deployed via the tags plugin<commit_after># Docker Image Tag Deployment

> New as of 0.4.0

```
tags <app>                                     # List all app image tags
tags:create <app> <tag>                        # Add tag to latest running app image
tags:deploy <app> <tag>                        # Deploy tagged app image
tags:destroy <app> <tag>                       # Remove app image tag
```

The Dokku tags plugin allows you to add docker image tags to the currently deployed app image for versioning and subsequent deployment.

> When triggering `dokku ps:rebuild APP` on an application deployed via the `tags` plugin, the following may occur:
>
> - Applications previously deployed via another method (`git`/`tar`): The application may revert to a state before the latest custom image tag was deployed.
> - Applications that were only ever deployed via the `tags` plugin: No action will be taken against your application.
>
> Please use the `tags:deploy` command when redeploying an application deployed via docker image.

## Usage

### Exposed ports

See the [port management documentation](/docs/networking/port-management.md).

### Listing tags for an application

For example, you can list all tags for a given application:

```shell
dokku tags node-js-app
```

```
=====> Image tags for dokku/node-js-app
REPOSITORY          TAG                 IMAGE ID            CREATED              VIRTUAL SIZE
dokku/node-js-app   latest              936a42f25901        About a minute ago   1.025 GB
```

### Creating a tag

You can also create new tags for that app using the `tags:create` function. Tags should conform to the docker tagging specification for your docker version. As of 1.10, that specification is available [here](https://github.com/docker/docker/blob/master/image/spec/v1.1.md), while users of older versions can check the documentation [here](https://github.com/docker/docker/blob/master/image/spec/v1.md).

```shell
dokku tags:create node-js-app v1
```

```
=====> Added v1 tag to dokku/node-js-app
```

Once the tag is created, you can see the output by running the `tags` command again.

```shell
dokku tags node-js-app
```

```
=====> Image tags for dokku/node-js-app
REPOSITORY          TAG                 IMAGE ID            CREATED              VIRTUAL SIZE
dokku/node-js-app   latest              936a42f25901        About a minute ago   1.025 GB
dokku/node-js-app   v1                  936a42f25901        About a minute ago   1.025 GB
```

### Deploying an image tag

Finally, you can also deploy a local image using the `tags:deploy` command. When specifying a tag that is not `latest`, the released image will be retagged as the `latest` image tag for the app.

> Warning: For images based on herokuish, using the `tags:deploy` subcommand will reset environment variables written into the image, causing a retag to occur. This will - on average - add two extra layers to your deployed image. Note that this does not affect dockerfile-based images, which are the majority of images deployed via the `tags` command.

```shell
dokku tags:deploy node-js-app v1
```

{'fraction_non_alphanumeric': 0.08441668073611346, 'fraction_numerical': 0.01857166976194496, 'mean_word_length': 2.8170103092783507, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 38, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1343969', 'n_tokens_mistral': 1762, 'n_tokens_neox': 1596, 'n_words': 728}