-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1e24b3
commit 38110a7
Showing
5 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
USER_ID=1000 | ||
GROUP_ID=1000 | ||
|
||
SSH_KEY=id_rsa | ||
|
||
#COMPOSE_PROJECT_NAME=psh-cli | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM php:7.3-cli | ||
|
||
ARG USER_ID | ||
ARG GROUP_ID | ||
|
||
RUN apt-get update -q -y && apt-get install -y \ | ||
wget \ | ||
openssh-client \ | ||
git \ | ||
unzip \ | ||
&& docker-php-ext-install -j$(nproc) pcntl \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN groupadd --gid ${GROUP_ID:-1000} psh; adduser --uid ${USER_ID:-1000} --gid ${GROUP_ID:-1000} --disabled-password --gecos "" psh | ||
|
||
ADD docker/install_composer.sh /install_composer.sh | ||
RUN /install_composer.sh; rm /install_composer.sh | ||
|
||
USER psh | ||
|
||
RUN mkdir /home/psh/.ssh | ||
|
||
WORKDIR /home/psh/platformsh-cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: '3.3' | ||
# Simple setup for dev | ||
|
||
services: | ||
cli: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
args: | ||
USER_ID: ${USER_ID:-1000} | ||
GROUP_ID: ${GROUP_ID:-1000} | ||
volumes: | ||
- .:/home/psh/platformsh-cli:cached | ||
- $HOME/.ssh/${SSH_KEY}:/home/psh/.ssh/${SSH_KEY} | ||
- $HOME/.platformsh:/home/psh/.platformsh | ||
stdin_open: true | ||
tty: true | ||
network_mode: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
# Based on https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md | ||
|
||
set -e | ||
|
||
EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)" | ||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | ||
ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" | ||
|
||
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] | ||
then | ||
>&2 echo 'ERROR: Invalid installer signature' | ||
rm composer-setup.php | ||
exit 1 | ||
fi | ||
|
||
php composer-setup.php --quiet | ||
rm composer-setup.php | ||
|
||
mv composer.phar /usr/bin/composer |