Skip to content

Commit ad92360

Browse files
author
Alan Kent
committed
Made ssh not complain about container changing signature.
Added comment to docker-compose.yml about setting SSH port.
1 parent 55e8e80 commit ad92360

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

docker-compose.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@ services:
6060
# (Use "8080:80" for force external port to be 8080.)
6161
- "80"
6262

63-
# Pick a random SSH port.
64-
- "22"
63+
# Use port 2222 for SSH (make sure unique across projects).
64+
# (If using the PHP Storm IDE, It is strongly recommended to pick a
65+
# dedicated port using the "2222:22" syntax so the port number does
66+
# not change each time the container is restarted, requiring PHP
67+
# Storm reconfiguration.)
68+
- "2222:22"
6569

6670
# Pick a random unused unison port.
6771
# (Only needed if using Unison for file syncing.)

m2ssh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ SSH_HOST=$(docker-compose port web 22 | awk -F: '{
1515

1616
SSH_PORT=$(docker-compose port web 22 | awk -F: '{print $2}')
1717

18-
exec ssh -p ${SSH_PORT} magento2@${SSH_HOST} $*
18+
exec ssh -o LogLevel=error -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p ${SSH_PORT} magento2@${SSH_HOST} $*

m2ssh.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ FOR /f "delims=" %%A IN ('docker-compose port web 22') DO SET "CMD_OUTPUT=%%A"
55
FOR /f "tokens=1,* delims=:" %%A IN ("%CMD_OUTPUT%") DO SET "SSH_PORT=%%B"
66

77
REM Run SSH
8-
ssh -p %SSH_PORT% magento2@localhost %*
8+
ssh -o LogLevel=error -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p %SSH_PORT% magento2@localhost %*

m2unison

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ IGNORE="$IGNORE -ignore 'Path magento2/.git'"
3737
IGNORE="$IGNORE -ignore 'Path magento2/.gitignore'"
3838
IGNORE="$IGNORE -ignore 'Path magento2/.gitattributes'"
3939
IGNORE="$IGNORE -ignore 'Path magento2/.magento'"
40-
IGNORE="$IGNORE -ignore 'Path magento2/.idea'"
40+
IGNORE="$IGNORE -ignore 'Name {.idea}'"
4141
IGNORE="$IGNORE -ignore 'Name {.*.swp}'"
4242
IGNORE="$IGNORE -ignore 'Name {.unison.*}'"
4343

m2unison.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ REM Other files not worth pushing to the container.
4242
@SET IGNORE=%IGNORE% -ignore "Path magento2/.gitignore"
4343
@SET IGNORE=%IGNORE% -ignore "Path magento2/.gitattributes"
4444
@SET IGNORE=%IGNORE% -ignore "Path magento2/.magento"
45-
@SET IGNORE=%IGNORE% -ignore "Path magento2/.idea"
45+
@SET IGNORE=%IGNORE% -ignore "Name {.idea}"
4646
@SET IGNORE=%IGNORE% -ignore "Name {.*.swp}"
4747
@SET IGNORE=%IGNORE% -ignore "Name {.unison.*}"
4848

0 commit comments

Comments
 (0)