Note: The Python code sample uses the 8081 HTTP port.
Before you begin creating an application with this devfile code sample, it's helpful to understand the relationship between the devfile and Dockerfile and how they contribute to your build. You can find these files at the following URLs:
- The
devfile.yamlfile has animage-buildcomponent that points to yourDockerfile. - The
docker/Dockerfilecontains the instructions you need to build the code sample as a container image. - The
devfile.yamlkubernetes-deploycomponent points to adeploy.yamlfile that contains instructions for deploying the built container image. - The
devfile.yamldeploycommand completes the outerloop deployment phase by pointing to theimage-buildandkubernetes-deploycomponents to create your application.
oc login
ODO_IMAGE_BUILD_ARGS="--platform=linux/amd64;--no-cache" odo build-images# The repo was not present so I ended up pushing the image to the repository for the first deployment.
podman image push docker.io/bhaveshscp/python-image:latestODO_IMAGE_BUILD_ARGS="--platform=linux/amd64;--no-cache" odo deploy
# For this demo, create the route manually and then test the route.- For more information about Python, see Python.
- For more information about devfiles, see Devfile.io.
- For more information about Dockerfiles, see Dockerfile reference.