Skip to content

Commit 6edda60

Browse files
committed
Added docs for image repository
1 parent 0563541 commit 6edda60

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Image repository
2+
3+
Every team gets it's own image repository where they push the images they run on Nais.
4+
5+
When using the [nais/docker-build-push](https://github.com/nais/docker-build-push)-action in your workflow, this repository is used automatically.
6+
7+
## Image Restriction
8+
9+
Nais restricts the use of images from other image registries for two main reasons.
10+
11+
1. We verify that the image has been uploaded either by a authorized Nais user or Github repository.
12+
2. The provided repository uses [Image Streaming](https://cloud.google.com/kubernetes-engine/docs/how-to/image-streaming), ensuring consistently fast start-up times when auto-scaling or during platform maintenance.
13+
14+
## Using third-party images
15+
16+
To use a third-party Docker image, you must upload it to your team’s repository. See the [Upload Third-Party Image](../how-to/upload-image.md) guide for instructions.

docs/workloads/how-to/upload-image.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Upload third-party image to image repository
2+
3+
This how-to guide will show you how to upload a Docker image to your team's image repository.
4+
5+
## Prerequisites
6+
7+
- [Nais CLI](../../operate/cli/how-to/install.md) installed.
8+
- A Docker runtime installed and running on your machine
9+
10+
## Log into Nais
11+
12+
```bash
13+
nais login
14+
```
15+
## Ensure you have the image locally
16+
17+
Ensure the desired image is available on your machine by pulling it from its source or building it locally. For example:
18+
19+
```bash
20+
docker pull repository/my-image:tag --platform linux/amd64
21+
```
22+
23+
!!! note "Specify the platform"
24+
Note that we are adding the `--platform linux/amd64` flag to ensure that the image we are pulling is compatible with the Nais platform.
25+
By default the architecture of the image will be the same as the host machine, which might not work.
26+
27+
## Locate the image repository URL
28+
29+
Find the image repository URL on the settings page in the Nais console
30+
31+
`https://console.<<tenant()>>.cloud.nais.io/team/<MY-TEAM>/settings`
32+
33+
The URL will be on this format:
34+
35+
`europe-north1-docker.pkg.dev/nais-management-<ID>/<MY-TEAM>`
36+
37+
## Tag the image
38+
39+
```bash
40+
docker tag repository/my-image:tag europe-north1-docker.pkg.dev/nais-management-<ID>/<MY-TEAM>/my-image:tag
41+
```
42+
43+
## Push the image
44+
45+
```bash
46+
docker push europe-north1-docker.pkg.dev/nais-management-<ID>/<MY-TEAM>/my-image:tag
47+
```
48+

0 commit comments

Comments
 (0)