Skip to content

Commit cd57b03

Browse files
committed
Merge pull request #61 from james-nesbitt/fixsomebuilds
fixed a number of command based image builds
2 parents 4ac9a03 + 2c59d55 commit cd57b03

13 files changed

Lines changed: 261 additions & 75 deletions

File tree

drupalconsole/Dockerfile

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,27 @@ MAINTAINER james.nesbitt@wunderkraut.com
33

44
### DRUPALCONSOLE ----------------------------------------------------------
55

6-
# Install MariaDB
7-
ADD etc/yum.repos.d/mariadb.repo etc/yum.repos.d/mariadb.repo
8-
RUN /usr/bin/yum --assumeyes --verbose install MariaDB-client
9-
106
# Prepare to use the remi repo for PHP: our .repo file has certain repos enabled=1
117
ADD root/remi-release-7.rpm /root/remi-release-7.rpm
128
RUN /usr/bin/rpm -Uvh /root/remi-release-7.rpm
139
ADD etc/yum.repos.d/remi.repo /etc/yum.repos.d/remi.repo
1410
ADD etc/yum.repos.d/remi-php70.repo /etc/yum.repos.d/remi-php70.repo
1511

16-
# Install php-fpm
1712
RUN /usr/bin/yum install --assumeyes --verbose \
18-
php-cli php-pdo php-mysql php-pgsql php-ldap php-gd php-mbstring php-mcrypt php-xml \
19-
php-opcache php-pecl-uploadprogress
20-
21-
# Install some tools that are used for composer and user handling
22-
RUN /usr/bin/yum --assumeyes --verbose install openssl tar git
13+
php-cli php-opcache php-pdo php-mysql php-pgsql php-ldap \
14+
php-gd php-mbstring php-mcrypt php-xml php-soap php-json \
15+
php-pecl-uploadprogress php-pecl-apcu php-pecl-geoip
2316

2417
# Add some php extension configuraiton overrides
2518
ADD etc/php.d/01-defaultdatezone.ini /etc/php.d/01-defaultdatezone.ini
2619
ADD etc/php.d/40-apcu.ini /etc/php.d/40-apcu.ini
2720

28-
# Install blackfire
29-
ADD etc/yum.repos.d/blackfire.repo /etc/yum.repos.d/blackfire.repo
30-
RUN /usr/bin/yum install -y install pygpgme blackfire-php
31-
# Add some php extension configuraiton overrides
32-
ADD etc/php.d/zz-blackfire.ini /etc/php.d/zz-blackfire.ini
21+
# Install MariaDB
22+
ADD etc/yum.repos.d/mariadb.repo etc/yum.repos.d/mariadb.repo
23+
RUN /usr/bin/yum --assumeyes --verbose install MariaDB-client
24+
25+
# Install some tools that are used for composer and user handling
26+
RUN /usr/bin/yum --assumeyes --verbose install openssl tar git
3327

3428
# Install composer which will be used to install drush
3529
RUN /usr/bin/curl -sS https://getcomposer.org/installer | php -- --filename=composer --install-dir=/usr/local/bin
@@ -47,30 +41,27 @@ RUN /usr/bin/mkdir /app/.drush && \
4741
/usr/bin/mkdir /app/.ssh && \
4842
/usr/bin/chown -R app:app /app/.ssh
4943

50-
# Everything else is run as the platform user
44+
# Everything else is run as the application user
5145
USER app
5246

53-
# Install nodejs and npm, which gets used for lots of stuff with SASS/SCSS
54-
#RUN /usr/bin/yum install --assumeyes --verbose nodejs npm
55-
#RUN /usr/bin/npm install gulp -g
56-
5747
# Make sure that the composer items are in path
5848
ENV PATH /app/bin:/app/.composer/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
5949

60-
# Install Drupal console
61-
RUN /usr/local/bin/composer global require drupal/console:dev-master
50+
# set up some env variables to make using easier.
51+
ENV TERM="xterm"
6252

63-
# Install DRUSH, which is can be run by drush
64-
RUN /usr/local/bin/composer global require drush/drush:dev-master drush/config-extra
53+
# Install nodejs and npm, which gets used for lots of stuff with SASS/SCSS
54+
#RUN /usr/bin/yum install --assumeyes --verbose nodejs npm
55+
#RUN /usr/bin/npm install gulp -g
6556

66-
# Get some additional suggested packages
67-
RUN /usr/local/bin/composer global require pear/Console_Color2
57+
# Install DRUSH, which is a requiremnt for platform
58+
RUN /usr/local/bin/composer global require drush/drush:dev-master drush/config-extra
6859

69-
# Some usefull env variables
70-
ENV TERM=xterm
60+
# Install Drupal Console
61+
RUN /usr/local/bin/composer global require drupal/console
7162

7263
WORKDIR "/app/www/active"
73-
ENTRYPOINT ["/app/.composer/vendor/bin/console", "--ansi", "--drupal=/app/www/active"]
74-
CMD "--shell"
64+
ENTRYPOINT ["/app/.composer/vendor/bin/console", "--ansi"]
65+
CMD ["--shell"]
7566

7667
### /DRUPALCONSOLE ---------------------------------------------------------------=

drupalconsole/etc/php.d/zz-blackfire.ini

Lines changed: 0 additions & 9 deletions
This file was deleted.

drupalconsole/etc/yum.repos.d/blackfire.repo

Lines changed: 0 additions & 9 deletions
This file was deleted.

drush8/Dockerfile

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,46 @@ RUN /usr/bin/rpm -Uvh /root/remi-release-7.rpm
99
ADD etc/yum.repos.d/remi.repo /etc/yum.repos.d/remi.repo
1010
ADD etc/yum.repos.d/remi-php70.repo /etc/yum.repos.d/remi-php70.repo
1111

12-
# Install php-fpm
1312
RUN /usr/bin/yum install --assumeyes --verbose \
14-
php-cli php-pdo php-mysql php-pgsql php-ldap php-gd php-mbstring php-mcrypt php-xml \
15-
php-opcache php-pecl-uploadprogress
13+
php-cli php-opcache php-pdo php-mysql php-pgsql php-ldap \
14+
php-gd php-mbstring php-mcrypt php-xml php-soap php-json \
15+
php-pecl-uploadprogress php-pecl-apcu php-pecl-geoip
16+
17+
# Add some php extension configuraiton overrides
18+
ADD etc/php.d/01-defaultdatezone.ini /etc/php.d/01-defaultdatezone.ini
19+
ADD etc/php.d/40-apcu.ini /etc/php.d/40-apcu.ini
1620

1721
# Install MariaDB
1822
ADD etc/yum.repos.d/mariadb.repo etc/yum.repos.d/mariadb.repo
1923
RUN /usr/bin/yum --assumeyes --verbose install MariaDB-client
2024

25+
# Install some tools that are used for composer and user handling
26+
RUN /usr/bin/yum --assumeyes --verbose install openssl tar git
27+
2128
# Install composer which will be used to install drush
2229
RUN /usr/bin/curl -sS https://getcomposer.org/installer | php -- --filename=composer --install-dir=/usr/local/bin
2330

24-
# Install Drush
25-
RUN /usr/local/bin/composer global require drush/drush:dev-master
31+
# make sure that the nginx user is created, and has access to app user files
32+
# nginx:x:999:999:Nginx web server:/var/lib/nginx:/sbin/nologin
33+
RUN /usr/sbin/adduser --home-dir /var/lib/nginx --uid 999 --user-group --shell /bin/nologin --password "`openssl rand -base64 32 | openssl passwd -1 -stdin`" --comment "Nginx web server" nginx && \
34+
/usr/bin/gpasswd -a nginx app
2635

27-
# add drush settings & aliases
28-
RUN /usr/bin/mkdir /etc/drush
29-
RUN /usr/bin/mkdir /app/.drush/ && \
30-
/usr/bin/chown -R app:app /app/.drush
36+
# Set up some folders for the tools that we may use
37+
RUN /usr/bin/mkdir /app/.drush && \
38+
/usr/bin/chown -R app:app /app/.drush && \
39+
/usr/bin/mkdir /app/.composer && \
40+
/usr/bin/chown -R app:app /app/.composer && \
41+
/usr/bin/mkdir /app/.ssh && \
42+
/usr/bin/chown -R app:app /app/.ssh
3143

44+
# Everything else is run as the application user
3245
USER app
3346

34-
# set up some env variables to make using easier.
35-
ENV TERM="xterm"
47+
# Make sure that the composer items are in path
48+
ENV PATH /app/bin:/app/.composer/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
49+
50+
# Install DRUSH
51+
RUN /usr/local/bin/composer global require drush/drush:dev-master drush/config-extra
3652

3753
ENTRYPOINT ["/app/.composer/vendor/bin/drush"]
3854
CMD ["status"]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[date]
2+
date.timezone = "UTC"

drush8/etc/php.d/40-apcu.ini

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
; Enable APCu extension module
2+
extension = apcu.so
3+
4+
; This can be set to 0 to disable APCu
5+
apc.enabled=1
6+
7+
; Setting this enables APCu for the CLI version of PHP
8+
; (Mostly for testing and debugging).
9+
;apc.enable_cli=0
10+
apc.enable_cli=1
11+
12+
; Sets the path to text files containing caches to load from disk upon
13+
; initialization of APCu. preload_path should be a directory where each
14+
; file follows $key.data where $key should be used as the entry name
15+
; and the contents of the file contains serialized data to use as the value
16+
; of the entry.
17+
;apc.preload_path=
18+
19+
; The size of each shared memory segment, with M/G suffixe
20+
;apc.shm_size=32M
21+
22+
; The number of seconds a cache entry is allowed to idle in a slot in case
23+
; this cache entry slot is needed by another entry.
24+
;apc.ttl=0
25+
26+
; The number of seconds that a cache entry may remain on the
27+
; garbage-collection list.
28+
;apc.gc_ttl=3600
29+
30+
; If you begin to get low on resources, an expunge of the cache
31+
; is performed if it is less than half full. This is not always
32+
; a suitable way of determining if an expunge of the cache
33+
; should be per apc.smart allows you to set a runtime configuration
34+
; value which is used to determine if an expunge should be run
35+
; if (available_size < apc.smart * requested_size)
36+
;apc.smart=0
37+
38+
; A "hint" about the number variables expected in the cache.
39+
; Set to zero or omit if you are not sure;
40+
;apc.entries_hint=4096
41+
42+
; The mktemp-style file_mask to pass to the mmap module
43+
apc.mmap_file_mask=/tmp/apc.XXXXXX
44+
45+
; On very busy servers whenever you start the server or
46+
; modify files you can create a race of many processes
47+
; all trying to cache the same data at the same time.
48+
; By default, APCu attempts to prevent "slamming" of a key.
49+
; A key is considered "slammed" if it was the last key set,
50+
; and a context other than the current one set it ( ie. it
51+
; was set by another process or thread )
52+
;apc.slam_defense=1
53+
54+
; Defines which serializer should be used
55+
; Default is the standard PHP serializer.
56+
;apc.serializer='default'
57+
58+
; use the SAPI request start time for TTL
59+
;apc.use_request_time=1
60+
61+
; Enables APCu handling of signals, such as SIGSEGV, that write core files
62+
; when signaled. APCu will attempt to unmap the shared memory segment in
63+
; order to exclude it from the core file
64+
;apc.coredump_unmap=0
65+
66+
67+
; RFC1867 File Upload Progress hook handler
68+
;apc.rfc1867=0
69+
;apc.rfc1867_prefix =upload_
70+
;apc.rfc1867_name=APC_UPLOAD_PROGRESS
71+
;apc.rfc1867_freq=0
72+
;apc.rfc1867_ttl=3600
73+

php7fpm/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ADD etc/yum.repos.d/remi-php70.repo /etc/yum.repos.d/remi-php70.repo
1212

1313
# Install php-fpm
1414
RUN /usr/bin/yum install --assumeyes --verbose \
15-
php-fpm php-opcache php-fpm php-pdo php-mysql php-pgsql php-ldap \
15+
php-fpm php-opcache php-pdo php-mysql php-pgsql php-ldap \
1616
php-gd php-mbstring php-mcrypt php-xml php-soap php-json \
1717
php-pecl-uploadprogress php-pecl-apcu php-pecl-geoip
1818

platformsh/Dockerfile

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,53 @@ MAINTAINER james.nesbitt@wunderkraut.com
33

44
### PLATFORMSH ----------------------------------------------------------------
55

6-
# Install some base tools
7-
RUN /usr/bin/yum --assumeyes --verbose install tar gunzip git
6+
# Prepare to use the remi repo for PHP: our .repo file has certain repos enabled=1
7+
ADD root/remi-release-7.rpm /root/remi-release-7.rpm
8+
RUN /usr/bin/rpm -Uvh /root/remi-release-7.rpm
9+
ADD etc/yum.repos.d/remi.repo /etc/yum.repos.d/remi.repo
10+
ADD etc/yum.repos.d/remi-php70.repo /etc/yum.repos.d/remi-php70.repo
811

9-
# Install PHP
1012
RUN /usr/bin/yum install --assumeyes --verbose \
11-
php-cli php-opcache php-pecl-apc php-pdo php-mysql php-pgsql php-pecl-mongo \
12-
php-ldap php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring \
13-
php-mcrypt php-xml php-pecl-yaml php-twig php-twig-ctwig php-pecl-uploadprogress
13+
php-cli php-opcache php-pdo php-mysql php-pgsql php-ldap \
14+
php-gd php-mbstring php-mcrypt php-xml php-soap php-json \
15+
php-pecl-uploadprogress php-pecl-apcu php-pecl-geoip
1416

15-
# Install Composer
17+
# Add some php extension configuraiton overrides
18+
ADD etc/php.d/01-defaultdatezone.ini /etc/php.d/01-defaultdatezone.ini
19+
ADD etc/php.d/40-apcu.ini /etc/php.d/40-apcu.ini
20+
21+
# Install MariaDB
22+
ADD etc/yum.repos.d/mariadb.repo etc/yum.repos.d/mariadb.repo
23+
RUN /usr/bin/yum --assumeyes --verbose install MariaDB-client
24+
25+
# Install some tools that are used for composer and user handling
26+
RUN /usr/bin/yum --assumeyes --verbose install openssl tar git
27+
28+
# Install composer which will be used to install drush
1629
RUN /usr/bin/curl -sS https://getcomposer.org/installer | php -- --filename=composer --install-dir=/usr/local/bin
1730

18-
# Create the composer build path
19-
RUN /usr/bin/mkdir /composer && \
20-
/usr/bin/chown app:app /composer
31+
# make sure that the nginx user is created, and has access to app user files
32+
# nginx:x:999:999:Nginx web server:/var/lib/nginx:/sbin/nologin
33+
RUN /usr/sbin/adduser --home-dir /var/lib/nginx --uid 999 --user-group --shell /bin/nologin --password "`openssl rand -base64 32 | openssl passwd -1 -stdin`" --comment "Nginx web server" nginx && \
34+
/usr/bin/gpasswd -a nginx app
2135

22-
# Everything else is run as the platform user
36+
# Set up some folders for the tools that we may use
37+
RUN /usr/bin/mkdir /app/.drush && \
38+
/usr/bin/chown -R app:app /app/.drush && \
39+
/usr/bin/mkdir /app/.composer && \
40+
/usr/bin/chown -R app:app /app/.composer && \
41+
/usr/bin/mkdir /app/.ssh && \
42+
/usr/bin/chown -R app:app /app/.ssh
43+
44+
# Everything else is run as the application user
2345
USER app
2446

25-
# Add composer paths and app/bin to path
47+
# Make sure that the composer items are in path
2648
ENV PATH /app/bin:/app/.composer/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
2749

50+
# set up some env variables to make using easier.
51+
ENV TERM="xterm"
52+
2853
# Install DRUSH, which is a requiremnt for platform
2954
RUN /usr/local/bin/composer global require drush/drush:dev-master drush/config-extra
3055
ENV PLATFORMSH_CLI_DRUSH=/app/.composer/vendor/bin/drush
@@ -39,4 +64,4 @@ ENV PLATFORMSH_CLI_DISABLE_CACHE=0
3964
ENTRYPOINT ["/app/.composer/vendor/bin/platform"]
4065
CMD ["--shell"]
4166

42-
### /PLATFORMSH ---------------------------------------------------------------
67+
### /PLATFORMSH ---------------------------------------------------------------
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[date]
2+
date.timezone = "UTC"

0 commit comments

Comments
 (0)