|
|
|
|
@@ -50,20 +50,8 @@ You can authenticate to {% data variables.product.prodname_registry %} with Dock
|
|
|
|
|
|
|
|
|
|
To keep your credentials secure, we recommend you save your {% data variables.product.pat_generic %} in a local file on your computer and use Docker's `--password-stdin` flag, which reads your token from a local file.
|
|
|
|
|
|
|
|
|
|
{% ifversion fpt or ghec %}
|
|
|
|
|
{% raw %}
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
cat ~/TOKEN.txt | docker login https://docker.pkg.github.com -u USERNAME --password-stdin
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
{% endraw %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
{% ifversion ghes %}
|
|
|
|
|
{% ifversion ghes %}
|
|
|
|
|
If your instance has subdomain isolation enabled:
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
{% raw %}
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
@@ -71,7 +59,7 @@ cat ~/TOKEN.txt | docker login docker.HOSTNAME -u USERNAME --password-stdin
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
{% endraw %}
|
|
|
|
|
{% ifversion ghes %}
|
|
|
|
|
|
|
|
|
|
If your instance has subdomain isolation disabled:
|
|
|
|
|
|
|
|
|
|
{% raw %}
|
|
|
|
|
@@ -81,11 +69,8 @@ cat ~/TOKEN.txt | docker login HOSTNAME -u USERNAME --password-stdin
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
{% endraw %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
To use this example login command, replace `USERNAME` with your {% data variables.product.github %} username{% ifversion ghes %}, `HOSTNAME` with the URL for {% data variables.location.product_location %},{% endif %} and `~/TOKEN.txt` with the file path to your {% data variables.product.pat_generic %} for {% data variables.product.github %}.
|
|
|
|
|
To use this example login command, replace `USERNAME` with your {% data variables.product.github %} username, `HOSTNAME` with the URL for {% data variables.location.product_location %}, and `~/TOKEN.txt` with the file path to your {% data variables.product.pat_generic %} for {% data variables.product.github %}.
|
|
|
|
|
|
|
|
|
|
For more information, see [Docker login](https://docs.docker.com/engine/reference/commandline/login/#provide-a-password-using-stdin).
|
|
|
|
|
|
|
|
|
|
@@ -109,110 +94,61 @@ For more information, see [Docker login](https://docs.docker.com/engine/referenc
|
|
|
|
|
> IMAGE_NAME VERSION IMAGE_ID 4 weeks ago 1.11MB
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
1. Using the Docker image ID, tag the docker image, replacing OWNER with the name of the personal account or organization that owns the repository, REPOSITORY with the name of the repository containing your project, IMAGE_NAME with name of the package or image,{% ifversion ghes %} HOSTNAME with the hostname of {% data variables.location.product_location %},{% endif %} and VERSION with package version at build time.
|
|
|
|
|
{% ifversion fpt or ghec %}
|
|
|
|
|
1. Using the Docker image ID, tag the Docker image, replacing OWNER with the name of the personal account or organization that owns the repository, REPOSITORY with the name of the repository containing your project, IMAGE_NAME with name of the package or image, HOSTNAME with the hostname of {% data variables.location.product_location %}, and VERSION with package version at build time.
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
docker tag IMAGE_ID docker.pkg.github.com/OWNER/REPOSITORY/IMAGE_NAME:VERSION
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
{% else %}
|
|
|
|
|
{% ifversion ghes %}
|
|
|
|
|
If your instance has subdomain isolation enabled:
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
docker tag IMAGE_ID docker.HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:VERSION
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
{% ifversion ghes %}
|
|
|
|
|
If your instance has subdomain isolation disabled:
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
docker tag IMAGE_ID HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:VERSION
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
1. If you haven't already built a docker image for the package, build the image, replacing OWNER with the name of the personal account or organization that owns the repository, REPOSITORY with the name of the repository containing your project, IMAGE_NAME with name of the package or image, VERSION with package version at build time,{% ifversion ghes %} HOSTNAME with the hostname of {% data variables.location.product_location %},{% endif %} and PATH to the image if it isn't in the current working directory.
|
|
|
|
|
{% ifversion fpt or ghec %}
|
|
|
|
|
1. If you haven't already built a Docker image for the package, build the image, replacing OWNER with the name of the personal account or organization that owns the repository, REPOSITORY with the name of the repository containing your project, IMAGE_NAME with name of the package or image, VERSION with package version at build time, HOSTNAME with the hostname of {% data variables.location.product_location %}, and PATH to the image if it isn't in the current working directory.
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
docker build -t docker.pkg.github.com/OWNER/REPOSITORY/IMAGE_NAME:VERSION PATH
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
{% else %}
|
|
|
|
|
{% ifversion ghes %}
|
|
|
|
|
If your instance has subdomain isolation enabled:
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
docker build -t docker.HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:VERSION PATH
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
{% ifversion ghes %}
|
|
|
|
|
If your instance has subdomain isolation disabled:
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
docker build -t HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:VERSION PATH
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
1. Publish the image to {% data variables.product.prodname_registry %}.
|
|
|
|
|
{% ifversion fpt or ghec %}
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
docker push docker.pkg.github.com/OWNER/REPOSITORY/IMAGE_NAME:VERSION
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
{% else %}
|
|
|
|
|
{% ifversion ghes %}
|
|
|
|
|
If your instance has subdomain isolation enabled:
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
docker push docker.HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:VERSION
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
{% ifversion ghes %}
|
|
|
|
|
If your instance has subdomain isolation disabled:
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
docker push HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:VERSION
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
> [!NOTE]
|
|
|
|
|
> You must push your image using `IMAGE_NAME:VERSION` and not using `IMAGE_NAME:SHA`.
|
|
|
|
|
|
|
|
|
|
### Example publishing a Docker image
|
|
|
|
|
|
|
|
|
|
{% ifversion ghes %}
|
|
|
|
|
These examples assume your instance has subdomain isolation enabled.
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
You can publish version 1.0 of the `monalisa` image to the `octocat/octo-app` repository using an image ID.
|
|
|
|
|
|
|
|
|
|
{% ifversion fpt or ghec %}
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
$ docker images
|
|
|
|
|
|
|
|
|
|
> REPOSITORY TAG IMAGE ID CREATED SIZE
|
|
|
|
|
> monalisa 1.0 c75bebcdd211 4 weeks ago 1.11MB
|
|
|
|
|
|
|
|
|
|
# Tag the image with OWNER/REPO/IMAGE_NAME
|
|
|
|
|
$ docker tag c75bebcdd211 docker.pkg.github.com/octocat/octo-app/monalisa:1.0
|
|
|
|
|
|
|
|
|
|
# Push the image to {% data variables.product.prodname_registry %}
|
|
|
|
|
$ docker push docker.pkg.github.com/octocat/octo-app/monalisa:1.0
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
{% else %}
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
$ docker images
|
|
|
|
|
|
|
|
|
|
@@ -226,23 +162,8 @@ $ docker tag c75bebcdd211 docker.HOSTNAME/octocat/octo-app/monalisa:1.0
|
|
|
|
|
$ docker push docker.HOSTNAME/octocat/octo-app/monalisa:1.0
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
You can publish a new Docker image for the first time and name it `monalisa`.
|
|
|
|
|
|
|
|
|
|
{% ifversion fpt or ghec %}
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
# Build the image with docker.pkg.github.com/OWNER/REPOSITORY/IMAGE_NAME:VERSION
|
|
|
|
|
# Assumes Dockerfile resides in the current working directory (.)
|
|
|
|
|
$ docker build -t docker.pkg.github.com/octocat/octo-app/monalisa:1.0 .
|
|
|
|
|
|
|
|
|
|
# Push the image to {% data variables.product.prodname_registry %}
|
|
|
|
|
$ docker push docker.pkg.github.com/octocat/octo-app/monalisa:1.0
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
{% else %}
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
# Build the image with docker.HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:VERSION
|
|
|
|
|
# Assumes Dockerfile resides in the current working directory (.)
|
|
|
|
|
@@ -252,40 +173,24 @@ $ docker build -t docker.HOSTNAME/octocat/octo-app/monalisa:1.0 .
|
|
|
|
|
$ docker push docker.HOSTNAME/octocat/octo-app/monalisa:1.0
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
## Downloading an image
|
|
|
|
|
|
|
|
|
|
{% data reusables.package_registry.docker_registry_deprecation_status %}
|
|
|
|
|
|
|
|
|
|
You can use the `docker pull` command to install a docker image from {% data variables.product.prodname_registry %}, replacing OWNER with the name of the personal account or organization that owns the repository, REPOSITORY with the name of the repository containing your project, IMAGE_NAME with name of the package or image,{% ifversion ghes %} HOSTNAME with the host name of {% data variables.location.product_location %}, {% endif %} and TAG_NAME with tag for the image you want to install.
|
|
|
|
|
You can use the `docker pull` command to install a docker image from {% data variables.product.prodname_registry %}, replacing OWNER with the name of the personal account or organization that owns the repository, REPOSITORY with the name of the repository containing your project, IMAGE_NAME with name of the package or image, HOSTNAME with the host name of {% data variables.location.product_location %}, and TAG_NAME with tag for the image you want to install.
|
|
|
|
|
|
|
|
|
|
{% ifversion fpt or ghec %}
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
docker pull docker.pkg.github.com/OWNER/REPOSITORY/IMAGE_NAME:TAG_NAME
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
{% else %}
|
|
|
|
|
<!--Versioning out this "subdomain isolation enabled" line because it's the only option for GHES 2.22 so it can be misleading.-->
|
|
|
|
|
{% ifversion ghes %}
|
|
|
|
|
If your instance has subdomain isolation enabled:
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
docker pull docker.HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:TAG_NAME
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
{% ifversion ghes %}
|
|
|
|
|
If your instance has subdomain isolation disabled:
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
docker pull HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:TAG_NAME
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
> [!NOTE]
|
|
|
|
|
> You must pull the image using `IMAGE_NAME:VERSION` and not using `IMAGE_NAME:SHA`.
|
|
|
|
|
|
|
|
|
|
|