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

Service nginx failed to build: ADD failed: stat /var/lib/docker/tmp/docker-builderXXXXXXXXX/startup.sh: no such file or directory #2042

Closed
rossanoua opened this issue Mar 13, 2019 · 15 comments
Labels

Comments

@rossanoua
Copy link

Info:

  • Docker version ($ docker --version): 18.09.3, build 774a1f4
  • Laradock commit ($ git rev-parse HEAD): 8ca26e6
  • System info (Mac, PC, Linux): Linux
  • System info disto/version: Ubuntu 18.04.2 LTS

Issue:

command
docker-compose build --no-cache nginx mysql
produce an error
ERROR: Service 'nginx' failed to build: ADD failed: stat /var/lib/docker/tmp/docker-builder192688730/startup.sh: no such file or directory

but if command executes with sudo
sudo docker-compose build --no-cache nginx mysql
build successfull


Expected behavior:

docker & docker-compose should not be executed with sudo privilages


Reproduce:

just follow installation guide from scratch
https://laradock.io/getting-started/
for multiple projects


@Okipa
Copy link

Okipa commented Apr 5, 2019

Same problem on a ubuntu machine. Did you manage to solve this ?

@rossanoua
Copy link
Author

@Okipa hi Arthur!
For now I'm building nginx container with root privilages.
And then do docker-compose up -d nginx mysql normally.
I'm not looked up for root of problem, but my opinion is the same, something wrong with nginx container setup.
docker & docker-compose should not be executed with sudo privilages

@Okipa
Copy link

Okipa commented Apr 15, 2019

Thanks for your answer.
Same for me, I solved this too by using sudo privileges, which seems wrong to me too.

@lionslair
Copy link
Contributor

I am having the same issue. Anyone done this without sudo?

@rossanoua
Copy link
Author

rossanoua commented Apr 21, 2019

I'm have little bit of progress about figuring out what happens.
But not 100% sure.
Can only say next:
seems like during build of nginx container docker creates files and they have owner root
image
after he try to get access to this three files but can't due to permissions issue.
So, little update.
If after unsuccessful build, make chown to this three files than build run good without root (of course --no-cache).

Wonder to hear from other people.
Behaviour the same as mine?

@zerinoid
Copy link

zerinoid commented Jun 7, 2019

Same issue here.
Docker version 18.09.5, build e8ff056
Ubuntu 18.04.2 LTS x86_64

@zerinoid
Copy link

zerinoid commented Jun 7, 2019

If after unsuccessful build, make chown to this three files than build run good without root (of course --no-cache).

Wonder to hear from other people.
Behaviour the same as mine?

'Chowning' these files to my user solved nginx build.

@javoscript
Copy link

I'm have little bit of progress about figuring out what happens.
But not 100% sure.
Can only say next:
seems like during build of nginx container docker creates files and they have owner root
image
after he try to get access to this three files but can't due to permissions issue.
So, little update.
If after unsuccessful build, make chown to this three files than build run good without root (of course --no-cache).

Wonder to hear from other people.
Behaviour the same as mine?

This solved it for me too

@lionslair
Copy link
Contributor

I have those files as root. I have just chown them. Did not need root to rebuild the image. Are they root within the git repo or is something else making them root?

@rossanoua
Copy link
Author

@lionslair Hi.
As you can see in the image provided by me, files with root privilages are created during build process, because they are ignored by VCS.
Also I have explained this in my comment #2042 (comment).

@lionslair
Copy link
Contributor

I still have something in the logs of my project changed to root on up. I think its different to this. I didn't need root to get the image to build now which was good. I had to make some other changes on my fork though. Unrelated to this though

@stale
Copy link

stale bot commented Feb 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Feb 2, 2020
@stale
Copy link

stale bot commented Feb 23, 2020

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed Feb 23, 2020
@snowdon-dev
Copy link

snowdon-dev commented Jun 24, 2020

Would the solution not be to map your userid into the docker container - giving the host permissions on the file - there is config already inside laradock for this.

also git clean -xdf -e .env removes everything generated by the container - remove .env only because I don't want to set it up again.

@andrey-helldar
Copy link

andrey-helldar commented Oct 28, 2020

CentOS 7.5
Docker 19.03.13

Docker installed from under the root. I assemble containers from under the user.

I get the error when running the docker-compose up -d --build command.

All laradock files are owned by the user.

If you run the build using the sudo command, then the containers are no longer built under the user and are owned by root. I do not need it.

What am I missing?

image

image

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

7 participants