you can build your own symfony images
$ git clone [email protected]:m3hr24d/docker-symfony.git
or
$ git clone [email protected]:m3hr24d/docker-symfony.git
you can pull default images
I try to explain how this project can help to you by an example, let's assume that you have a symfony project that it's name is
task-list. so, you will have a repo like this:
https://gitlab.com/[user]/task-list
and you will have a registry (if enabled before in setting) like this:
registry.gitlab.com/[user]/task-list
now, you want build a docker image for this project:
go to docker-symfony directory
$ cd docker-symfony
run command below:
$ make build REGISTRY_NAME=registry.gitlab.com/[user]/task-list DISTRO=[debian]
you can see your image with latest version by run this:
$ docker images
now, you can push your image to your project's registry, just do:
$ make release REGISTRY_NAME=registry.gitlab.com/[user]/task-list
-
REGISTRY_NAME:
requiredin bothbuildandreleasecommand, registry address of your project. -
DISTRO:
requiredinbuildcommand. chose your distribution. for example:debian,alpineor ... -
EXPOSED_PORTS:
optionalinbuildcommand. default exposed ports are80 443. you can expose additional ports with this format, EX:"443 8080 3306"(with double quote) -
VERSION:
optionalin bothbuildandreleasecommand, default valuelatest, you can manage your image's revision by this variable -
DEBUG:
optionaljust use inbuildcommand, default valuefalse, when set totrue, you can see all of debug information in build time, and also used to build a development docker image for the project
Note: when your image created successfully, you will have an environment variable named
DEBUGthat it's value is same as theDEBUGargument
-
PROJECT_NAME:
optionaljust use inbuildcommand, default valueapp, after build completed successfully, you have in your image, a user with same name, a home directory for the user, a project directory with this path/srv/[PROJECT_NAME]that owned by the user -
APT_CACHER_SERVER:
optionaljust use inbuildcommand and whenDISTROis based on debian, default valuenull, if you use an apt cacher server, you can pass that's address and port to your image and use that
Note: when your image created successfully, apt-cacher's config will be remove from image
Note: apt cacher server must be passed with schema, like this: http(s)://[apt-cacher-server-ip]:[port]