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

Installation with Docker doesn't work #340

Open
np25071984 opened this issue Jan 14, 2025 · 11 comments
Open

Installation with Docker doesn't work #340

np25071984 opened this issue Jan 14, 2025 · 11 comments
Assignees

Comments

@np25071984
Copy link

To reproduce the issue just follow "Installation with Docker" section of README.md.

What is the expected result?

Get app installed and set up

What do you get instead?

Error:

$ git clone https://github.com/np25071984/app.git
Cloning into 'app'...
remote: Enumerating objects: 2383, done.
remote: Counting objects: 100% (864/864), done.
remote: Compressing objects: 100% (343/343), done.
remote: Total 2383 (delta 592), reused 674 (delta 500), pack-reused 1519 (from 1)
Receiving objects: 100% (2383/2383), 633.44 KiB | 2.21 MiB/s, done.
Resolving deltas: 100% (1347/1347), done.
$ cd app/
$ make composer update
[+] Building 1.2s (7/9)                                                                                         docker:desktop-linux
 => [app internal] load build definition from Dockerfile                                                                        0.0s
 => => transferring dockerfile: 1.51kB                                                                                          0.0s
 => [app internal] load metadata for ghcr.io/shyim/wolfi-php/frankenphp:8.3                                                     1.0s
 => [app internal] load metadata for docker.io/composer/composer:latest-bin                                                     0.7s
 => [app internal] load .dockerignore                                                                                           0.0s
 => => transferring context: 175B                                                                                               0.0s
 => CACHED [app base 1/2] FROM ghcr.io/shyim/wolfi-php/frankenphp:8.3@sha256:6dc27a62141eccc6dae6b568cf61b4660998d7e535367e314  0.0s
 => CACHED [app composer 1/1] FROM docker.io/composer/composer:latest-bin@sha256:33f6a46e1997c2ad441d4b7940e9a8e78d1b4b160510b  0.0s
 => ERROR [app base 2/2] RUN <<SH (set -eo pipefail...)                                                                         0.1s
------                                                                                                                               
 > [app base 2/2] RUN <<SH (set -eo pipefail...):
0.091 + addgroup -g 1697215263 -S www-data
0.092 addgroup: number 1697215263 is not in 0..256000 range
------
failed to solve: process "/bin/sh -c     set -eo pipefail\n    set -x\n\n    # Add www-data group and user.\n    addgroup -g ${GID} -S www-data\n    adduser -u ${UID} -D -S -G www-data www-data\n\n    # Set volume permissions.\n    mkdir -p /data /config /app/runtime && \\\n    chown -R www-data:www-data /data /config /app/runtime\n\n    # Install extra packages.\n    apk add --no-cache \\\n    php-frankenphp-8.3-opcache \\\n    php-frankenphp-8.3-mbstring \\\n    php-frankenphp-8.3-intl \\\n    php-frankenphp-8.3-dom \\\n    php-frankenphp-8.3-curl \\\n    php-frankenphp-8.3-phar \\\n    php-frankenphp-8.3-openssl \\\n    php-frankenphp-8.3-xml \\\n    php-frankenphp-8.3-xmlwriter \\\n    php-frankenphp-8.3-simplexml \\\n    php-frankenphp-8.3-pdo\n" did not complete successfully: exit code: 1
make: *** [run] Error 17

Additional info

Q A
Version master
PHP version none
Operating system MacOS 15.2
@samdark samdark self-assigned this Jan 15, 2025
@samdark
Copy link
Member

samdark commented Jan 15, 2025

What do you have if you run id in a local console?

@np25071984
Copy link
Author

$ id
uid=818890062(XXX) gid=1697215263 ...

@xepozz
Copy link
Member

xepozz commented Jan 15, 2025

What Mac do you have?
Also send please whereis brew result

@np25071984
Copy link
Author

image

$ whereis brew
brew: /opt/homebrew/bin/brew /opt/homebrew/share/man/man1/brew.1

@xepozz
Copy link
Member

xepozz commented Jan 16, 2025

I think it's better to create a new user and run docker there

@nick-lai
Copy link
Contributor

nick-lai commented Jan 16, 2025

Please comment out these environment variables in docker/compose.dev.yml

args:
UID: ${UID}
GID: ${GID}

@np25071984
Copy link
Author

Please comment out these environment variables in app/docker/compose.dev.yml

args:
UID: ${UID}
GID: ${GID}

That got me little further in the process

 => [app] exporting to image                                                                                                    0.1s 
 => => exporting layers                                                                                                         0.1s 
 => => writing image sha256:70fb958ba1e5ca20f436cea5525da9b5560999eeabd240f644829aa3d2e493d1                                    0.0s 
 => => naming to docker.io/library/app-app                                                                                      0.0s 
 => [app] resolving provenance for metadata file                                                                                0.0s 
Loading composer repositories with package information
Updating dependencies
Lock file operations: 190 installs, 0 updates, 0 removals
  - Locking alexkart/curl-builder (1.0.8)
  - Locking amphp/amp (v2.6.4)
  - Locking amphp/byte-stream (v1.8.2)
...
    - Locking yiisoft/yii-view-renderer (7.2.0)
  - Locking zircote/swagger-php (4.11.1)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 190 installs, 0 updates, 0 removals
  - Downloading codeception/c3 (2.9.0)
  - Downloading infection/extension-installer (0.1.2)
  - Downloading yiisoft/strings (2.4.0)
  - Downloading yiisoft/arrays (3.1.0)
...
  - Installing yiisoft/arrays (3.1.0): Extracting archive
  - Installing yiisoft/var-dumper (1.7.0): Extracting archive
 0/3 [>---------------------------]   0%    Install of yiisoft/arrays failed
 3/3 [============================] 100%
In RecursiveDirectoryIterator.php line 48:
                                                                                                                            
  RecursiveDirectoryIterator::__construct(/app/vendor/yiisoft/arrays): Failed to open directory: No such file or directory  
                                                                                                                            

update [--with WITH] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--no-autoloader] [--no-suggest] [--no-progress] [-w|--with-dependencies] [-W|--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-m|--minimal-changes] [--patch-only] [-i|--interactive] [--root-reqs] [--bump-after-update [BUMP-AFTER-UPDATE]] [--] [<packages>...]

make: *** [run] Error 1

@nick-lai
Copy link
Contributor

Run composer diagnose to check for common problems:

composer diagnose --profile

Or try clearing the cache and updating the composer version:

composer clear-cache
composer self-update --stable

@np25071984
Copy link
Author

composer self-update --stable

Helped. I am surprised it uses my host system composer while deploying things in docker container...

Also my host 80 port has already been occupied by another app. How to set alternative port number?

@nick-lai
Copy link
Contributor

nick-lai commented Jan 16, 2025

Also my host 80 port has already been occupied by another app. How to set alternative port number?

Modify the DEV_PORT environment variable in docker/.env:

DEV_PORT=80

Then restart the docker container:

make down
make up

@np25071984
Copy link
Author

Now I got this

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants