Skip to main contentKubernetes   Training

Run your first Image

🚀 TASK: Run your first Image

K8s CNI
  1. Run the following command:

    podman run --rm --name k8sdemo-backend -p 3001:3000 k8sdemo-backend:lab
    > test@0.0.0 start /app
    > node ./bin/www

    This command runs the backend server:

    • –rm makes sure that the container is deleted once it’s stopped
    • –name gives the container a fixed name (otherwise you get some pretty funny, automatically generated names - think drunken-weasel)
    • -p exposes the container port 3000 to the outside port 3001 (we do this so that it does not conflict with port 3000 of the k8sdemo web application we will start later)
    • k8sdemo-backend:lab is the image we created before
  1. Open the Backend API

    Click here or run the following:

    open http://localhost:3001/
  2. Stop the Container by hitting several times CTRL-C