kaniko: Our images now fail to run with OCI error
Actual behavior The new images return Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused “exec: "/usr/bin/java": stat /usr/bin/java: no such file or directory”: unknown
Expected behavior Previously it run without issue. No OCI runtime
To Reproduce
- Build image with Kaniko
- Try to run image docker run Additional Information
FROM openjdk:8-jre-slim
# Expose ports to enable running the service
# Ports should be standardized to make it easier to debug
# Exposing two services in the same port can create conflicts
ENV PORT 8080
EXPOSE 8080
# List of ARGS input from Kaniko Build
ARG IMAGE_DATE
ARG VCS_REVISION
ARG VCS_SEMVER
ARG PKG_WORKDIR
# Labeling based on https://github.com/opencontainers/image-spec/blob/master/annotations.md
LABEL org.opencontainers.image.created="${IMAGE_DATE}" \
org.opencontainers.image.revision="${VCS_REVISION}" \
org.opencontainers.image.version="${VCS_SEMVER}" \
org.opencontainers.image.title="mytitle" \
org.opencontainers.image.description="mydescription" \
org.opencontainers.image.authors="myauthors" \
org.opencontainers.image.vendor="myvendor" \
org.opencontainers.image.url="myurl" \
org.opencontainers.image.documentation="mydocumentationlink" \
org.opencontainers.image.source="mygitrepourl"
# Copy of distribution/target folder artifacts
# In case additional Artifacts are required
# All containers should run in least privileged mode, meaning not ROOT.
# NOTE: On OpenShift there is a warning when you try to run as ROOT
RUN addgroup -g 1001 -S cc && \
adduser -u 1001 -S -G cc cc && \
chown -R 1001:0 /home/cc && \
chmod -R g=u /home/cc
COPY --chown=1001:0 ${PKG_WORKDIR}/target/*.jar /home/cc/service.jar
USER 1001
# Command to initialize the service
CMD ["/usr/bin/java", "-jar", "home/cc/service.jar"]
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 1
- Comments: 20 (8 by maintainers)
Commits related to this issue
- pin Kaniko version to v0.16.0 Temporary fix for CI. Correspondent Kaniko issue: https://github.com/GoogleContainerTools/kaniko/issues/1024 — committed to kwant-project/kwant by slavoutich 4 years ago
- pin Kaniko version to v0.16.0 Kaniko issue https://github.com/GoogleContainerTools/kaniko/issues/1024 — committed to quantum-tinkerer/research-docker by slavoutich 4 years ago
We’re seeing something similar trying to use kaniko to build docker images as part of a gitlab-runner pipeline:
This is a fragment from our gitlab-ci.yml:
For some reason, using
debugin place oflatestfixes the issue.Bad image creation with OCI error continues with v0.17.1.
@liemdo PR in progress. #1025
Patch fix coming soon.
We get a different error and cannot build the image in Google Cloud Build
error building image: error building stage: failed to get filesystem from image: error removing var/run to make way for new symlink: unlinkat /var/run/docker.sock: device or resource busy.