torikushiii / hoyolab-auto

Auto check-in and others for any Hoyoverse games
https://ko-fi.com/torikushiii
GNU Affero General Public License v3.0
56 stars 12 forks source link

Regarding the Docker section of the README #27

Closed Capoouo closed 2 weeks ago

Capoouo commented 2 weeks ago

If you only install Docker without installing Make, you will not be able to use the method described in the README to start the Docker container. You might still need to use the previous method to start it

or install make

torikushiii commented 2 weeks ago

I see, then how about this instruction https://gist.github.com/torikushiii/b0d684d90a65af20b03383d5c4806dfd

Capoouo commented 2 weeks ago

I see, then how about this instruction https://gist.github.com/torikushiii/b0d684d90a65af20b03383d5c4806dfd

Currently, there is no issue. For example, if I only installed Docker Desktop, it might cause the Docker container to lack the git command, leading to this problem. You need to add RUN apk add --no-cache git in the Dockerfile for it to work properly 123

edit : I would like to correct my previous statement. Currently, adding RUN apk add --no-cache git will cause this error.

321

torikushiii commented 2 weeks ago

/bin/sh: git: not found might be cause by this

https://github.com/torikushiii/hoyolab-auto/blob/d80b21ed59d8349a9c36657d22fe27d3d1386385/crons/code-redeem/resolvers/star-rail/defaults/starrail-api.js#L4-L14

but for the last one, im not so sure yet, but i can guess, I'm assuming you downloaded the repo directly and not using git clone? if so, thats one of the reason

Capoouo commented 2 weeks ago

/bin/sh: git: not found might be cause by this

https://github.com/torikushiii/hoyolab-auto/blob/d80b21ed59d8349a9c36657d22fe27d3d1386385/crons/code-redeem/resolvers/star-rail/defaults/starrail-api.js#L4-L14

but for the last one, im not so sure yet

The issue appears to be that there is no app/.git directory inside the container after my edit

I used git clone to do that 111

Capoouo commented 2 weeks ago

/bin/sh: git: not found might be cause by this

https://github.com/torikushiii/hoyolab-auto/blob/d80b21ed59d8349a9c36657d22fe27d3d1386385/crons/code-redeem/resolvers/star-rail/defaults/starrail-api.js#L4-L14

but for the last one, im not so sure yet, but i can guess, I'm assuming you downloaded the repo directly and not using git clone? if so, thats one of the reason

I found the reason. It's because .dockerignore includes .git, which caused it to ignore the .git folder and led to subsequent issues

I added RUN apk add --no-cache git in the Dockerfile and removed .git from .dockerignore. Everything is working fine now.

torikushiii commented 2 weeks ago

im an absolute idiot, thank you for finding this, i've been trying replicating it myself and totally forgot the .dockerignore file

Capoouo commented 2 weeks ago

im an absolute idiot, thank you for finding this, i've been trying replicating it myself and totally forgot the file.dockerignore

After you update the README, you can close this issue. Thank you<3