jikan-me / jikan-rest

The REST API for Jikan
https://docs.api.jikan.moe/
MIT License
435 stars 270 forks source link

Docker build error🐛 #345

Closed zenuu-play closed 1 year ago

zenuu-play commented 1 year ago

Is there an existing issue for this?

Current Behavior

dark@jikan-rest:/var/www/jikan-rest$ sudo docker build -t jikan-rest:nightly .
[+] Building 2.7s (12/12) FINISHED
 => [internal] load .dockerignore                                                                                                                                                                            0.2s
 => => transferring context: 338B                                                                                                                                                                            0.0s
 => [internal] load build definition from Dockerfile                                                                                                                                                         0.1s
 => => transferring dockerfile: 2.68kB                                                                                                                                                                       0.0s
 => [internal] load metadata for docker.io/jikanme/jikan-rest-php:latest                                                                                                                                     0.7s
 => [1/8] FROM docker.io/jikanme/jikan-rest-php:latest@sha256:76301fa37b56ba47fca65508f5a49386f0109ae68451b8afb97e0b992163ca0e                                                                               0.0s
 => [internal] load build context                                                                                                                                                                            0.1s
 => => transferring context: 19.32kB                                                                                                                                                                         0.0s
 => CACHED [2/8] RUN SET -ex     && apt-get update && apt-get install -y --no-install-recommends  openssl  git  dos2unix  unzip   wget  && wget -q "https://github.com/aptible/supercronic/releases/downloa  0.0s
 => CACHED [3/8] WORKDIR /app                                                                                                                                                                                0.0s
 => CACHED [4/8] COPY --chown=jikanapi:jikanapi ./composer.* /app/                                                                                                                                           0.0s
 => CACHED [5/8] RUN if [ -z "$GITHUB_PERSONAL_TOKEN" ]; then echo "** GITHUB_PERSONAL_TOKEN is not set. This build may fail due to github rate limits.";     else composer config github-oauth.github.com   0.0s
 => CACHED [6/8] RUN composer install -n --no-dev --no-cache --no-ansi --no-autoloader --no-scripts --prefer-dist                                                                                            0.0s
 => CACHED [7/8] COPY --chown=jikanapi:jikanapi . /app/                                                                                                                                                      0.0s
 => ERROR [8/8] RUN set -ex     && composer update jikan-me/jikan     && composer dump-autoload -n --optimize     && chmod -R 777 /tmp/composer/cache     && chmod -R a+w storage/     && chown -R jikanapi  1.6s
------
 > [8/8] RUN set -ex     && composer update jikan-me/jikan     && composer dump-autoload -n --optimize     && chmod -R 777 /tmp/composer/cache     && chmod -R a+w storage/     && chown -R jikanapi:jikanapi /app     && chmod +x docker-entrypoint.php     && chmod +x docker-entrypoint.sh:
#0 0.512 + composer update jikan-me/jikan
#0 0.845 Loading composer repositories with package information
#0 1.260 Failed to clone the git@github.com:pushrbx/lumen-roadrunner.git repository, try running in interactive mode so that you can enter your GitHub credentials
#0 1.266
#0 1.280 In Git.php line 484:
#0 1.280
#0 1.280   Failed to execute git clone --mirror -- 'git@github.com:pushrbx/lumen-roadr
#0 1.280   unner.git' '/tmp/composer/cache/vcs/git-github.com-pushrbx-lumen-roadrunner
#0 1.280   .git/'
#0 1.280
#0 1.280   Cloning into bare repository '/tmp/composer/cache/vcs/git-github.com-pushrb
#0 1.280   x-lumen-roadrunner.git'...
#0 1.280   error: cannot run ssh: No such file or directory
#0 1.280   fatal: unable to fork
#0 1.280
#0 1.280
#0 1.281 update [--with WITH] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--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] [-i|--interactive] [--root-reqs] [--] [<packages>...]
#0 1.281
------
Dockerfile:48
--------------------
  47 |
  48 | >>> RUN set -ex \
  49 | >>>     && composer update jikan-me/jikan \
  50 | >>>     && composer dump-autoload -n --optimize \
  51 | >>>     && chmod -R 777 ${COMPOSER_HOME}/cache \
  52 | >>>     && chmod -R a+w storage/ \
  53 | >>>     && chown -R jikanapi:jikanapi /app \
  54 | >>>     && chmod +x docker-entrypoint.php \
  55 | >>>     && chmod +x docker-entrypoint.sh
  56 
--------------------
ERROR: failed to solve: process "/bin/sh -c set -ex     && composer update jikan-me/jikan     && composer dump-autoload -n --optimize     && chmod -R 777 ${COMPOSER_HOME}/cache     && chmod -R a+w storage/     && chown -R jikanapi:jikanapi /app     && chmod +x docker-entrypoint.php     && chmod +x docker-entrypoint.sh" did not complete successfully: exit code: 1

Expected Behavior

No response

Steps To Reproduce

No response

Environment

- OS: Debian 10
- Docker version: 23.0.0, build e92dd87

Anything else?

No response

pushrbx commented 1 year ago

You hit a rate limit from github. You must set a github personal token to be able to build the image. Example:

docker build --build-arg GITHUB_PERSONAL_TOKEN=<your token here> -t jikan-rest:nightly .

Another note: we have to update the docs accordingly.

zenuu-play commented 1 year ago

I was able to build a Docker image, but there were already other problems with the application