8000 official docker images? · Issue #26848 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
10000

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

Closed
laurencefass opened this issue Apr 6, 2018 · 28 comments
Closed

official docker images? #26848

laurencefass opened this issue Apr 6, 2018 · 28 comments

Comments

@laurencefass
Copy link
laurencefass commented Apr 6, 2018
Q A
Bug report? yes/no
no
Feature request? yes/no
no
BC Break report? yes/no
no
RFC? yes/no
no
Symfony version x.y.z
4

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.

@ismail1432
Copy link
Contributor

HI 👋
There is no official image but you can see these links https://github.com/mykiwi/dockerfiles and https://github.com/dunglas/symfony-docker

@javiereguiluz
Copy link
Member

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.

@ismail1432
Copy link
Contributor

IMHO we should provide this solution to avoid most common installation problem.
Api platform
https://github.com/api-platform/api-platform and it works like a charm

@curry684
Copy link
Contributor
curry684 commented Apr 6, 2018

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.

@bitgandtter
Copy link
Contributor

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

@ostrolucky
Copy link
Contributor

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.

@ismail1432
Copy link
Contributor

So why Symfony provide an easy way to use the PHP built it server if nobody need it ?
I think most of people copy the same basic Docker file for each new Symfony project.
The idea is just to create one « official »

@curry684
Copy link
Contributor
curry684 commented Apr 6, 2018

@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).

@ismail1432
Copy link
Contributor

Thanks @curry684

@ro0NL
Copy link
Contributor
ro0NL commented Apr 7, 2018

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

@ZipoKing
Copy link
Contributor
ZipoKing commented Apr 7, 2018

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.

@mleczakm
Copy link
Contributor
mleczakm commented Apr 8, 2018

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.

@GromNaN
Copy link
Member
GromNaN commented Apr 9, 2018

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.

@tgalopin
Copy link
Contributor
tgalopin commented Apr 9, 2018

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.

@mhujer
Copy link
Contributor
mhujer commented Apr 9, 2018

Related Flex issue: symfony/flex#54 and PR: symfony/flex#128

@ro0NL
Copy link
Contributor
ro0NL commented Apr 12, 2018

Also related.. instead of images a docker-compose in symfony/symfony would be nice, to run the tests :)

@Guikingone
Copy link
Contributor

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.

@dkarlovi
Copy link
Contributor

This was rejected in https://github.com/symfony/symfony-standard/issues/992

@covex-nn
Copy link
covex-nn commented Jun 15, 2018

Official docker image (or images) could contain php extensions, compiled with docker-php-ext-install, and instructions how to get them with RUN apk add / RUN apt-get install and COPY --from=symfony/php ...

@curry684
Copy link
Contributor

Speaking from experience I stopped using the official PHP images altogether as they're bloated and the docker-php-ext-install command and its kin are a mess. Instead I just use debian:stretch-slim as a base image and install Sury packages into them. More fine-grained control, less build issues, builds 10 times faster, and to top it all gives smaller images as a bonus.

Had too many issues with Alpine packages being severely outdated as well, hence Debian Slim.

@stof
Copy link
Member
stof commented Jun 16, 2018

@curry684 do you have any plan to write a blog post describing your approach ?

@curry684
Copy link
Contributor

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.

@webda2l
Copy link
8000
webda2l commented Jun 18, 2018

@covex-nn
Copy link
covex-nn commented Jun 18, 2018

Official docker image php:7.2.6-fpm-stretch contains a layer with $PHPIZE_DEPS. It is 200Mb (i used docker save php:7.2.6-fpm-stretch > stretch.tar to check, all files are not zipped there), all layers for PHP image (without debian) take 316Mb. Debian's layer takes 56Mb

Images, based on debian:stretch-slim, that uses Sury packages, will not contain a layer with phpize, and php-containers will be smaller! I found some Dockerfile, removed some tweaks, simplified and made my own Dockerfile just with php-fpm. Two my layers took 73Mb =)

@Simperfit
Copy link
Contributor

@curry684 still busy ?

@curry684
Copy link
Contributor

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.

@fabpot
Copy link
Member
fabpot commented Apr 24, 2019

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.

@fabpot fabpot closed this as completed Apr 24, 2019
@Aerendir
Copy link
Contributor

+1 for the docs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0