Build and push the application to a Docker registry
Before you can run the application on the cluster, you first need to push the Docker image to the IBM Cloud private container registry.
- Set MYPROJECT environment variable. Replace
with the name of the application you created in the previous steps. WindowsBashset MYPROJECT=<APP_NAME>
export MYPROJECT=<APP_NAME>
- Set MYNAMESPACE and MYREGISTRY and env vars. Copy and paste these commands.
WindowsBash
set MYNAMESPACE=think-iks set MYREGISTRY=registry.ng.bluemix.net
export MYNAMESPACE=think-iks export MYREGISTRY=registry.ng.bluemix.net
- Build and tag (
-t
) the docker imageWindowsBashdocker build . -t %MYREGISTRY%/%MYNAMESPACE%/%MYPROJECT%:v1.0.0
docker build . -t $MYREGISTRY/$MYNAMESPACE/$MYPROJECT:v1.0.0
- Ensure you are logged into the IBM container registry
ibmcloud cr login
- Push the docker image to your container registry on IBM Cloud
WindowsBash
docker push %MYREGISTRY%/%MYNAMESPACE%/%MYPROJECT%:v1.0.0
docker push $MYREGISTRY/$MYNAMESPACE/$MYPROJECT:v1.0.0