C1710 / emoji_builder

Apache License 2.0
4 stars 1 forks source link

/bin/sh: 1: /github_workflow_setup.sh: Permission denied #14

Open azumukupoe opened 2 years ago

azumukupoe commented 2 years ago
[+] Building 2.3s (10/10) FINISHED
 => [internal] load build definition from Dockerfile                                                   0.0s
 => => transferring dockerfile: 558B                                                                   0.0s
 => [internal] load .dockerignore                                                                      0.0s
 => => transferring context: 113B                                                                      0.0s
 => [internal] load metadata for ghcr.io/c1710/emoji_builder:latest                                    1.0s
 => [internal] load build context                                                                      1.0s
 => => transferring context: 58.51MB                                                                   1.0s
 => [1/5] FROM ghcr.io/c1710/emoji_builder@sha256:0acdfb67e992f3902db9b585bf68d02c2f5d326505d8b33a9b7  0.0s
 => CACHED [2/5] COPY svg ./svg                                                                        0.0s
 => CACHED [3/5] COPY third_party/region-flags/svg ./flags                                             0.0s
 => CACHED [4/5] COPY emoji_aliases.txt NotoColorEmoji.tmpl.ttx.tmpl Blobmoji.gpl ./                   0.0s
 => CACHED [5/5] COPY AUTHORS CONTRIBUTORS CHANGES.md LICENSE ./                                       0.0s
 => exporting to image                                                                                 0.1s
 => => exporting layers                                                                                0.0s
 => => writing image sha256:ce66b2c5522c956d8147248be7ad24f5a48cb04e8a734e79257d8de8e638e3aa           0.0s
 => => naming to docker.io/library/blobmoji                                                            0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
/bin/sh: 1: /github_workflow_setup.sh: Permission denied
failed to resize tty, using default size

using Docker Desktop for Windows

azumukupoe commented 2 years ago

I edited the Dockerfile of https://github.com/C1710/blobmoji like below to avoid some errors

FROM ghcr.io/c1710/emoji_builder

COPY svg ./svg
COPY third_party/region-flags/svg ./flags
COPY emoji_aliases.txt NotoColorEmoji.tmpl.ttx.tmpl Blobmoji.gpl ./
COPY AUTHORS CONTRIBUTORS CHANGES.md LICENSE ./

VOLUME /build
VOLUME /output

RUN apt-get update -y && apt-get install libpython3.9 fonttools -y
RUN pip install notofonttools

CMD bash /github_workflow_setup.sh && \
    /bin/emoji_builder -vv -b /build -o Blobmoji.ttf -O /output --flags ./flags blobmoji -w -a ./emoji_aliases.txt --ttx-tmpl ./NotoColorEmoji.tmpl.ttx.tmpl --palette ./Blobmoji.gpl && \
    mv /output/Blobmoji_win.ttf /output/BlobmojiWindows.ttf

but still couldn't solve errors like

Traceback (most recent call last):
  File "add_emoji_gsub.py", line 26, in <module>
ModuleNotFoundError: No module named 'nototools'

ERROR: File not found: "/build/font.tmpl.ttx"

DavidBerdik commented 2 years ago

I am also observing this issue. Advice on fixing it would be greatly appreciated.

C1710 commented 2 years ago

Sorry for the long delay, I'm currently mainly busy with my Master's Thesis.

So I made some changes which at least make the build work.
I don't understand at all where the problem is, so I'm not sure whether it works now or not.

[EDIT] Now I have an idea: It might be a line ending issue.....

DavidBerdik commented 2 years ago

It's all good. Take your time! I ended up using the Emoji 15 build that you already provided, so I no longer have the need to build by myself. That said, I can still try testing it if you want. Or perhaps @azumukupoe can?

azumukupoe commented 2 years ago

still getting the same error...

[+] Building 2.0s (10/10) FINISHED
 => [internal] load build definition from Dockerfile                                                               0.0s
 => => transferring dockerfile: 38B                                                                                0.0s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 34B                                                                                   0.0s
 => [internal] load metadata for ghcr.io/c1710/emoji_builder:latest                                                1.7s
 => [1/5] FROM ghcr.io/c1710/emoji_builder@sha256:c13a03112ccfd88f63cb6f3d5b54848b9a9cc508aa995f5b55025b49c7c75c9  0.0s
 => [internal] load build context                                                                                  0.1s
 => => transferring context: 211.64kB                                                                              0.1s
 => CACHED [2/5] COPY svg ./svg                                                                                    0.0s
 => CACHED [3/5] COPY third_party/region-flags/svg ./flags                                                         0.0s
 => CACHED [4/5] COPY emoji_aliases.txt NotoColorEmoji.tmpl.ttx.tmpl Blobmoji.gpl ./                               0.0s
 => CACHED [5/5] COPY AUTHORS CONTRIBUTORS CHANGES.md LICENSE ./                                                   0.0s
 => exporting to image                                                                                             0.1s
 => => exporting layers                                                                                            0.0s
 => => writing image sha256:47f089b38bb7e13cafc3800bceb44139493786793b9a58f75cf8e4d8d029987d                       0.0s
 => => naming to docker.io/library/blobmoji                                                                        0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
/bin/sh: 1: /github_workflow_setup.sh: Permission denied
failed to resize tty, using default size
C1710 commented 2 years ago

still getting the same error...

[+] Building 2.0s (10/10) FINISHED
 => [internal] load build definition from Dockerfile                                                               0.0s
 => => transferring dockerfile: 38B                                                                                0.0s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 34B                                                                                   0.0s
 => [internal] load metadata for ghcr.io/c1710/emoji_builder:latest                                                1.7s
 => [1/5] FROM ghcr.io/c1710/emoji_builder@sha256:c13a03112ccfd88f63cb6f3d5b54848b9a9cc508aa995f5b55025b49c7c75c9  0.0s
 => [internal] load build context                                                                                  0.1s
 => => transferring context: 211.64kB                                                                              0.1s
 => CACHED [2/5] COPY svg ./svg                                                                                    0.0s
 => CACHED [3/5] COPY third_party/region-flags/svg ./flags                                                         0.0s
 => CACHED [4/5] COPY emoji_aliases.txt NotoColorEmoji.tmpl.ttx.tmpl Blobmoji.gpl ./                               0.0s
 => CACHED [5/5] COPY AUTHORS CONTRIBUTORS CHANGES.md LICENSE ./                                                   0.0s
 => exporting to image                                                                                             0.1s
 => => exporting layers                                                                                            0.0s
 => => writing image sha256:47f089b38bb7e13cafc3800bceb44139493786793b9a58f75cf8e4d8d029987d                       0.0s
 => => naming to docker.io/library/blobmoji                                                                        0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
/bin/sh: 1: /github_workflow_setup.sh: Permission denied
failed to resize tty, using default size

Could you try to add a chmod before the CMD? (Like RUN chmod +x /github_workflow_setup.sh)

Maybe COPY does not correctly copy the permissions?

azumukupoe commented 2 years ago

where should I put that in docker build . -t blobmoji && docker run --rm -it -v "$PWD/output:/output" blobmoji?

C1710 commented 2 years ago

where should I put that in docker build . -t blobmoji && docker run --rm -it -v "$PWD/output:/output" blobmoji?

In the Dockerfile, such that it looks like this:

FROM ghcr.io/c1710/emoji_builder

COPY svg ./svg
COPY third_party/region-flags/svg ./flags
COPY emoji_aliases.txt NotoColorEmoji.tmpl.ttx.tmpl Blobmoji.gpl ./
COPY AUTHORS CONTRIBUTORS CHANGES.md LICENSE ./

VOLUME /build
VOLUME /output

RUN apt-get update -y && apt-get install libpython3.9 fonttools -y
RUN pip install notofonttools

# NEW
RUN chmod +x /github_workflow_setup.sh

CMD bash /github_workflow_setup.sh && \
    /bin/emoji_builder -vv -b /build -o Blobmoji.ttf -O /output --flags ./flags blobmoji -w -a ./emoji_aliases.txt --ttx-tmpl ./NotoColorEmoji.tmpl.ttx.tmpl --palette ./Blobmoji.gpl && \
    mv /output/Blobmoji_win.ttf /output/BlobmojiWindows.ttf
azumukupoe commented 2 years ago

that almost worked until it gave me

Traceback (most recent call last):
  File "add_emoji_gsub.py", line 26, in <module>
ModuleNotFoundError: No module named 'nototools'

and ERROR: File not found: "/build/font.tmpl.ttx"

also, https://github.com/C1710/blobmoji/blob/d0c143dccb5f4aa6cc07e40ae02f5c5a7ac0991b/Dockerfile#L6 should be COPY AUTHORS_Noto CONTRIBUTORS_Noto CHANGES.md LICENSE ./ I think?