Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions container/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,12 @@ If the project directory is owned by `root` then files will be written out as `r
Credit goes to https://github.com/graze/docker-composer/blob/master/php-7.0/composer-wrapper

* Loop over each argument and append the argument if the command matches one we need to use `--ignore-platform-reqs` with. Found using the following search: https://github.com/composer/composer/search?q=ignore-platform-reqs+path%3Asrc%2FComposer%2FCommand%2F Uses `set` to update the arguments, see https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html.

# `set-ssh-key-perms`

Credit goes to https://nickjanetakis.com/blog/docker-tip-56-volume-mounting-ssh-keys-into-a-docker-container

Initial use case is for users of "Docker for Windows". Due to file permission differences with the Windows OS and Linux, you need to adjust them inside the container before use.

* Copy the ssh keys mounted to `/tmp/` to `/home/dev/` and `/root/`. Ensuring the original are not modified.
* Set permissions on `.ssh/` directories. Ensuring the permissions are correct.
24 changes: 24 additions & 0 deletions container/set-ssh-key-perms
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
# Required for volume mounting ssh keys for "Docker for Windows"
# credit to: https://nickjanetakis.com/blog/docker-tip-56-volume-mounting-ssh-keys-into-a-docker-container
# Usage: volume mount your ssh key directory to /tmp/.ssh

set -e

if [ -d /tmp/.ssh ]; then
cp -R /tmp/.ssh /root/.ssh
cp -R /tmp/.ssh /home/dev/.ssh
chmod 700 /root/.ssh
chmod 700 /home/dev/.ssh

if [ -f /tmp/.ssh/id_rsa.pub ]; then
chmod 644 /root/.ssh/id_rsa.pub
chmod 644 /home/dev/.ssh/id_rsa.pub
fi
if [ -f /tmp/.ssh/id_rsa ]; then
chmod 600 /root/.ssh/id_rsa
chmod 600 /home/dev/.ssh/id_rsa
fi
fi

exec "$@"