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

Error running datagate #6

Closed
ariel-lenis opened this issue Jun 1, 2017 · 15 comments
Closed

Error running datagate #6

ariel-lenis opened this issue Jun 1, 2017 · 15 comments
Assignees
Labels
Milestone

Comments

@ariel-lenis
Copy link

Hi,

Im triying to run the datagate docker image but i have this error message

root@ubuntu-512mb-tor1-01:/home/server/repo/ci/datagate# docker run -p 9090:8080 --name container-datagate-test datagate-test
container_linux.go:247: starting container process caused "exec: "./datagate.sh": permission denied"
docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: "./datagate.sh": permission denied".

@anidotnet
Copy link
Contributor

anidotnet commented Jun 1, 2017

Can you post your docker file here? If possible, please also mention your test setup.

@ariel-lenis
Copy link
Author

ariel-lenis commented Jun 1, 2017

Sure!

This is the dockerfile contents:

FROM dizitart/nitrite-datagate

COPY keystore.jks /

## Connection details (Replace with your own values)
ENV DATAGATE_HOST "0.0.0.0"
ENV DATAGATE_HTTP_PORT "8080"
ENV DATAGATE_HTTPS_PORT "8443"
ENV DATAGATE_MONITOR_PORT "9090"
ENV DATAGATE_KEY_STORE "keystore.jks"
ENV DATAGATE_KEY_PASSWORD "s3cret"

## Mongo connection details (Replace with your own values)
ENV DATAGATE_MONGO_HOST "172.17.0.3"
ENV DATAGATE_MONGO_PORT "27017"
ENV DATAGATE_MONGO_USER "root"
ENV DATAGATE_MONGO_PASSWORD "some-password"
ENV DATAGATE_MONGO_DATABASE "target-db"

## Starts the server
ENTRYPOINT [ "./datagate.sh" ]

@ariel-lenis
Copy link
Author

Also i'm using the commands (inside the dockerfile folder):

docker build -t datagate-test .
docker run -p 9090:8080 --name container-datagate-test datagate-test

@ariel-lenis
Copy link
Author

I enter to the docker container with the command

docker run -it -p 9090:8080 --name container-datagate-test datagate-test /bin/sh

also i commented the dockerfile line: ENTRYPOINT [ "./datagate.sh" ]

And i found that the datagate.sh have no execution rights!

image

@anidotnet
Copy link
Contributor

Hmm that is strange. I'll look into it.

@anidotnet
Copy link
Contributor

anidotnet commented Jun 1, 2017

What is the docker version you are using?

@ariel-lenis
Copy link
Author

Docker version 17.05.0-ce, build 89658be

@anidotnet
Copy link
Contributor

One thing you can do now is add this line before entrypoint command in your docker file

RUN ["chmod", "+x", "./datagate.sh"]
ENTRYPOINT [ "./datagate.sh" ]

It will solve this issue. Meantime, I'll update the documentation in the upcoming release. And I'll also change the permission of the sh file during CI build. Does that sound good?

@anidotnet anidotnet self-assigned this Jun 1, 2017
@anidotnet anidotnet added the bug label Jun 1, 2017
@anidotnet anidotnet added this to the 1.0.1 milestone Jun 1, 2017
@ariel-lenis
Copy link
Author

ariel-lenis commented Jun 1, 2017

Hi,
I tried with the chmod before the entrypoint line but looks like the entrypoint is executed first (or im doing something wrong)

But, worked in this way:

CMD ["chmod", "+x", "datagate.sh"]
CMD ["sh", "datagate.sh" ]

Thanks for your time!, i think that is enough for this issue, i have an additional problem but i will create a new issue for that.

@anidotnet
Copy link
Contributor

The ENTRYPOINT should not run before the RUN command. I can ran the datagate server with this change. Just want to make sure, did you delete the old image and rebuild it after making these changes? Anyway your change is also more or less same.

@ariel-lenis
Copy link
Author

ariel-lenis commented Jun 1, 2017

Agree, but i tried again with this steps:

  • Updated the dockerfile
CMD ["chmod", "+x", "datagate.sh"]
#CMD ["sh", "datagate.sh" ]

## Starts the server
ENTRYPOINT [ "./datagate.sh" ]
  • used docker stop to stop the container
  • used docker rm to delete the container
  • used docker build -t datagate-test . to build the image again

I got again:

image

@anidotnet
Copy link
Contributor

This is really seems strange to me. While building the image from scratch, did you get a step like this?

image

Could you please run these commands?

  • docker rm -f $(docker ps -a -q)
  • docker rmi -f datagate-test
  • docker build -t datagate-test .
  • docker run -p 9090:8080 --name container-datagate-test datagate-test

I just need to get to the bottom of the issue.

@ariel-lenis
Copy link
Author

ariel-lenis commented Jun 1, 2017

Sure!

Sorry, I tried with that commands but i got the same issue.

But this is the output of the build command (looks different):

 ---> Running in 84389942ddb0
 ---> 9dc15cec004d
Removing intermediate container 84389942ddb0
Step 15/16 : CMD chmod +x datagate.sh
 ---> Running in 5fd5a405e043
 ---> 1f7c48df0038
Removing intermediate container 5fd5a405e043
Step 16/16 : ENTRYPOINT ./datagate.sh
 ---> Running in b6e899d76439
 ---> d4287b55d0fa
Removing intermediate container b6e899d76439
Successfully built d4287b55d0fa

@anidotnet
Copy link
Contributor

Just one last thing. Can you try with

RUN ["chmod", "+x", "./datagate.sh"]

instead of

CMD ["chmod", "+x", "datagate.sh"]

Remember the "./" in front of datagate.sh

@ariel-lenis
Copy link
Author

Yes, that works as expected.

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

No branches or pull requests

2 participants