-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
official docker images? #26848
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
Comments
HI 👋 |
We just need to ask ourselves if we should publish official Docker images. Have projects comparable to Symfony published their own Docker images? This is very important because Docker is one of the biggest things in the tech landscape ... and it looks like it's going to get much bigger. |
IMHO we should provide this solution to avoid most common installation problem. |
What is the point of having a Docker image with a framework that is in itself a building block for applications that are themselves candidates for Docker images? To me it makes as much sense as having Docker images for the C++ stdlib or the PHP Xdebug extension. Building blocks are built into other images, not into their own. |
I agree with @curry684 the a common Dockerfile for symfony or any other framework include steps to build, install libraries, copy source files, execute custom steps, etc. A base image of symfony cant provide any of this steps. Maybe the question is if symfony can provide a set of Dockerfiles which could be used for our constructions |
Doesn't make sense to me either. Symfony is a framework, not a service. @laurencefass what's your goal? You want just preconfigured LEMP stack? Chosen stack would have be very opinionated and many people wouldn't like that. |
So why Symfony provide an easy way to use the PHP built it server if nobody need it ? |
@ismail1432 you're confusing "Dockerfiles" and "Docker images". We don't see a point in having official Docker images as explained. Some guidance on how to build a Dockerfile for your Symfony project could be pretty damn useful (although to be honest - I've written 50+ of them for Symfony projects and there's not a single Symfony-specific line in any of them). |
Thanks @curry684 |
Also have a look at Lando, which utilizes Docker. Building a LEMP stack with Symfony is really super easy, here's how i did it: https://github.com/ro0NL/symfony-lando |
IMHO Symfony Docker images by itself will not work as previous guys said, Symfony is only a framework to build other apps. All you need is Docker image with PHP of your need (and probably composer + some PECL/PEAR packages but it also may be made with small Dockerfile) and things will work fine. |
Looks like a really good idea - IMHO we should provide inside symfony-skeleton base dockerfile (it is really easy to maintain) which allows to run symfony with only docker on host. |
To run a Symfony app in Docker, the base is a PHP image with required extensions and some php.ini configuration (timezone). This can be a php-fpm or php-cli image. It might be possible to create de Composer plugin that generate a Dockerfile with the extensions required by the project. Then, an ngnix or Apache vhost must be configured. |
What about integrating this into Flex, to provide a recipe for a basic Dockerfile and allow packages to add elements into this Dockerfile like in the env file? It would be the best way IMO. |
Related Flex issue: symfony/flex#54 and PR: symfony/flex#128 |
Also related.. instead of images a docker-compose in symfony/symfony would be nice, to run the tests :) |
I don't think having an official image is preferable, Symfony is a light-weight framework since Flex and providing an image can be counterproductive due to the fact that what if the developers don't want to use Docker but Vagrant or other? I know that using Docker is optional but as long as you have PHP or a PHP image in your desktop, Symfony can work like a charm. For me, it could be way more valuable to have a full configuration (using Docker-Compose and Kubernetes) for Symfony, this way, we can both use the advantages of Docker and Kubernetes and keep the framework away from the usage of Docker is the developer doesn't want it. |
This was rejected in https://github.com/symfony/symfony-standard/issues/992 |
Official docker image (or images) could contain php extensions, compiled with |
Speaking from experience I stopped using the official PHP images altogether as they're bloated and the Had too many issues with Alpine packages being severely outdated as well, hence Debian Slim. |
@curry684 do you have any plan to write a blog post describing your approach ? |
If it's to be published somewhere with enough readers sure. Like I said it's hardly Symfony specific but I've got a lot of experience in deploying various PHP applications via Docker. I could also set up an example repo with Nginx, Redis etc. Just don't expect anything soon as I'm swamped in work hehe, and I've also got stuff to do on my own bundles. |
Yes the debian:stretch-slim + Sury packages sound interesting. |
Official docker image Images, based on |
@curry684 still busy ? |
Permanently 😉 but it also kinda got off my radar for lack of a publishing platform. Not sure it would still be needed now a year later. |
Let's close this one as I don't see how a Docker image for Symfony would help anyone. As other people said, there is nothing Symfony specific. We might have some docs about how to use Docker though. |
+1 for the docs! |
Uh oh!
There was an error while loading. Please reload this page.
I would very much like to have access to an instant symfony flex site built on best practices with all tools preinstalled.
Do you publish official docker images? If not do you have any plans to?
Thanks.
The text was updated successfully, but these errors were encountered: