Skip to content
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

fixes #7 - update user permissions on artifacts in production dockerfile #11

Merged
merged 1 commit into from
Jan 31, 2018

Conversation

DineshAlapati
Copy link
Contributor

No description provided.

@DineshAlapati DineshAlapati self-assigned this Jan 31, 2018
@stevehu stevehu merged commit cdc0404 into develop Jan 31, 2018
@stevehu
Copy link
Contributor

stevehu commented Jan 31, 2018

@DineshAlapati Thanks for the PR.

@stevehu
Copy link
Contributor

stevehu commented Jan 31, 2018

Got the following error while building. I think until the last line, the /config folder doesn't exist yet.

Sending build context to Docker daemon  13.37MB
Step 1/4 : FROM openjdk:8-jre-alpine
 ---> 5699ac7295f9
Step 2/4 : EXPOSE 8080
 ---> Running in c1b6dbb11218
Removing intermediate container c1b6dbb11218
 ---> 0d6e546ca8d8
Step 3/4 : ADD /target/light-proxy.jar server.jar
 ---> 6542fb39d9c0
Step 4/4 : CMD ["/bin/sh","-c","java -Dlight-4j-config-dir=/config -Dlogback.configurationFile=/config/logback.xml -jar /server.jar"]
 ---> Running in efdd73175173
Removing intermediate container efdd73175173
 ---> 50bcbbc1a93a
Successfully built 50bcbbc1a93a
Successfully tagged networknt/light-proxy:1.5.7
Successfully tagged networknt/light-proxy:latest
+ docker build -t networknt/light-proxy:1.5.7-redhat -f ./docker/Dockerfile-Redhat . --no-cache=true
Sending build context to Docker daemon  13.37MB
Step 1/10 : FROM registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift
 ---> e68ff6be2da9
Step 2/10 : USER root
 ---> Running in 64821b525e24
Removing intermediate container 64821b525e24
 ---> 9dc855854cf7
Step 3/10 : ENV APP_DIR=/app     GROUP_NAME=networknt     GROUP_ID=1000     USER_NAME=networknt     USER_UID=1000
 ---> Running in 88124e4b9f31
Removing intermediate container 88124e4b9f31
 ---> b56f1883d45b
Step 4/10 : RUN groupadd -g ${GROUP_ID} -r ${GROUP_NAME} &&     useradd -u ${USER_UID} -g ${GROUP_NAME} -d "${APP_DIR}" -s /sbin/nologin -c "${USER_NAME} user" ${USER_NAME}
 ---> Running in 51b33d280f71
Removing intermediate container 51b33d280f71
 ---> 00305ed7bc44
Step 5/10 : ADD target/light-proxy.jar ${APP_DIR}/server.jar
 ---> 8d2ea9d249af
Step 6/10 : RUN chown -R ${USER_NAME}:0 "${APP_DIR}" "/config" &&     find "${APP_DIR}" "/config" -type d -exec chmod 750 {} \; &&     find "${APP_DIR}" "/config" -type f -exec chmod 640 {} \;
 ---> Running in dbe5fc56071a
chown: cannot access '/config': No such file or directory
The command '/bin/sh -c chown -R ${USER_NAME}:0 "${APP_DIR}" "/config" &&     find "${APP_DIR}" "/config" -type d -exec chmod 750 {} \; &&     find "${APP_DIR}" "/config" -type f -exec chmod 640 {} \;' returned a non-zero code: 1

@DineshAlapati
Copy link
Contributor Author

Right. I missed that. So in this case, I should create the directory first and change the permissions. I will fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants