nginx-container
nginx-container copied to clipboard
Build fails on OpenShift (OKD 4.5)
oc new-app nginx:1.18~https://github.com/sclorg/nginx-container.git --context-dir=1.18/test/test-app/ error: the image match "nginx:1.18" for source repository "https://github.com/sclorg/nginx-container.git" does not appear to be a source-to-image builder.
- to attempt to use this image as a source builder, pass "--strategy=source"
- to use it as a base image for a Docker build, pass "--strategy=docker"
oc new-app nginx:1.18~https://github.com/sclorg/nginx-container.git --context-dir=1.18/test/test-app/ --strategy=source --> Found container image 862e748 (22 hours old) from Docker Hub for "nginx:1.18"
* An image stream tag will be created as "nginx:1.18" that will track the source image
* A source build using source code from https://github.com/sclorg/nginx-container.git will be created
* The resulting image will be pushed to image stream tag "nginx-container:latest"
* Every time "nginx:1.18" changes a new build will be triggered
--> Creating resources ... imagestream.image.openshift.io "nginx" created imagestream.image.openshift.io "nginx-container" created buildconfig.build.openshift.io "nginx-container" created deployment.apps "nginx-container" created service "nginx-container" created --> Success Build scheduled, use 'oc logs -f bc/nginx-container' to track its progress. Application is not exposed. You can expose services to the outside world by executing one or more of the commands below: 'oc expose svc/nginx-container' Run 'oc status' to view your app.
oc logs -f bc/nginx-container Cloning "https://github.com/sclorg/nginx-container.git" ... Commit: 4ce4be9db468c35a15f6124024a697a221619dea (Merge pull request #125 from pkubatrh/move_latest_imagestreams) Author: Petr Hracek [email protected] Date: Thu Oct 22 12:57:02 2020 +0200 Caching blobs under "/var/cache/blobs". Getting image source signatures Copying blob sha256:bb79b6b2107fea8e8a47133a660b78e3a546998fcf0427be39ac9a0af4a97e90 Copying blob sha256:ad34e8cc33546c0c8fb4afb5d881052e8c7350e2aa6a27435994b6d34cfd3d72 Copying blob sha256:49ddf17900338a5699a1be53911eea9f546c722330699b4d49c6ad2e38df8a78 Copying blob sha256:8f71a46554c507ff1a2b1a8dfa5804ec6b7d3ed66190d94bd67039e9b260b41a Copying blob sha256:67b735c9b17f1efa80f5516d25748b4c870bbe16758a24fd64612da110ba51a4 Copying config sha256:862e7484c3741e813dcc8c408c9f6a3e391fba1388c9407685893af0b9f0bea9 Writing manifest to image destination Storing signatures Generating dockerfile with builder image nginx@sha256:c06730857b347ac1f0c12ff7b866dc384feafa7d1fe81900412c7bdaba042a74 STEP 1: FROM nginx@sha256:c06730857b347ac1f0c12ff7b866dc384feafa7d1fe81900412c7bdaba042a74 STEP 2: LABEL "io.openshift.build.source-context-dir"="1.18/test/test-app" "io.openshift.build.image"="nginx@sha256:c06730857b347ac1f0c12ff7b866dc384feafa7d1fe81900412c7bdaba042a74" "io.openshift.build.commit.author"="Petr Hracek [email protected]" "io.openshift.build.commit.date"="Thu Oct 22 12:57:02 2020 +0200" "io.openshift.build.commit.id"="4ce4be9db468c35a15f6124024a697a221619dea" "io.openshift.build.commit.ref"="master" "io.openshift.build.commit.message"="Merge pull request #125 from pkubatrh/move_latest_imagestreams" "io.openshift.build.source-location"="https://github.com/sclorg/nginx-container.git" STEP 3: ENV OPENSHIFT_BUILD_NAME="nginx-container-1" OPENSHIFT_BUILD_NAMESPACE="s2i-lighttpd" OPENSHIFT_BUILD_SOURCE="https://github.com/sclorg/nginx-container.git" OPENSHIFT_BUILD_COMMIT="4ce4be9db468c35a15f6124024a697a221619dea" STEP 4: USER root STEP 5: COPY upload/src /tmp/src STEP 6: RUN chown -R 1001:0 /tmp/src STEP 7: USER 1001 STEP 8: RUN /usr/libexec/s2i/assemble /bin/sh: 1: /usr/libexec/s2i/assemble: not found subprocess exited with status 127 subprocess exited with status 127 error: build error: error building at STEP "RUN /usr/libexec/s2i/assemble": exit status 127
Hi @mvrk69 , can you verify the image being used is actually the nginx image from this repository and not just a random nginx image pulled in from Dockerhub?
I only merged the imagestream for 1.18 earlier today (https://github.com/sclorg/nginx-container/pull/130) so I find it unlikely it would already be present in OKD 4.5.
Hi,
I'm actually trying to build the image so it will be imported into my internal registry.
Usually i do it like this with some other repos and has been working:
oc new-app https://github.com/sclorg/nginx-container.git --strategy=docker --context-dir="1.16" --name="nginx-container" then i just delete the builds/buildconfigs/deploys.
but doesn't work here:
.... Cleaning up list of fastest mirrors --> ec38fceb2eb STEP 9: COPY ./s2i/bin/ $STI_SCRIPTS_PATH --> 61fcb952b3c STEP 10: COPY ./root/ / --> 2e1532ab8f9 STEP 11: RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && chmod a+rwx ${NGINX_CONF_PATH} && mkdir -p ${NGINX_APP_ROOT}/etc/nginx.d/ && mkdir -p ${NGINX_APP_ROOT}/etc/nginx.default.d/ && mkdir -p ${NGINX_APP_ROOT}/src/nginx-start/ && mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && mkdir -p ${NGINX_LOG_PATH} && mkdir -p ${NGINX_PERL_MODULE_PATH} && ln -s ${NGINX_LOG_PATH} /var/log/nginx && ln -s /etc/opt/rh/rh-nginx${NGINX_SHORT_VER}/nginx /etc/nginx && ln -s /opt/rh/rh-nginx${NGINX_SHORT_VER}/root/usr/share/nginx /usr/share/nginx && chmod -R a+rwx ${NGINX_APP_ROOT}/etc && chmod -R a+rwx /var/opt/rh/rh-nginx${NGINX_SHORT_VER} && chmod -R a+rwx ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && chown -R 1001:0 ${NGINX_APP_ROOT} && chown -R 1001:0 /var/opt/rh/rh-nginx${NGINX_SHORT_VER} && chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && chmod -R a+rwx /var/run && chown -R 1001:0 /var/run && rpm-file-permissions chmod: changing permissions of '/var/run/secrets': Read-only file system chmod: changing permissions of '/var/run/secrets/kubernetes.io': Read-only file system chmod: changing permissions of '/var/run/secrets/kubernetes.io/serviceaccount': Read-only file system chmod: changing permissions of '/var/run/secrets/kubernetes.io/serviceaccount/..2020_11_09_07_29_46.322599323': Read-only file system chmod: changing permissions of '/var/run/secrets/kubernetes.io/serviceaccount/..2020_11_09_07_29_46.322599323/token': Read-only file system chmod: changing permissions of '/var/run/secrets/kubernetes.io/serviceaccount/..2020_11_09_07_29_46.322599323/service-ca.crt': Read-only file system chmod: changing permissions of '/var/run/secrets/kubernetes.io/serviceaccount/..2020_11_09_07_29_46.322599323/namespace': Read-only file system chmod: changing permissions of '/var/run/secrets/kubernetes.io/serviceaccount/..2020_11_09_07_29_46.322599323/ca.crt': Read-only file system chmod: changing permissions of '/var/run/secrets/openshift.io': Read-only file system chmod: changing permissions of '/var/run/secrets/openshift.io/push': Read-only file system chmod: changing permissions of '/var/run/secrets/openshift.io/push/..2020_11_09_07_29_46.831353388': Read-only file system chmod: changing permissions of '/var/run/secrets/openshift.io/push/..2020_11_09_07_29_46.831353388/.dockercfg': Read-only file system chmod: changing permissions of '/var/run/secrets/openshift.io/pull': Read-only file system chmod: changing permissions of '/var/run/secrets/openshift.io/pull/..2020_11_09_07_29_46.676597098': Read-only file system chmod: changing permissions of '/var/run/secrets/openshift.io/pull/..2020_11_09_07_29_46.676597098/.dockercfg': Read-only file system subprocess exited with status 1 subprocess exited with status 1
I only now saw on the repo README that to build i need to clone this repo and the run make build, does this means it won't build directly using oc new-app ?
@mvrk69 I guess, this issue was already solved by #205. Can you please clarify it?
If it is not valid anymore, please close this issue.
Yes, its working fine now. Thank you.