Skip to content

How to manually cache images in Rahti 2

It is possible to manually cache images in Rahti 2. This could be useful to remove an external dependency or improve performance.

The process is simple:

  1. Install and login with OC.

  2. With a terminal, connect to the Rahti 2 registry:

    docker login -p $(oc whoami -t ) -u unused image-registry.apps.2.rahti.csc.fi
    

    Info

    If you get any error, make sure you are logged in. If you run oc whoami, the command should return your username.

  3. Tag the image you want to push:

    docker tag centos:7 image-registry.apps.2.rahti.csc.fi/{YOUR_PROJECT_NAME}/centos:<tag>
    
    Replace {YOUR_PROJECT_NAME} by the name of your project.

  4. Push your image:

    docker push image-registry.apps.2.rahti.csc.fi/{YOUR_PROJECT_NAME}/centos:<tag>
    

You should be able to see your images in your project: Image Streams

Use the image

Go to your project's deployment, and edit it.

Edit deployment

Go to the Images section, make sure the option "Deploy images from an image stream tag" is clicked. Finally select the new image.

Use cached image