Skip to content
Snippets Groups Projects
Commit 3d3fea3c authored by jurgenhaas's avatar jurgenhaas
Browse files

#1 Remove node stuff and make use of a separate container instead

parent 1f509c5f
No related branches found
No related tags found
No related merge requests found
Pipeline #5985 passed
......@@ -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 && \
\
......
#!/bin/bash
docker run -it -v $(php /usr/local/bin/volume.php) -w $PWD node:8-jessie-slim node $@
#!/bin/bash
docker run -it -v $(php /usr/local/bin/volume.php) -w $PWD node:8-jessie-slim npm $@
<?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());
......@@ -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 && \
......
#!/bin/bash
docker run -it -v $(php /usr/local/bin/volume.php) -w $PWD node:8-jessie-slim node $@
#!/bin/bash
docker run -it -v $(php /usr/local/bin/volume.php) -w $PWD node:8-jessie-slim npm $@
<?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());
......@@ -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 && \
......
#!/bin/bash
docker run -it -v $(php /usr/local/bin/volume.php) -w $PWD node:8-jessie-slim node $@
#!/bin/bash
docker run -it -v $(php /usr/local/bin/volume.php) -w $PWD node:8-jessie-slim npm $@
<?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());
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment