How to install imgproxy using Docker?

I’m trying to install imgproxy using Docker, but not having much luck. I bet it’s pretty straight forward but I don’t have much experience using Docker.

I simply forked the imgproxy repo and added this render.yaml file:

services:
  - type: web
    name: imgproxy
    env: docker
    dockerfilePath: ./docker/Dockerfile
    envVars:
      - key: IMGPROXY_KEY
        sync: false
      - key: IMGPROXY_SALT
        sync: false

During deploy I get the following error:

Jul 11 03:09:37 PM  ==> Cloning from https://github.com/marckohlbrugge/imgproxy...
Jul 11 03:09:43 PM  ==> Checking out commit 9627ee6de418f62db524452cf7ae973ca6bf897f in branch master
Jul 11 03:09:57 PM  #2 [internal] load .dockerignore
Jul 11 03:09:57 PM  #2 sha256:56b9f36a1a7cd5c9accdb11a311a9f4d970b9c0852af2b936a61a31bed9f8828
Jul 11 03:09:58 PM  #2 transferring context:
Jul 11 03:09:58 PM  #2 transferring context: 157B done
Jul 11 03:09:58 PM  #2 ...
Jul 11 03:09:58 PM  
Jul 11 03:09:58 PM  #1 [internal] load build definition from Dockerfile
Jul 11 03:09:58 PM  #1 sha256:b3de8aa72aa3e0ee946f234e0eeab79fcab4935c14e80aa9c060e541e5a943c1
Jul 11 03:09:58 PM  #1 transferring dockerfile: 2B done
Jul 11 03:09:58 PM  #1 DONE 0.7s
Jul 11 03:09:58 PM  
Jul 11 03:09:58 PM  #2 [internal] load .dockerignore
Jul 11 03:09:58 PM  #2 sha256:56b9f36a1a7cd5c9accdb11a311a9f4d970b9c0852af2b936a61a31bed9f8828
Jul 11 03:09:58 PM  #2 DONE 0.9s
Jul 11 03:09:58 PM  error: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /home/user/.local/tmp/buildkit-mount688216287/Dockerfile: no such file or directory
Jul 11 03:09:58 PM  error: exit status 1

Looks like it can’t find the Docker file despite having configured its location.

Any advice?

Configuring the dockerContext seems to help. The log is much longer with lots of successful commands. But it ends with this error:

…
Jul 11 03:17:12 PM   > [stage-1 5/5] COPY NOTICE /usr/local/share/doc/imgproxy/:
Jul 11 03:17:12 PM  ------
Jul 11 03:17:12 PM  Dockerfile:27
Jul 11 03:17:12 PM  --------------------
Jul 11 03:17:12 PM    25 |     COPY --from=0 /usr/local/lib /usr/local/lib
Jul 11 03:17:12 PM    26 |
Jul 11 03:17:12 PM    27 | >>> COPY NOTICE /usr/local/share/doc/imgproxy/
Jul 11 03:17:12 PM    28 |
Jul 11 03:17:12 PM    29 |     ENV VIPS_WARNING=0
Jul 11 03:17:12 PM  --------------------
Jul 11 03:17:12 PM  error: failed to solve: rpc error: code = Unknown desc = failed to compute cache key: "/NOTICE" not found: not found
Jul 11 03:17:12 PM  error: exit status 1

So it seems like COPY NOTICE /usr/local/share/doc/imgproxy/ fails. NOTICE is a text file in the root. Looks like it cannot be found.

BTW, I did find the follow installation instructions as well. But I’m not sure how to use this on Render?

imgproxy can (and should) be used as a standalone application inside a Docker container. Just pull the official image from Docker Hub:

docker pull darthsim/imgproxy:latest
docker run -p 8080:8080 -it darthsim/imgproxy

You can also build your own image. imgproxy is ready to be dockerized, plug and play:

docker build -f docker/Dockerfile -t imgproxy .
docker run -p 8080:8080 -it imgproxy

Figured it out.

All it takes is a GitHub repo with one Dockerfile. It should have this content:

FROM darthsim/imgproxy:latest

That tells it to use the latest darthsim/imgproxy image.