let the Dockerfile pull its own copy of the repo, so we get a proper git env with ./run.sh
This commit is contained in:
parent
f2405febc9
commit
4805801e65
3 changed files with 13 additions and 11 deletions
|
|
@ -27,13 +27,14 @@ ADD \
|
||||||
/root/
|
/root/
|
||||||
|
|
||||||
WORKDIR /opt
|
WORKDIR /opt
|
||||||
# git clone shared@git.braxo.se:daniel/autofw.git
|
|
||||||
|
|
||||||
RUN mkdir /opt/autofw
|
# RUN mkdir /root/.ssh
|
||||||
|
|
||||||
WORKDIR /opt/autofw
|
# COPY git-keys /root/.ssh/known_hosts
|
||||||
|
|
||||||
ADD src .
|
RUN git clone https://git.braxo.se/daniel/autofw.git
|
||||||
|
|
||||||
|
WORKDIR /opt/autofw/src
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
cmake . && \
|
cmake . && \
|
||||||
|
|
|
||||||
4
build.sh
4
build.sh
|
|
@ -4,6 +4,8 @@
|
||||||
pf=linux/$arch
|
pf=linux/$arch
|
||||||
img=autofw-$arch
|
img=autofw-$arch
|
||||||
|
|
||||||
|
# ssh-keyscan git.braxo.se > git-keys
|
||||||
|
|
||||||
export DOCKER_BUILDKIT=1
|
export DOCKER_BUILDKIT=1
|
||||||
|
|
||||||
docker build \
|
docker build \
|
||||||
|
|
@ -12,7 +14,7 @@ docker build \
|
||||||
.
|
.
|
||||||
|
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
docker run --platform $pf -v $PWD/bin:/opt/mount --rm $img cp bin/autofw /opt/mount/autofw-$arch
|
docker run --platform $pf -v $PWD/bin:/opt/mount --rm $img cp /opt/autofw/src/bin/autofw /opt/mount/autofw-$arch
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
|
|
||||||
11
run.sh
11
run.sh
|
|
@ -5,16 +5,15 @@
|
||||||
pf=linux/$arch
|
pf=linux/$arch
|
||||||
img=autofw-$arch
|
img=autofw-$arch
|
||||||
|
|
||||||
srcdir=`pwd`/src-$arch
|
repodir=`pwd`/repo-$arch
|
||||||
if [ ! -d $srcdir ]; then
|
if [ ! -d $repodir ]; then
|
||||||
mkdir -p $srcdir
|
mkdir -p $repodir
|
||||||
cp -a src/ $srcdir/
|
cp -a `git ls-files . | grep -v /` $repodir/
|
||||||
fi
|
fi
|
||||||
srcbind="--mount type=bind,source=$srcdir,target=/opt/autofw"
|
|
||||||
|
|
||||||
docker run --rm -ti \
|
docker run --rm -ti \
|
||||||
--platform=$pf \
|
--platform=$pf \
|
||||||
`echo $srcbind` \
|
--mount type=bind,source=$repodir,target=/opt/autofw \
|
||||||
$img \
|
$img \
|
||||||
/bin/zsh
|
/bin/zsh
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue