-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/app not readable when running on Openshift #523
Comments
Hi @ssoerensen , are the files in your Maven build output ( |
No, they are set to 0775, but have in mind, it is working as intended with docker version 18.03.1-ce but not with 1.13.1 |
@ssoerensen Hmm, is there a reason for using this old version? |
The reason for running a old version is Redhat, that is what they "support". Anyway i did some messing around trying to see if something would change when i rebuild the image using FROM. FROM registry/jib-build:0.0.1-SNAPSHOT
RUN touch /app/test Image is build on 18.03.1-ce and run on 1.13.1 Will actually give /app the correct permissions (0755). however all other files and folders inside the /app folder still have wrong permissions. I did some poking around and the layer files seems to have the 0600:
Could that be the problem? |
@ssoerensen we'll have to look into this, but it seems like you are familiar with Docker and at least you can work around this, e.g., by manipulating the image locally? BTW, if you want to see how Jib would create FROM gcr.io/distroless/java
COPY libs /app/libs/
COPY resources /app/resources/
COPY classes /app/classes/
ENTRYPOINT ["java","-cp","/app/libs/*:/app/resources/:/app/classes/","org.springframework.samples.petclinic.PetClinicApplication"]
CMD [] I wonder if |
@chanseokoh Yeah, we can work around it for now. It's not like we can't build images. We are just hungering for getting out of the fact that we need dockerd to build images. But let me know if you want me to test any changes :-) |
I believe the solution may be to explicitly add entries for the directories (like |
Hi @ssoerensen , I'm trying a fix in #772. Would you mind trying that fix to see if it works for your error?
|
|
I set up a Docker container that has You can pull and run the image, build inside the container the sample
At this point, Jib has built and pushed an image name called
What's interesting is that, if I upload that image to Docker Hub for later examination,
and then pull it and save it locally in my host (i.e., outside the container) and run it, the permissions are set.
|
BTW, the image FROM ubuntu:16.04
RUN apt-get update && \
apt-get install -y kmod apt-transport-https software-properties-common \
vim openjdk-8-jdk maven python git curl && \
add-apt-repository \
"deb https://apt.dockerproject.org/repo/ ubuntu-xenial main" && \
apt-get update && \
apt-get install -y --allow-unauthenticated \
docker-engine=1.13.1-0~ubuntu-xenial && \
git clone https://github.com/GoogleContainerTools/jib.git && \
cd jib && git checkout disable-cross-repo-blob-mount && \
cd jib-maven-plugin && mvn -DskipTests install
CMD sleep infinity |
@coollog I finally got around to test the patch. i can confirm that the permissions are now correct |
@ssoerensen Great! We'll have the patch available in the next version (version |
@ssoerensen We have released version |
/app folder permissions is set to 0700 on docker version 1.13.1 on Redhat Enterprice 7.5:
Expected behavior:
/app folder permissions should be 0755, as it is with docker version 18.03.1-ce
Steps to reproduce:
Build using configuration pasted below
Environment:
Server:
Version: 1.13.1
API version: 1.26 (minimum version 1.12)
Package version: docker-1.13.1-63.git94f4240.el7.x86_64
Go version: go1.9.2
Git commit: 94f4240/1.13.1
Built: Mon Apr 30 15:45:42 2018
OS/Arch: linux/amd64
Experimental: false
Static hostname: node
Icon name: computer-server
Chassis: server
Machine ID: <machine_id>
Boot ID: <boot_it>
Operating System: OpenShift Enterprise
CPE OS Name: cpe:/o:redhat:enterprise_linux:7.5:GA:server
Kernel: Linux 3.10.0-862.3.3.el7.x86_64
Architecture: x86-64
jib-maven-plugin
Configuration:Log output:
Error: Could not find or load main class my.package.Application
The text was updated successfully, but these errors were encountered: