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

Docker image #16

Open
bnutzer opened this issue Nov 16, 2021 · 2 comments
Open

Docker image #16

bnutzer opened this issue Nov 16, 2021 · 2 comments

Comments

@bnutzer
Copy link

bnutzer commented Nov 16, 2021

Hi,

ascii-image-converter just created the perfect startup banner for our spring boot application. Thanks a bunch!

As already noted, packaging is not trivial. A docker image for ascii-image-converter would make usage easier without the need for any local installation.

I am attaching a Dockerfile that created a well usable image for me.
Dockerfile.ascii-image-converter.txt

(Usage: place in a working directory, such as an empty dir or the local git repo, execute docker build -t ascii-image-converter -f Dockerfile.ascii-image-converter.txt .. Usage of resulting image: docker run --rm -it ascii-image-converter <url>, or docker run -v $(pwd):/data --rm -it ascii-image-converter /data/<localfile>).

Would you be interested in providing an "official" image on docker hub?

If you prefer the file as a pull request, just give me a note.

@TheZoraiz
Copy link
Owner

Looks neat. However, I don't have a wealth of experience using, or maintaining docker images. A tad bit busy these days but I'll review and think about this soon.

@vx-github
Copy link

@bnutzer I did somewhat the same, but with a smaller (multi-stage) image build: https://hub.docker.com/r/dockvx/ascii-image-converter

@TheZoraiz I found out I need to supply --width when running from the image. Leaving --width out will result in a panic when converting a local file:

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/TheZoraiz/ascii-image-converter/image_manipulation.ConvertToAsciiChars({0x0?, 0x872a00?, 0x884da0?}, 0x0?, 0x0?, 0x88?, 0x0?, 0x0?, {0x0, 0x0}, ...)
	/go/pkg/mod/github.com/!the!zoraiz/ascii-image-converter@v1.13.0/image_manipulation/ascii_conversions.go:55 +0xa51
github.com/TheZoraiz/ascii-image-converter/aic_package.pathIsImage({0x7ffc22446f1c, 0x14}, {0x0, 0x0}, 0x0, {0x0, 0x0, 0x0}, {0x0, 0x0, ...}, ...)
	/go/pkg/mod/github.com/!the!zoraiz/ascii-image-converter@v1.13.0/aic_package/convert_image.go:62 +0x3b4
github.com/TheZoraiz/ascii-image-converter/aic_package.Convert({0x7ffc22446f1c, 0x14}, {{0x0, 0x0, 0x0}, 0x0, 0x0, 0x0, {0x0, 0x0}, ...})
	/go/pkg/mod/github.com/!the!zoraiz/ascii-image-converter@v1.13.0/aic_package/convert_root.go:201 +0xc50
github.com/TheZoraiz/ascii-image-converter/cmd.printAscii({0x7ffc22446f1c?, 0x75a146?}, {{0x0, 0x0, 0x0}, 0x0, 0x0, 0x0, {0x0, 0x0}, ...})
	/go/pkg/mod/github.com/!the!zoraiz/ascii-image-converter@v1.13.0/cmd/root.go:112 +0x58
github.com/TheZoraiz/ascii-image-converter/cmd.glob..func1(0xd51aa0?, {0xc0000a1530?, 0x1, 0x1?})
	/go/pkg/mod/github.com/!the!zoraiz/ascii-image-converter@v1.13.0/cmd/root.go:102 +0x3bf
github.com/spf13/cobra.(*Command).execute(0xd51aa0, {0xc0000b2010, 0x1, 0x1})
	/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:856 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0xd51aa0)
	/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960 +0x39d
github.com/spf13/cobra.(*Command).Execute(...)
	/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:897
github.com/TheZoraiz/ascii-image-converter/cmd.Execute()
	/go/pkg/mod/github.com/!the!zoraiz/ascii-image-converter@v1.13.0/cmd/root.go:133 +0x25
main.main()
	/go/pkg/mod/github.com/!the!zoraiz/ascii-image-converter@v1.13.0/main.go:22 +0x17

This doesn't happen when converting an image from an URL, so this could be a bug when converting local files?

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

3 participants