Skip to content

Instantly share code, notes, and snippets.

@spotlesstofu
Created November 29, 2022 15:47
Show Gist options
  • Save spotlesstofu/31fa120f7ef68286cdb709bd36d05c85 to your computer and use it in GitHub Desktop.
Save spotlesstofu/31fa120f7ef68286cdb709bd36d05c85 to your computer and use it in GitHub Desktop.
Simplest way to Build a Container Image (Dockerfile) on OpenShift

Command:

cat Dockerfile | oc new-build --dockerfile - --to-docker=true --to=quay.io/spotlesstofu/curl-jq --name=build-image-curl-jq

Output:

--> Found container image 49176f1 (6 days old) from docker.io for "docker.io/library/alpine:latest"

    * An image stream tag will be created as "alpine:latest" that will track the source image
    * A Docker build using a predefined Dockerfile will be created
      * The resulting image will be pushed with Docker to "quay.io/spotlesstofu/curl-jq"
      * Every time "alpine:latest" changes a new build will be triggered

--> Creating resources with label build=build-image-curl-jq ...
    imagestream.image.openshift.io "alpine" created
    buildconfig.build.openshift.io "build-image-curl-jq" created
--> Success
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment