File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed
Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change 55
66 vars :
77 base_image : debian:stretch
8- container_name : build_container
8+ container_name : php_apache_build_container
9+ image_namespace : geerlingguy
910 image_name : php-apache
1011
1112 # Apache settings.
1718 - libapache2-mod-php7.2
1819 php_install_recommends : no
1920
21+ # Handy utilities.
22+ handy_utilities :
23+ - curl
24+ - unzip
25+ - tar
26+
2027 pre_tasks :
21- - name : Make the base image available locally.
28+ - name : Make the latest version of the base image available locally.
2229 docker_image :
2330 name : ' {{ base_image }}'
31+ force : yes
2432
2533 - name : Create the Docker container.
2634 docker_container :
6068 delegate_to : ' {{ container_name }}'
6169
6270 post_tasks :
71+ - name : Install handy utilities.
72+ package :
73+ name : " {{ item }}"
74+ state : present
75+ with_items : " {{ handy_utilities }}"
76+ delegate_to : ' {{ container_name }}'
77+
6378 - name : Clean up the container.
6479 shell : >
6580 apt-get remove --purge -y python &&
6681 rm -rf /var/lib/apt/lists/*
6782 delegate_to : ' {{ container_name }}'
83+ args :
84+ warn : no
6885
6986 - name : Commit the container.
7087 command : >
7188 docker commit
72- -c 'CMD ["nginx ", "-g ", "daemon off; "]'
73- {{ container_name }} {{ image_name }}
89+ -c 'CMD ["/usr/sbin/apache2ctl ", "-D ", "FOREGROUND "]'
90+ {{ container_name }} {{ image_namespace }}/{{ image_name }}:{{ php_version }}
7491
7592 - name : Remove the container.
7693 docker_container :
You can’t perform that action at this time.
0 commit comments