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

Can't run migrations. Can't build #96

Closed
tetricky opened this issue Apr 10, 2023 · 9 comments
Closed

Can't run migrations. Can't build #96

tetricky opened this issue Apr 10, 2023 · 9 comments
Labels
question A question about Davis and how it works

Comments

@tetricky
Copy link

I'm trying to install davis on podman.

Pulling the v3.2.0 image from ghcr.io, and attempting to run the database migrations I get the error:

sh: bin/console: not found

Trying to build from the v3.2.0 release using podman build --pull --file docker/Dockerfile --tag localhost/davis:latest it ultimately fails with the error:

STEP 16/19: RUN APP_ENV=prod composer install --no-ansi --no-dev --no-interaction --no-progress --optimize-autoloader
Composer plugins have been disabled for safety in this non-interactive session. Set COMPOSER_ALLOW_SUPERUSER=1 if you want to allow plugins to run as root/super user.
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Composer could not find a composer.json file in /var/www/davis
To initialize a project, please create a composer.json file. See https://getcomposer.org/basic-usage
Error: building at STEP "RUN APP_ENV=prod composer install --no-ansi --no-dev --no-interaction --no-progress --optimize-autoloader": while running runtime: exit status 1

I'm stuck.

@tchapi
Copy link
Owner

tchapi commented Apr 10, 2023

Hi @tetricky

  • What folder are you trying the migrations from? How are you trying to do it?
  • I don't know podman but it seems like you're not replicating what is indicated in the readme, ie docker build --pull --file docker/Dockerfile --tag davis:latest . (notice the . at the end, indicating the current folder to operate in)

@tchapi tchapi added the question A question about Davis and how it works label Apr 10, 2023
@tetricky
Copy link
Author

....I've done that, and it builds....but using the locally built image, or the published image, and I'm still getting the same result:

# podman exec -it davis sh -c "APP_ENV=prod bin/console doctrine:migrations:migrate --no-interaction"
sh: bin/console: not found

In this respect podman is direct syntax compliant with docker.

I can use podman exec -it davis sh to access the container with an sh shell, plus I have used direct console access (using cockpit).

What I can't do is make bin/console be there....because it isn't. It's not installed on the image.

@tchapi
Copy link
Owner

tchapi commented Apr 10, 2023

It is perfectly installed (in the ghcr.io image, and locally when it's built correctly):

❯ docker run -d --name davis_test ghcr.io/tchapi/davis:v3.2.0
a677831b766f9d8db3430cf7db2b6d57e088f04c6ef60acf4b0d1c94a9ad277b
❯ docker exec -it davis_test sh -c "pwd"
/var/www/davis
❯ docker exec -it davis_test sh -c "ls -la bin/console"
-rwxr-xr-x    1 root     root          1293 Mar 12 22:46 bin/console
❯ docker exec -it davis_test sh -c "APP_ENV=prod bin/console --version"
Symfony 5.4.21 (env: prod, debug: false)

You have a problem in your podman installation. Try with docker directly; it seems your podman does not respect the WORKDIR directive: you can try to see what podman exec -it davis sh -c "pwd" gives you for instance.

@tetricky
Copy link
Author

tetricky commented Apr 10, 2023

For various reasons I'm not able to use docker.

# podman exec -it davis sh -c "pwd"
/var/www/davis

I've pulled the image from ghcr.io, and had exactly the same problem. This is with the pulled image (v3.2.0):

# podman exec -it davis sh -c "pwd"
/var/www/davis
# podman exec -it davis sh -c "ls -la /bin/"
total 1252
drwxr-xr-x    1 root     root          4096 Feb 14 20:53 .
dr-xr-xr-x    1 root     root          4096 Apr 10 16:49 ..
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 arch -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 ash -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 base64 -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 bbconfig -> /bin/busybox
-rwxr-xr-x    1 root     root        841392 Nov 19 10:13 busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 cat -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 chattr -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 chgrp -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 chmod -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 chown -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 cp -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 date -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 dd -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 df -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 dmesg -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 dnsdomainname -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 dumpkmap -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 echo -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 ed -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 egrep -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 false -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 fatattr -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 fdflush -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 fgrep -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 fsync -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 getopt -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 grep -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 gunzip -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 gzip -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 hostname -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 ionice -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 iostat -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 ipcalc -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 kbd_mode -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 kill -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 link -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 linux32 -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 linux64 -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 ln -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 login -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 ls -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 lsattr -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 lzop -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 makemime -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 mkdir -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 mknod -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 mktemp -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 more -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 mount -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 mountpoint -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 mpstat -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 mv -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 netstat -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 nice -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 pidof -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 ping -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 ping6 -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 pipe_progress -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 printenv -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 ps -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 pwd -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 reformime -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 rev -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 rm -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 rmdir -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 run-parts -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 sed -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 setpriv -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 setserial -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 sh -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 sleep -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 stat -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 stty -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 su -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 sync -> /bin/busybox
-rwxr-xr-x    1 root     root        427648 Oct 24 13:54 tar
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 touch -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 true -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 umount -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 14 20:53 uname -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 usleep -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 watch -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 10 16:45 zcat -> /bin/busybox

@tchapi
Copy link
Owner

tchapi commented Apr 10, 2023

The console executable is in /var/www/davis/bin, not /bin (watch out for the leading slash)

@tetricky
Copy link
Author

Right. That's made it click in my head.

I've mounted a local volume as /var/www/davis so that the data will persist - but in doing so whatever is in the container is now overwritten by an empty mount. I need to populate my local directory with whatever should be in the container (and it is in there still, but obscured by the mount).

Is it just the bin directory, or is there more in there?

Sorry for that, my mistake.

@tchapi
Copy link
Owner

tchapi commented Apr 10, 2023

The whole Davis application (ie. all PHP files, frontend, command line tools, etc) is in /var/www/davis so you don't want to mount anything else at this specific location in the container.

If you want to persist DAV files for instance, you can create a specific mount for that (example here where the files_webdav_volume: /webdav path is mounted and used in the env vars)

@tchapi tchapi closed this as completed Apr 10, 2023
@tetricky
Copy link
Author

Don't I need to also mount that in nginx for serving that directory?

I'm not seeing my way through this, in my setup.

@tchapi
Copy link
Owner

tchapi commented Apr 10, 2023

If it's DAV, you don't, because it's served via PHP-FPM to whatever proxy you're providing downstream. If you're mounting other static files for a specific use case that I'm not aware of, then mount them directly in your proxy container, it's easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A question about Davis and how it works
Projects
None yet
Development

No branches or pull requests

2 participants