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

Docker container doesn't setup permissions correctly #2244

Closed
alexjj opened this issue Jul 3, 2023 · 7 comments
Closed

Docker container doesn't setup permissions correctly #2244

alexjj opened this issue Jul 3, 2023 · 7 comments
Labels

Comments

@alexjj
Copy link
Contributor

alexjj commented Jul 3, 2023

I installed from the latest image on https://hub.docker.com/r/2m0sql/cloudlog/tags but was presented with a permissions error on the /install/ page, suggesting to chmod 777.

I exec'd into the container and ran the write permissions as per this wiki page, which resolved the issue.

Be nice not to have to do that :) Thanks.

@magicbug magicbug added the Docker label Jul 4, 2023
@magicbug
Copy link
Owner

magicbug commented Jul 4, 2023

Yep seems a good thing todo @iu2frl whats the best way to adjust the image template.

@iu2frl
Copy link
Contributor

iu2frl commented Jul 4, 2023

@alexjj can you please tell me which steps you did? i tried both arm64 and amd64 and seems to work fine on my VMs

@alexjj
Copy link
Contributor Author

alexjj commented Jul 4, 2023

I made a compose file with the following:

  cloudlog:
    image: 2m0sql/cloudlog:latest
    container_name: cloudlog
    ports: 
      - 8096:80
    volumes:
      - /home/alex/cloudlog/uploads:/var/www/html/application/uploads
      - /home/alex/cloudlog/backup:/var/www/html/application/backup
      - /home/alex/cloudlog/config:/var/www/html/application/config
     restart: unless-stopped

sudo docker-compose up -d

Then went to ip:8096 and it said words to the effect of "permission issue please do chmod -R 777 /var/www/html/application

As the docker container runs as root I thought it might be permissions on the host side, but changing owner on the host machine didn't help. So I then ran the write permissions within the container and that fixed it.

iu2frl added a commit to iu2frl/Cloudlog that referenced this issue Jul 4, 2023
@iu2frl
Copy link
Contributor

iu2frl commented Jul 4, 2023

Thanks, i'm testing it

@alexjj
Copy link
Contributor Author

alexjj commented Jul 4, 2023

If you've not had issues, then I suspect it's to do with the permissions of those volumes and the interaction between host and container. I'm just an application operator so don't know how to change things unless the container image provides an environment option to change the user/group.

@iu2frl
Copy link
Contributor

iu2frl commented Jul 4, 2023

@alexjj can you try this setup and let me know if it works:

version: '3'
services:
  cloudlog-mysql:
    image: mysql:latest
    container_name: cloudlog-mysql
    environment:
      MYSQL_ROOT_PASSWORD: password-segreta # <- Use a strong password here
    #ports:
      #- "3306:3306" # <- Uncomment these lines only if you need to expose the MySQL container to the network
#    volumes:
#      - cloudlog-dbdata:/var/lib/mysql
    restart: unless-stopped

  phpmyadmin:
    image: phpmyadmin:latest
    container_name: cloudlog-phpmyadmin
    depends_on:
      - cloudlog-mysql
    environment:
      PMA_HOST: cloudlog-mysql
      PMA_PORT: 3306
      PMA_ARBITRARY: 1
      PMA_USER: root
      PMA_PASSWORD: password-segreta # <- Put same strong password here
    restart: unless-stopped
    ports:
      - "8083:80"
      
  cloudlog:
    image: 2m0sql/cloudlog:latest
    container_name: cloudlog-main
    depends_on:
      - cloudlog-mysql
#    volumes:
#      - cloudlog-config:/var/www/html/application/config
#      - cloudlog-backup:/var/www/html/application/backup
#      - cloudlog-uploads:/var/www/html/application/uploads
    ports:
      - "8086:80"
    restart: unless-stopped

#volumes:
#  cloudlog-dbdata:
#  cloudlog-config:
#  cloudlog-backup:
#  cloudlog-uploads:

Nothing is persistent here, it is just for testing. Also, which permission did you set? All the steps in the page you linked are already included in the image creation

iu2frl added a commit to iu2frl/Cloudlog that referenced this issue Jul 4, 2023
@iu2frl iu2frl mentioned this issue Jul 4, 2023
magicbug added a commit that referenced this issue Jul 4, 2023
@iu2frl
Copy link
Contributor

iu2frl commented Jul 5, 2023

@alexjj please follow this guide: https://github.com/magicbug/Cloudlog/wiki/Executing-the-full-standalone-Cloudlog-stack

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

3 participants