diff --git a/php-7.0/Dockerfile b/php-7.0/Dockerfile index 8b631ce691767be66cc9b1460aec1ed98b66423d..9e5e6248473d1e3ad6e8020b667832efdcdb2f28 100644 --- a/php-7.0/Dockerfile +++ b/php-7.0/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.5 LABEL com.example.vendor="LakeDrops" \ maintainer="juergen.haas@lakedrops.com" \ - version="1.3.0" \ + version="1.4.0" \ description="An image for GitLab runner to build and test Drupal projects." ARG compose_version=1.21.2 @@ -59,6 +59,9 @@ RUN set -eux; \ COPY modprobe.sh /usr/local/bin/modprobe COPY docker-entrypoint.sh /usr/local/bin/ COPY drush.sh /usr/local/bin/drush +COPY node /usr/local/bin/node +COPY npm /usr/local/bin/npm +COPY volume.php /usr/local/bin/volume.php ENTRYPOINT ["docker-entrypoint.sh"] CMD ["sh"] @@ -67,8 +70,8 @@ RUN mkdir -p /root/.ssh && \ echo "StrictHostKeyChecking no" >> /root/.ssh/config && \ \ apk update && \ - apk add --no-cache curl openssl openssh ca-certificates wget make patch g++ \ - bash fish python nodejs git unzip \ + apk add --no-cache curl openssl openssh ca-certificates wget make patch \ + bash fish python git unzip \ php7 php7-phar php7-json php7-dom php7-gd php7-mbstring php7-openssl \ php7-pdo php7-curl php7-xml php7-zip php7-session php7-ctype php7-iconv php7-bcmath && \ \ diff --git a/php-7.0/node b/php-7.0/node new file mode 100755 index 0000000000000000000000000000000000000000..4f9fbb5a393684f3e6cb5e438db41def78a6150e --- /dev/null +++ b/php-7.0/node @@ -0,0 +1,3 @@ +#!/bin/bash + +docker run -it -v $(php /usr/local/bin/volume.php) -w $PWD node:8-jessie-slim node $@ diff --git a/php-7.0/npm b/php-7.0/npm new file mode 100755 index 0000000000000000000000000000000000000000..0db3164af8b2be74ad90201333f54dba753309cb --- /dev/null +++ b/php-7.0/npm @@ -0,0 +1,3 @@ +#!/bin/bash + +docker run -it -v $(php /usr/local/bin/volume.php) -w $PWD node:8-jessie-slim npm $@ diff --git a/php-7.0/volume.php b/php-7.0/volume.php new file mode 100644 index 0000000000000000000000000000000000000000..e2db5ee329d0a69490d21147b6196f483dbaed93 --- /dev/null +++ b/php-7.0/volume.php @@ -0,0 +1,30 @@ +<?php + + +function readContainerConfig() { + try { + $output = []; + exec('basename "$(cat /proc/1/cpuset)"', $output); + $id = reset($output); + $output = []; + exec('docker container inspect ' . $id, $output); + return json_decode(implode('', $output), TRUE)[0]; + } + catch (\Exception $ex) { + // Ignore. + } + return []; +} + +function getDockerMountSource() { + $currentDir = getcwd(); + $container = readContainerConfig(); + foreach ($container['Mounts'] as $mount) { + if (strpos($currentDir, $mount['Destination']) === 0) { + return $mount['Source'] . ':' . $mount['Destination']; + } + } + return $currentDir . ':' . $currentDir; +} + +print(getDockerMountSource()); diff --git a/php-7.1/Dockerfile b/php-7.1/Dockerfile index 8a32698bfb993cc7bc2b9d5c73fc42882c3c7a53..478caf06986a83a896e81ad8de6f1f0f36cca88c 100644 --- a/php-7.1/Dockerfile +++ b/php-7.1/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.7 LABEL com.example.vendor="LakeDrops" \ maintainer="juergen.haas@lakedrops.com" \ - version="1.3.0" \ + version="1.4.0" \ description="An image for GitLab runner to build and test Drupal projects." ARG compose_version=1.21.2 @@ -54,6 +54,9 @@ RUN set -eux; \ COPY modprobe.sh /usr/local/bin/modprobe COPY docker-entrypoint.sh /usr/local/bin/ COPY drush.sh /usr/local/bin/drush +COPY node /usr/local/bin/node +COPY npm /usr/local/bin/npm +COPY volume.php /usr/local/bin/volume.php ENTRYPOINT ["docker-entrypoint.sh"] CMD ["sh"] @@ -62,8 +65,8 @@ RUN mkdir -p /root/.ssh && \ echo "StrictHostKeyChecking no" >> /root/.ssh/config && \ \ apk update && \ - apk add --no-cache curl openssl openssh ca-certificates wget make patch g++ \ - bash fish python nodejs git unzip \ + apk add --no-cache curl openssl openssh ca-certificates wget make patch \ + bash fish python git unzip \ php7 php7-phar php7-json php7-dom php7-gd php7-mbstring php7-openssl \ php7-pdo php7-curl php7-xml php7-zip php7-session php7-ctype php7-iconv php7-bcmath \ php7-tokenizer php7-simplexml php7-xmlwriter && \ diff --git a/php-7.1/node b/php-7.1/node new file mode 100755 index 0000000000000000000000000000000000000000..4f9fbb5a393684f3e6cb5e438db41def78a6150e --- /dev/null +++ b/php-7.1/node @@ -0,0 +1,3 @@ +#!/bin/bash + +docker run -it -v $(php /usr/local/bin/volume.php) -w $PWD node:8-jessie-slim node $@ diff --git a/php-7.1/npm b/php-7.1/npm new file mode 100755 index 0000000000000000000000000000000000000000..0db3164af8b2be74ad90201333f54dba753309cb --- /dev/null +++ b/php-7.1/npm @@ -0,0 +1,3 @@ +#!/bin/bash + +docker run -it -v $(php /usr/local/bin/volume.php) -w $PWD node:8-jessie-slim npm $@ diff --git a/php-7.1/volume.php b/php-7.1/volume.php new file mode 100644 index 0000000000000000000000000000000000000000..e2db5ee329d0a69490d21147b6196f483dbaed93 --- /dev/null +++ b/php-7.1/volume.php @@ -0,0 +1,30 @@ +<?php + + +function readContainerConfig() { + try { + $output = []; + exec('basename "$(cat /proc/1/cpuset)"', $output); + $id = reset($output); + $output = []; + exec('docker container inspect ' . $id, $output); + return json_decode(implode('', $output), TRUE)[0]; + } + catch (\Exception $ex) { + // Ignore. + } + return []; +} + +function getDockerMountSource() { + $currentDir = getcwd(); + $container = readContainerConfig(); + foreach ($container['Mounts'] as $mount) { + if (strpos($currentDir, $mount['Destination']) === 0) { + return $mount['Source'] . ':' . $mount['Destination']; + } + } + return $currentDir . ':' . $currentDir; +} + +print(getDockerMountSource()); diff --git a/php-7.2/Dockerfile b/php-7.2/Dockerfile index c46e65247e1ad40c15bfe43bf6727753022b5966..92c8ea87ea2bc0d09f597209b5463a4ed6751394 100644 --- a/php-7.2/Dockerfile +++ b/php-7.2/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.8 LABEL com.example.vendor="LakeDrops" \ maintainer="juergen.haas@lakedrops.com" \ - version="1.3.0" \ + version="1.4.0" \ description="An image for GitLab runner to build and test Drupal projects." ARG compose_version=1.21.2 @@ -54,6 +54,9 @@ RUN set -eux; \ COPY modprobe.sh /usr/local/bin/modprobe COPY docker-entrypoint.sh /usr/local/bin/ COPY drush.sh /usr/local/bin/drush +COPY node /usr/local/bin/node +COPY npm /usr/local/bin/npm +COPY volume.php /usr/local/bin/volume.php ENTRYPOINT ["docker-entrypoint.sh"] CMD ["sh"] @@ -62,8 +65,8 @@ RUN mkdir -p /root/.ssh && \ echo "StrictHostKeyChecking no" >> /root/.ssh/config && \ \ apk update && \ - apk add --no-cache curl openssl openssh ca-certificates wget make patch g++ \ - bash fish python nodejs npm git unzip \ + apk add --no-cache curl openssl openssh ca-certificates wget make patch \ + bash fish python git unzip \ php7 php7-phar php7-json php7-dom php7-gd php7-mbstring php7-openssl \ php7-pdo php7-curl php7-xml php7-zip php7-session php7-ctype php7-iconv php7-bcmath \ php7-tokenizer php7-simplexml php7-xmlwriter && \ diff --git a/php-7.2/node b/php-7.2/node new file mode 100755 index 0000000000000000000000000000000000000000..4f9fbb5a393684f3e6cb5e438db41def78a6150e --- /dev/null +++ b/php-7.2/node @@ -0,0 +1,3 @@ +#!/bin/bash + +docker run -it -v $(php /usr/local/bin/volume.php) -w $PWD node:8-jessie-slim node $@ diff --git a/php-7.2/npm b/php-7.2/npm new file mode 100755 index 0000000000000000000000000000000000000000..0db3164af8b2be74ad90201333f54dba753309cb --- /dev/null +++ b/php-7.2/npm @@ -0,0 +1,3 @@ +#!/bin/bash + +docker run -it -v $(php /usr/local/bin/volume.php) -w $PWD node:8-jessie-slim npm $@ diff --git a/php-7.2/volume.php b/php-7.2/volume.php new file mode 100644 index 0000000000000000000000000000000000000000..e2db5ee329d0a69490d21147b6196f483dbaed93 --- /dev/null +++ b/php-7.2/volume.php @@ -0,0 +1,30 @@ +<?php + + +function readContainerConfig() { + try { + $output = []; + exec('basename "$(cat /proc/1/cpuset)"', $output); + $id = reset($output); + $output = []; + exec('docker container inspect ' . $id, $output); + return json_decode(implode('', $output), TRUE)[0]; + } + catch (\Exception $ex) { + // Ignore. + } + return []; +} + +function getDockerMountSource() { + $currentDir = getcwd(); + $container = readContainerConfig(); + foreach ($container['Mounts'] as $mount) { + if (strpos($currentDir, $mount['Destination']) === 0) { + return $mount['Source'] . ':' . $mount['Destination']; + } + } + return $currentDir . ':' . $currentDir; +} + +print(getDockerMountSource());