-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathdocker-run.sh
executable file
·33 lines (31 loc) · 1.01 KB
/
docker-run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
#
# This script runs the image generated by the docker build script
# using docker run command, where:
# --rm automatically removes the container and on exit
# -i keeps the standard input open
# -t provides a terminal as a interactive shell within container
# --volumes are file systems mounted on docker container to preserve
# data generated during the yocto build and these are stored on the host.
# Left side being an absolute path on the host machine, right side being
# an absolute path inside the container.
#
# The script can be run with or without parameter:
#
# $ ./docker-run.sh
#
# to go into docker container prompt or:
#
# $ ./docker-run.sh ${IMX_RELEASE}/yocto-build.sh
#
# to run yocto-build script inside container
#
# source the common variables
. ./env.sh
# run the docker image
docker run -it --rm \
--volume ${HOME}:${HOME} \
--volume ${DOCKER_WORKDIR}:${DOCKER_WORKDIR} \
--volume $(pwd)/${IMX_RELEASE}:${DOCKER_WORKDIR}/${IMX_RELEASE} \
"${DOCKER_IMAGE_TAG}" \
$1