Skip to content

Commit

Permalink
Bind entire mender-convert directory into container.
Browse files Browse the repository at this point in the history
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.

Changelog: Use local (checked out) version of mender-convert inside container

Signed-off-by: Eystein Måløy Stenberg <eystein.maloy.stenberg@northern.tech>
  • Loading branch information
Eystein Måløy Stenberg committed Nov 28, 2018
1 parent b17b5af commit f570575
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
5 changes: 0 additions & 5 deletions Dockerfile
Expand Up @@ -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"]
9 changes: 3 additions & 6 deletions docker-mender-convert
Expand Up @@ -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 "$@"

0 comments on commit f570575

Please sign in to comment.