ficusio / openresty

Lightweight OpenResty Docker image
132 stars 37 forks source link

build error #1

Closed ghost closed 9 years ago

ghost commented 9 years ago

Greetings!

I'm getting this error when I try to build my container FROM ficusio/openresty:latest and/or FROM ficusio/openresty:debian.

Status: Downloaded newer image for ficusio/openresty:latest
# Executing 2 build triggers
Trigger 0, RUN rm -rf conf/* html/*
Step 0 : RUN rm -rf conf/* html/*
 ---> Running in 229d709b1a33
Trigger 1, COPY nginx /opt/openresty/nginx/
Step 0 : COPY nginx /opt/openresty/nginx/
2015/02/01 01:47:55 nginx: no such file or directory
skozin commented 9 years ago

Hi! I am still in the process of writing proper documentation, and just now published a sample app: https://github.com/ficusio/openresty/tree/master/_example.

This image uses ONBUILD hook that automatically copies everything from the nginx/ directory (located at the root of Docker build context, next to your Dockerfile) to /opt/openresty/nginx/. NginX is configured with that prefix path, and by default uses config file located at /opt/openresty/nginx/conf/nginx.conf.

So, in order to get it working, you need to place NginX config in nginx/conf/nginx.conf:

project_root/
 ├ nginx/ # all subdirs/files will be copied to /opt/openresty/nginx/
 |  ├ conf/
 |  |  └ nginx.conf
 |  └ # any other files/dirs, e.g. html/
 └ Dockerfile

And then use a Dockerfile like this:

FROM ficusio/openresty:latest
EXPOSE 8080

Docker CMD is set to nginx -g 'daemon off; error_log /dev/stderr info;', so it is launched in non-daemon mode and outputs error log to stderr (to simplify log collection using tools like progruim/logspout). You can override this CMD directive in your Dockerfile if you wish to use different command-line args.

ghost commented 9 years ago

Makes sense. I'll kill my fork now as this is technically not a problem that needs to be solved.