From 18c5d9845c7676c95378ea81fafd322f9fe7209e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eystein=20M=C3=A5l=C3=B8y=20Stenberg?= Date: Wed, 28 Nov 2018 13:57:20 -0800 Subject: [PATCH] Bind entire mender-convert directory into container. This ensures we use same version of mender-convert inside the container as the one used to launch the container. It makes versioning and local development easier. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changelog: Use local (checked out) version of mender-convert inside container Signed-off-by: Eystein Måløy Stenberg (cherry picked from commit f570575f41b80738ab24d792bf8eb9b77e202fe6) --- Dockerfile | 5 ----- docker-mender-convert | 9 +++------ 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index b1dcc5f..7e68bfe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,10 +52,5 @@ RUN wget https://dl.google.com/go/go$GOLANG_VERSION.linux-amd64.tar.gz \ && tar -C /usr/local -xzf go$GOLANG_VERSION.linux-amd64.tar.gz \ && echo export PATH=$PATH:/usr/local/go/bin >> /root/.bashrc -# TODO: support selecting tag of mender-convert with MENDER_CONVERT_VERSION -# TODO: consider lighter way to download to avoid git dependency -RUN git clone https://github.com/mendersoftware/mender-convert.git - - COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] diff --git a/docker-mender-convert b/docker-mender-convert index 5691b28..24e3ccb 100755 --- a/docker-mender-convert +++ b/docker-mender-convert @@ -4,13 +4,10 @@ set -e IMAGE_NAME=mender-convert -INPUT_DIR="$(pwd)/input" -OUTPUT_DIR="$(pwd)/output" - -mkdir -p $OUTPUT_DIR +MENDER_CONVERT_DIR="$(pwd)" +mkdir -p output docker run \ - --mount type=bind,source=$INPUT_DIR,target=/mender-convert/input,readonly \ - --mount type=bind,source=$OUTPUT_DIR,target=/mender-convert/output \ + --mount type=bind,source=$MENDER_CONVERT_DIR,target=/mender-convert \ --privileged=true \ $IMAGE_NAME "$@"