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:
Daniel Brahneborg 2025-12-07 10:56:22 +01:00
parent f2405febc9
commit 4805801e65
3 changed files with 13 additions and 11 deletions

View file

@ -27,13 +27,14 @@ ADD \
/root/
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 \
cmake . && \

View file

@ -4,6 +4,8 @@
pf=linux/$arch
img=autofw-$arch
# ssh-keyscan git.braxo.se > git-keys
export DOCKER_BUILDKIT=1
docker build \
@ -12,7 +14,7 @@ docker build \
.
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

11
run.sh
View file

@ -5,16 +5,15 @@
pf=linux/$arch
img=autofw-$arch
srcdir=`pwd`/src-$arch
if [ ! -d $srcdir ]; then
mkdir -p $srcdir
cp -a src/ $srcdir/
repodir=`pwd`/repo-$arch
if [ ! -d $repodir ]; then
mkdir -p $repodir
cp -a `git ls-files . | grep -v /` $repodir/
fi
srcbind="--mount type=bind,source=$srcdir,target=/opt/autofw"
docker run --rm -ti \
--platform=$pf \
`echo $srcbind` \
--mount type=bind,source=$repodir,target=/opt/autofw \
$img \
/bin/zsh