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

Container fails to start #133

Open
JaneX8 opened this issue Jan 9, 2023 · 10 comments
Open

Container fails to start #133

JaneX8 opened this issue Jan 9, 2023 · 10 comments
Labels

Comments

@JaneX8
Copy link

JaneX8 commented Jan 9, 2023

docker logs adminer
ln: failed to create symbolic link './adminer.css': Permission denied
@TimWolla
Copy link
Owner

TimWolla commented Jan 9, 2023

How are you starting the container?

@JaneX8
Copy link
Author

JaneX8 commented Jan 10, 2023

Using docker-compose. Below config has always worked so far and isn't changed recently.

    adminer:
        image: adminer
        user: "adminer:adminer"
        container_name: adminer
        restart: on-failure:5
        deploy:
          resources:
            limits:
              cpus: '.20'
              memory: 32M
              pids: 5
        expose:
            - "8080/tcp"
        environment:
            ADMINER_DEFAULT_SERVER: xxxx
            ADMINER_DESIGN: "pepa-linha"
            ADMINER_PLUGINS: "login-totp"
        networks:
            caddy:
            mysql:
                ipv4_address: xxxx
        depends_on: ["caddy", "mysql"]
        privileged: false
        volumes:
            - "/var/docker/volumes/adminer/plugins/login-totp.php:/var/www/html/plugins/login-totp.php:ro"
            - "/var/docker/volumes/adminer/plugins-enabled:/var/www/html/plugins-enabled:rw"
        security_opt:
            - "no-new-privileges"
        cap_drop: ['ALL']
        healthcheck:
            test: ["CMD-SHELL", "netstat -ltn | grep -c ':8080' > /dev/null || exit 1"]
            interval: 30s
            timeout: 10s
            retries: 3
            start_period: 40s

@TimWolla
Copy link
Owner

TimWolla commented Jan 10, 2023

I'm unable to reproduce the issue with a stripped down version of your configuration:

    adminer:
        image: adminer
        user: "adminer:adminer"
        container_name: adminer
        restart: on-failure:5
        expose:
            - "8080/tcp"
        environment:
            ADMINER_DEFAULT_SERVER: xxxx
            ADMINER_DESIGN: "pepa-linha"
        privileged: false
        security_opt:
            - "no-new-privileges"
        cap_drop: ['ALL']
$ docker-compose up
Recreating adminer ... done
Attaching to adminer
adminer    | [Tue Jan 10 21:27:12 2023] PHP 7.4.33 Development Server (http://[::]:8080) started
^CGracefully stopping... (press Ctrl+C again to force)

I'm also not seeing an obvious issue with your volumes, which I suspected, because #129 needed to change the underlying UIDs, as the one used by the previous Alpine version was taken in Debian.

Please check whether all the files are readable to the adminer user which has UID 999 in the current version.

@JaneX8
Copy link
Author

JaneX8 commented Jan 11, 2023

My volumes are using a custom user and group, not UID 999. But named adminer too. Unique as for all my docker containers. I will test it more when I have time. Deleting the container and recreating entirely didn't fix my problem.

@TimWolla
Copy link
Owner

My volumes are using a custom user and group, not UID 999. But named adminer too.

Names are irrelevant, permissions are only based on the UID. The name can differ depending on the contents of /etc/passwd (which might and likely will be different across host and container).

@JaneX8
Copy link
Author

JaneX8 commented Jan 11, 2023

I temporarily fixed it by changing in my docker-compose file to user: "999:999". However I wonder what changed because I have special users setup already with other UIDs for every container and this used to work before. Is 999 something new in de Adminer Docker container?

@alvinlys
Copy link

Using docker-compose. Below config has always worked so far and isn't changed recently.

    adminer:
        image: adminer
        user: "adminer:adminer"
        container_name: adminer
        restart: on-failure:5
        deploy:
          resources:
            limits:
              cpus: '.20'
              memory: 32M
              pids: 5
        expose:
            - "8080/tcp"
        environment:
            ADMINER_DEFAULT_SERVER: xxxx
            ADMINER_DESIGN: "pepa-linha"
            ADMINER_PLUGINS: "login-totp"
        networks:
            caddy:
            mysql:
                ipv4_address: xxxx
        depends_on: ["caddy", "mysql"]
        privileged: false
        volumes:
            - "/var/docker/volumes/adminer/plugins/login-totp.php:/var/www/html/plugins/login-totp.php:ro"
            - "/var/docker/volumes/adminer/plugins-enabled:/var/www/html/plugins-enabled:rw"
        security_opt:
            - "no-new-privileges"
        cap_drop: ['ALL']
        healthcheck:
            test: ["CMD-SHELL", "netstat -ltn | grep -c ':8080' > /dev/null || exit 1"]
            interval: 30s
            timeout: 10s
            retries: 3
            start_period: 40s

Hi , did you used nginx for this? if yes, mind to share your nginx con.f file?

@JaneX8
Copy link
Author

JaneX8 commented Aug 25, 2023

Hi Alvin, I'm not sure what your question is. But if you meant how I got Adminet behind a reverse proxy then check out https://caddyserver.com/v2.

@MustagheesButt
Copy link

When setting ADMINER_DESIGN in my compose file, I get the following and container keeps restarting:
ln: failed to create symbolic link './adminer.css': Permission denied

And when not set:
touch: cannot touch '.adminer-init': Permission denied
But container starts.

I think what caused it was sometime ago I accidentally did: sudo chown -R root:root /var/lib/docker/, which messed up permissions for every container. But restarting all containers using down and up fixed other containers including postgres.

Any idea how to fix this?

@iqyiqy
Copy link

iqyiqy commented Oct 22, 2024

当设置时ADMINER_DESIGN 在我的合成文件中,我得到了以下信息,容器不断地重新启动: ln: failed to create symbolic link './adminer.css': Permission denied

如果没有: touch: cannot touch '.adminer-init': Permission denied 但是集装箱开始了。

我想是什么导致的我不小心做了:sudo chown -R root:root /var/lib/docker/ 它破坏了每个容器的权限。但是重新启动所有容器downup 固定其他容器,包括邮政。

有办法解决吗?

I encountered the same problem today.
After I set chown -R root.root /var/lib/docker, the MariaDB and Adminer containers faced permission issues and could not start, while other containers were running normally.
The solution was to run

docker-compose down
docker rmi adminer:latest mariadb:10.6
docker-compose up -d

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

5 participants