update docker

This commit is contained in:
NADAL Jean-Baptiste
2019-04-10 18:58:11 +02:00
parent 614739eb2b
commit a1e68d882f
6 changed files with 42 additions and 23 deletions

View File

@@ -1,5 +1,15 @@
#!/bin/bash
# Catch build Error
function error {
echo "Docker build Failed."
exit 1;
}
set -e
trap error ERR
echo "Build Docker Image."
stagingPath=$1
@@ -37,9 +47,12 @@ cp -a $stagingPath/buildroot/target/bin $stagingPath/docker-build/rootfs/
cp -a $stagingPath/buildroot/target/etc $stagingPath/docker-build/rootfs/
cp -a $stagingPath/buildroot/target/lib $stagingPath/docker-build/rootfs/
cp -a $stagingPath/buildroot/target/sbin $stagingPath/docker-build/rootfs/
cp -a $stagingPath/buildroot/target/var $stagingPath/docker-build/rootfs/
touch $stagingPath/docker-build/rootfs/etc/resolv.conf
touch $stagingPath/docker-build/rootfs/sbin/init
cp /lib/x86_64-linux-gnu/libpthread.so.0 $stagingPath/docker-build/rootfs/lib
cp /usr/lib/x86_64-linux-gnu/libltdl.so.7 $stagingPath/docker-build/rootfs/lib
cp /lib/x86_64-linux-gnu/libc.so.6 $stagingPath/docker-build/rootfs/lib
cp /lib64/ld-linux-x86-64.so.2 $stagingPath/docker-build/rootfs/lib64
docker build -t ${projectName}:v${version} $stagingPath/docker-build