From 14c590ae7e8b78b42f0a4689c55f03bf26fa1eb8 Mon Sep 17 00:00:00 2001 From: Luis Armando Bianchin Date: Wed, 5 Aug 2015 09:49:10 -0300 Subject: [PATCH] Remove port configuration on rsync, try to mimic docker-machine scp arguments --- src/docker-osx-dev | 9 ++++----- test/docker-osx-dev.bats | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/docker-osx-dev b/src/docker-osx-dev index 31a3a1e..e000b2e 100755 --- a/src/docker-osx-dev +++ b/src/docker-osx-dev @@ -59,7 +59,6 @@ EXCLUDES="" INCLUDES="" CURRENT_LOG_LEVEL="$DEFAULT_LOG_LEVEL" DOCKER_HOST_USER="" -DOCKER_HOST_SSHPORT="22" DOCKER_HOST_SSH_URL="" DOCKER_HOST_SSH_KEY="" DOCKER_HOST_SSH_COMMAND="" @@ -286,7 +285,7 @@ function configure_log_level { # # Configures the Boot2Docker SSH key by looking into the Boot2Docker config # -function configure_boot2docker_vars { +function configure_boot2docker { test -n "$DOCKER_HOST_NAME" || DOCKER_HOST_NAME="dockerhost" DOCKER_HOST_SSH_KEY=$(boot2docker cfg | grep "^SSHKey = " | sed -e 's/^SSHKey = "\(.*\)"/\1/') DOCKER_HOST_USER="$BOOT2DOCKER_USER" @@ -387,7 +386,7 @@ function init_boot2docker { boot2docker start --vbox-share=disable fi - configure_boot2docker_vars + configure_boot2docker } ################################################################################ @@ -408,13 +407,13 @@ function configure_docker_machine { DOCKER_HOST_NAME=$DOCKER_MACHINE_NAME DOCKER_MACHINE_INSPECT=$(docker-machine inspect $DOCKER_MACHINE_NAME) DOCKER_HOST_USER=$(echo -e "$DOCKER_MACHINE_INSPECT" | get_json_value "['Driver']['SSHUser']") - DOCKER_HOST_SSHPORT=$(echo -e "$DOCKER_MACHINE_INSPECT" | get_json_value "['Driver']['SSHPort']") DOCKER_HOST_IP=$(echo -e "$DOCKER_MACHINE_INSPECT" | get_json_value "['Driver']['IPAddress']") DOCKER_MACHINE_STORE_PATH=$(echo -e "$DOCKER_MACHINE_INSPECT" | get_json_value "['StorePath']") DOCKER_HOST_SSH_URL="$DOCKER_HOST_USER@$DOCKER_HOST_IP" DOCKER_HOST_SSH_KEY="$DOCKER_MACHINE_STORE_PATH/id_rsa" DOCKER_HOST_SSH_COMMAND="docker-machine ssh $DOCKER_MACHINE_NAME" + log_debug "Running for the docker-machine name: $DOCKER_MACHINE_NAME" } # @@ -709,7 +708,7 @@ function do_rsync { read -a includes <<< "$INCLUDES" local readonly include_flags="${includes[@]/#/--include }" - local readonly rsh_flag="--rsh=\"ssh -i $DOCKER_HOST_SSH_KEY -o StrictHostKeyChecking=no -p $DOCKER_HOST_SSHPORT\"" + local readonly rsh_flag="--rsh=\"ssh -i $DOCKER_HOST_SSH_KEY -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null\"" local readonly rsync_cmd="rsync $RSYNC_FLAGS $include_flags $exclude_flags $rsh_flag $path_to_sync $DOCKER_HOST_SSH_URL:$parent_folder" log_debug "$rsync_cmd" diff --git a/test/docker-osx-dev.bats b/test/docker-osx-dev.bats index 2441ca5..418db73 100755 --- a/test/docker-osx-dev.bats +++ b/test/docker-osx-dev.bats @@ -450,7 +450,6 @@ EOF assert_equal "some-machine" "$DOCKER_HOST_NAME" assert_equal "user" "$DOCKER_HOST_USER" - assert_equal "22" "$DOCKER_HOST_SSHPORT" assert_equal "10.254.1.14" "$DOCKER_HOST_IP" assert_equal "/Users/someone/.docker/machine/machines/some-machine/id_rsa" "$DOCKER_HOST_SSH_KEY"