getmango / Mango

Mango is a self-hosted manga server and web reader
https://getmango.app
MIT License
1.68k stars 118 forks source link

[Bug Report] Dockerfile fails to build from `master` and `v0.26.2` tag on Windows #318

Closed tylercamp closed 2 years ago

tylercamp commented 2 years ago

Describe the bug Attempting to build a docker image fails with error:

#13 100.8 Using sanitize (0.1.0 at e09520e)
#13 100.8 crystal build src/mango.cr --release --progress --static --error-trace
#13 101.0 In src/mango.cr:1:1
#13 101.0
#13 101.0  1 | require "./config"
#13 101.0      ^
#13 101.0 Error: while requiring "./config"
#13 101.0
#13 101.0
#13 101.0 In src/config.cr:50:58
#13 101.0
#13 101.0  50 | puts "The config file #{cfg_path} does not exist. " \
#13 101.0                                                            ^
#13 101.0 Error: unknown token: '\r'
make: *** [Makefile:18: static] Error 1

To Reproduce Clone the repo and run docker build -t XYZ .

Environment (please complete the following information):

Docker (if you are running Mango in a Docker container)

Additional context I'm attempting to build the image myself so I can add an EXPOSE 9000 line to the Dockerfile; explicit EXPOSE is needed in the docker image for Traefik which auto-detects ports for containers and exposes them behind HTTPS.

I've not tried older tags.

hkalexling commented 2 years ago

Windows line breaks strike again :) Can you give https://github.com/hkalexling/Mango/issues/306#issuecomment-1147999115 a try?

tylercamp commented 2 years ago

@hkalexling Thank you for that note and quick response, I've instead cloned and built the repo using Ubuntu on Windows (instead of via Windows terminal) and I was able to build the image without issue