Docker Community Forums

Share and learn in the Docker community.

Docker .bashrc service HTTP request fail

docker

(Yasithlokuge) #1

I wanted to run some services automatically in the startup, inside a docker container. SO I added the relevant commands to .bashrc in order to execute those services. And they are running as expected but one service which involved in sending HTTP requests to the localhost, fails to send the request to the server. But once I logged in to the docker container and execute the script manually through shell, it works properly. Looking forward your suggestions and answers.

Dockerfile

P.S. I have tried adding those commands in to .profile as well. But got the same outcome.


(slamp) #2

.bashrc and .profile is used for user env not to start application.
Create a startup script and use it as the entry point.


(Yasithlokuge) #3

I added a startup script “bootstrap” to the /home/cobweb/bootstrap folder location. Then chmod +x the executable file. Now I’m getting the following error:

System error: exec: "/home/cobweb/bootstrap": permission denied