|
| 1 | +--- |
| 2 | +meta: |
| 3 | + title: Migrating an external image to the Scaleway Container Registry |
| 4 | + description: Methods to migrate or import an image from an external public container registry to the Scaleway Container Registry. |
| 5 | +content: |
| 6 | + h1: Migrating an external image to the Scaleway Container Registry |
| 7 | + paragraph: Methods to migrate or import an image from an external public container registry to the Scaleway Container Registry. |
| 8 | +tags: serverless jobs registry import copy migrate skopeo docker |
| 9 | +dates: |
| 10 | + validation: 2024-11-06 |
| 11 | + posted: 2021-11-06 |
| 12 | +categories: |
| 13 | + - serverless |
| 14 | +--- |
| 15 | + |
| 16 | +Serverless Jobs rely on container images. These images can be stored in the Scaleway Container Registry, or in external public registries. |
| 17 | + |
| 18 | +<Macro id="container-registry-note" /> |
| 19 | + |
| 20 | +This page explains how to migrate images from public external container registries (such as Docker hub, Amazon container registries, GitHub Container registry, etc.) to the [Scaleway Container registry](/containers/container-registry/#container-registry). |
| 21 | + |
| 22 | +<Macro id="requirements" /> |
| 23 | + |
| 24 | +- A Scaleway account logged into the [console](https://console.scaleway.com) |
| 25 | +- [Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization |
| 26 | +- A valid [API key](/identity-and-access-management/iam/how-to/create-api-keys/) |
| 27 | +- Created a [Container Registry namespace](/containers/container-registry/how-to/create-namespace/) |
| 28 | + |
| 29 | +## Import images using Docker |
| 30 | + |
| 31 | +1. Install the Docker Engine by following the [official documentation](https://docs.docker.com/engine/install/). |
| 32 | + |
| 33 | +2. Login to your Scaleway Container Registry namespace with the Docker CLI by following [this procedure](/containers/container-registry/how-to/connect-docker-cli/). |
| 34 | + |
| 35 | +3. Run the command below to pull, tag, then push the public image to your Scaleway Registry namespace. Make sure to replace the namespace name, and the image name by the appropriate values: |
| 36 | + ``` |
| 37 | + docker pull alpine:latest |
| 38 | + docker tag alpine:latest rg.fr-par.scw.cloud/my-namespace/alpine:latest |
| 39 | + docker push rg.fr-par.scw.cloud/my-namespace/alpine:latest |
| 40 | + ``` |
| 41 | + |
| 42 | +4. Your image now appears in the [Container Registry section](https://console.scaleway.com/registry/namespaces) of the Scaleway console, in the namespace specified above. |
| 43 | + |
| 44 | +## Import images using Skopeo |
| 45 | + |
| 46 | +[Skopeo](https://github.com/containers/skopeo) is a command line utility that allows you to perform various operations on container images and registries, such as image copy, inspection, deletion, etc. |
| 47 | + |
| 48 | +1. Install Skopeo by referring to the [official documentation](https://github.com/containers/skopeo/blob/main/install.md). |
| 49 | + |
| 50 | +2. Run the command below to log in to the Scaleway Container Registry. Make sure to specify the desired region: |
| 51 | + |
| 52 | + ``` |
| 53 | + skopeo login rg.fr-par.scw.cloud -u nologin -p $SCW_SECRET_KEY |
| 54 | + ``` |
| 55 | + |
| 56 | +3. Run the command below to copy an image from an external registry to the Scaleway Registry. Make sure to replace the registry, namespace and image names by the appropriate values: |
| 57 | + |
| 58 | + ``` |
| 59 | + skopeo copy --override-os \ |
| 60 | + linux docker://docker.io/alpine:latest \ |
| 61 | + docker://rg.fr-par.scw.cloud/my-namespace/alpine:latest |
| 62 | + ``` |
| 63 | + |
| 64 | +4. Your image now appears in the [Container Registry section](https://console.scaleway.com/registry/namespaces) of the Scaleway console, in the namespace specified above. |
0 commit comments