- Notifications
You must be signed in to change notification settings - Fork0
Docker image of vips with HTTP interface
Nakilon/vips-shell2http
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
From the host machine you already can use any ofexisting Dockerhub images that have vips prebuilt.
But if you want to call vips from another container you need the
Thevips image is by @felixbuenemann
Thewebserver is by @msoap
Luckily the shell2http was built on the same OS so to integrate these two things I had to just copy the binary.
This container runs arbitrary chain of shell commands to process posted image that shell2http implicitly puts somewhere in/tmp folder:
docker run --rm --read-only --tmpfs /tmp -p 8080:8080 vips-shell2http -show-errors -form /"eval\$v_command"This curl posts an image and asks it to crop and respond with RGB pixels printed as TSV for further processing:
curl -s -X POST -F file=@/home/ubuntu/Downloads/house.png \ -F factor=3 -F left=10 -F top=30 -F width=4 -F height=6 \ -F command="vips crop\$filepath_file /tmp/temp.v\$v_left\$v_top\$v_width\$v_height && vips bandunfold /tmp/temp.v /tmp/temp_.v --factor\$v_factor && vips csvsave /tmp/temp_.v /tmp/temp.csv && cat /tmp/temp.csv" http://localhost:8080/
39 26 21 34 21 17 29 19 18 27 18 1840 26 22 34 22 18 30 19 18 27 18 1735 22 18 34 21 17 33 22 21 30 21 2034 21 16 33 21 16 33 23 22 32 23 2233 20 16 33 20 16 34 24 23 35 26 2433 20 16 33 20 16 35 25 23 35 26 25To call it from another container specify the container hostname withdocker run --name ... or using docker-compose.
Caution: if you run the container like in this example (evaling an arbitrary command) you provide the shell access that in case of port being opened to Internet (throughdocker run -p and host firewall) is kind of vulnerability. Be sure you don't give this container an access to valuable source code, images and that it is launched only in docker networks with containers that don't have ports opened.
About
Docker image of vips with HTTP interface
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Contributors2
Uh oh!
There was an error while loading.Please reload this page.