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 5
5
6
6
vars :
7
7
base_image : debian:stretch
8
- container_name : build_container
8
+ container_name : php_apache_build_container
9
+ image_namespace : geerlingguy
9
10
image_name : php-apache
10
11
11
12
# Apache settings.
17
18
- libapache2-mod-php7.2
18
19
php_install_recommends : no
19
20
21
+ # Handy utilities.
22
+ handy_utilities :
23
+ - curl
24
+ - unzip
25
+ - tar
26
+
20
27
pre_tasks :
21
- - name : Make the base image available locally.
28
+ - name : Make the latest version of the base image available locally.
22
29
docker_image :
23
30
name : ' {{ base_image }}'
31
+ force : yes
24
32
25
33
- name : Create the Docker container.
26
34
docker_container :
60
68
delegate_to : ' {{ container_name }}'
61
69
62
70
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
+
63
78
- name : Clean up the container.
64
79
shell : >
65
80
apt-get remove --purge -y python &&
66
81
rm -rf /var/lib/apt/lists/*
67
82
delegate_to : ' {{ container_name }}'
83
+ args :
84
+ warn : no
68
85
69
86
- name : Commit the container.
70
87
command : >
71
88
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 }}
74
91
75
92
- name : Remove the container.
76
93
docker_container :
You can’t perform that action at this time.
0 commit comments