Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Alpine Linux + nginx + Phalcon 3 + PHP 7.1 - Docker Optimized Container

I seem to be getting an error in my Alpine Dockerfile build. It only happens if I try to (as best practices for a smaller image size) to execute all in a single command, install packages, then ./install and then temove the packages and apk cache as well as cphalcon source.

The build is sucessfull, but I get a error after ./install and the container build stops. I need to be able to execute it on the same RUN command so that I can remove all packages and files that are not being used anymore, not point in having another RUN command to remove those files as the layer still exists.

Build succeed: Please restart your web server to complete the installation ERROR: Service 'apivuejs' failed to build: The command 'XXXXXX' *' returned a non-zero code: 1

Can someone help me ?

Example Dockerfile => https://gist.github.com/andrefauth/544022cd03c98205227326c10b6a846e

If I run the ./install and then another RUN command, the image builds but that defeats the purpose of using Alpine for a smaller container image.

Thanks in advance!



1.0k
Accepted
answer
edited Feb '18

Sorry guys, there was a typo in my Dockerfile.

Here is the final solution I came up with.

https://gist.github.com/andrefauth/88ec3133180ae98fdc5c83fd76f01ed8