diff options
author | Hans Nilsson <hans@erlang.org> | 2021-12-17 13:00:14 +0100 |
---|---|---|
committer | Hans Nilsson <hans@erlang.org> | 2021-12-17 13:00:14 +0100 |
commit | 52000a0e44cbab9914ea55240f64bd7bc93e7480 (patch) | |
tree | 4c5faa8b12e2bf13fc0f0ab916ab7b8bc424fedc | |
parent | fa4f99c5a3cbd33d09537a74ff5a6bc66b2952e1 (diff) | |
parent | fbb4f69861fedbee1e0cf19dab325782820068c2 (diff) | |
download | erlang-52000a0e44cbab9914ea55240f64bd7bc93e7480.tar.gz |
Merge branch 'maint'
* maint:
ssh: Update build scripts for ssh_compat_SUITE docker
5 files changed, 56 insertions, 8 deletions
diff --git a/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/DF b/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/DF new file mode 100644 index 0000000000..f3a8898fa9 --- /dev/null +++ b/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/DF @@ -0,0 +1,5 @@ +FROM ssh_compat:bld + +# Start the daemon, but keep it in foreground to avoid killing the container +CMD /buildroot/ssh/sbin/sshd -D -p 1234 + diff --git a/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/MOVE.howto b/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/MOVE.howto new file mode 100644 index 0000000000..3453e607d5 --- /dev/null +++ b/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/MOVE.howto @@ -0,0 +1,23 @@ +To move an image, do: + +On src machine: + +$ docker run -itd --rm -p 1234 REPOSITORY:TAG +$ docker export XYZ -o FIL +$ scp FIL hans@laura.otp.ericsson.se:/ldisk/hans/docker +$ docker kill THE_DOCKER_REF + +On dst machine: + +hans$ chmod a+r FIL +$ docker import FIL ssh_compat:bld +$ docker build -t REPOSITORY:TAG -f DF . +$ docker rmi ssh_compat:bld + +(DF contains: +FROM ssh_compat:bld + +# Start the daemon, but keep it in foreground to avoid killing the container +CMD /buildroot/ssh/sbin/sshd -D -p 1234 + +) diff --git a/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/create-base-image b/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/create-base-image index 1cb7bf33e1..bb3bee5f11 100755 --- a/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/create-base-image +++ b/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/create-base-image @@ -6,7 +6,7 @@ USER=sshtester PWD=foobar docker build \ - -t ubuntubuildbase \ + -t ssh_compat_suite-ubuntu \ --build-arg https_proxy=$HTTPS_PROXY \ --build-arg http_proxy=$HTTP_PROXY \ - <<EOF diff --git a/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/create-ssh-image b/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/create-ssh-image index 2e08408841..2a0b763058 100755 --- a/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/create-ssh-image +++ b/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/create-ssh-image @@ -1,8 +1,6 @@ #!/bin/sh -# ./create-image openssh 7.3p1 openssl 1.0.2m - -set -x +# ./create-image openssh 7.3p1 openssl 1.0.2m [in-file] case $1 in openssh) @@ -20,6 +18,8 @@ esac FAMssl=$3 VERssl=$4 +INPUT_FILE=$5 + VER=${FAMssh}${VERssh}-${FAMssl}${VERssl} # This way of fetching the tar-file separate from the docker commands makes @@ -62,7 +62,16 @@ EOF # Fetch the tar file. This could be done in an "ADD ..." in the Dockerfile, # but then we hit the proxy problem... -wget -O $TMP $PFX$VERssh$SFX + +if [ "x$INPUT_FILE" = "x" ] +then + wget -O $TMP $PFX$VERssh$SFX + +elif [ "x$INPUT_FILE" != "x$TMP" ] +then + echo "Use $INPUT_FILE for input" + cp $INPUT_FILE $TMP +fi # Build the image: docker build -t ssh_compat_suite-ssh:$VER -f ./TempDockerFile . diff --git a/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/create-ssl-image b/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/create-ssl-image index 4ab2a8bddc..4daf356f10 100755 --- a/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/create-ssl-image +++ b/lib/ssh/test/ssh_compat_SUITE_data/build_scripts/create-ssl-image @@ -1,6 +1,6 @@ #!/bin/sh -# ./create-image openssl 1.0.2m +# ./create-image openssl 1.0.2m [in-file] case "$1" in "openssl") @@ -23,6 +23,8 @@ case "$1" in ;; esac +INPUT_FILE=$3 + case $1$2 in openssl0.9.8[a-l]) CONFIG_FLAGS=no-asm @@ -41,7 +43,7 @@ esac # Make a Dockerfile. This method simplifies env variable handling considerably: cat - > TempDockerFile <<EOF - FROM ubuntubuildbase + FROM ssh_compat_suite-ubuntu:latest LABEL version=$FAM-$VER @@ -62,7 +64,16 @@ EOF # Fetch the tar file. This could be done in an "ADD ..." in the Dockerfile, # but then we hit the proxy problem... -wget -O $TMP $PFX$VER$SFX + +if [ "x$INPUT_FILE" = "x" ] +then + wget -O $TMP $PFX$VER$SFX + +elif [ "x$INPUT_FILE" != "x$TMP" ] +then + echo "Use $INPUT_FILE for input" + cp $INPUT_FILE $TMP +fi # Build the image: docker build -t ssh_compat_suite-$FAM:$VER -f ./TempDockerFile . |