last day (16 days later) » 

2:49 PM
1
A: docker-compose mounted directory does not rename folders

ZakThe volume is created when you run the container, not when you build it. By default the permissions on that directory will be root. An other issue here is that you are binding your volume to a host path "/mnt/coverimages/S3-Uploaded/subfolder-for-depth". So that directory is going to have the pe...

 
all the permissions are the same for 4 folders, one of them has permissions, and the others do not let me rename the folder. So I don't think it is an owner issue. I tried to add permissions to www-data already for my app folder. Is there anything else I can try?
 
Zak
The issue is not the app/ folder but the volume you are binding in that folder. Why folders in subfolder-for-depth/ are owned by root? Aren't those generated by your script run by www-data?
 
I am not generating any folders, I just want to take a folder on my machine and mount it for a script to automatically put files up on aws. I have the code working, but not all of the folders in the subfolder-for-depth folder are allowing permission. I am not generating any folders in code though.
I added file_put_contents($dirPath.'/newfile.txt', 'Making sure the file writes') and the folder allows the file to be created, but does not let me rename the folder.
 
Zak
Can you please show the output of ls -la /app/public/CoverImages/S3-Uploaded/subfolder-for-depth/?
 
updated the post, you are right, it is on the actual folder not in the permissions once in docker. What is the @ sign permission? And how can I change this?
 
Zak
2:49 PM
Ok, and do you have the same permissions issue when you rename the folder manually with mv, in the container?
 
mv works on my machine, but if I bash into my php, it does not let me change the name with mv manually
 
Zak
That's because you are as user www-data and the folder as root?
Try creating a folder with mkdir
 
yeah the new folder I make has the right permission
if I do mkdir inside bash
 
Zak
3:05 PM
What I find weird is that your subfolder-for-depth/ is owned by the container's root user but on you host machine is owned by toddcoulson.
 
toddcoulson is the name of my mac machine
 
Zak
You have to try to add the toddcoulson user's ID to the www-data group in your Dockerfile
 
i am not sure I know the command for that
 
Zak
What's your container base image? Debian? Ubuntu?
 
ubuntu
 
Zak
3:11 PM
Try useradd -g www-data [user's ID]
 
sorry for my knowledge on this, is this in dockerfile?
 
Zak
Yes, with a RUN command before that
for your user's id execute whoami on your mac
Ex. RUN useradd -g www-data 1000
 
oh ok, thanks
let me publish and see if that works. Thanks a ton for your chat on this btw
I appreciate your time
 
Zak
You're welcome, tell if you have issues starting you container. You have to be sure that www-data group exists in your container
If it's not working, try this other method :
# Specify user for correct right
RUN groupmod -g [uid] www-data \
&& usermod -s /bin/bash -u [uid] www-data
Always worked for me.
 
3:41 PM
coworker of mine is checking into the permissions of the folder on the shared drive. I will let you know what we find.
 

  last day (16 days later) »