-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from fdupoux/dockerfile
Added dockerfile to build fsarchiver
- Loading branch information
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM archlinux:latest | ||
RUN mkdir -p /workspace | ||
RUN pacman -Syyu --noconfirm autoconf automake gcc git make patch pkgconf && rm -rf /var/cache/pacman/pkg/* | ||
RUN pacman -Syyu --noconfirm bzip2 e2fsprogs lzo xz libgcrypt zlib lz4 zstd && rm -rf /var/cache/pacman/pkg/* | ||
CMD ["/usr/bin/bash"] | ||
WORKDIR /workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ -z ${DOCKER_CMD+x} ]; then | ||
# $DOCKER_CMD is not set -> use the default | ||
DOCKER_CMD=docker | ||
fi | ||
|
||
# Determine the path to the git repository | ||
fullpath="$(realpath $0)" | ||
curdir="$(dirname ${fullpath})" | ||
repodir="$(realpath ${curdir}/..)" | ||
echo "fullpath=${fullpath}" | ||
echo "repodir=${repodir}" | ||
|
||
# Build the docker image | ||
dockerimg="fsarchiver-builder:latest" | ||
"$DOCKER_CMD" build -t ${dockerimg} -f ${repodir}/docker/Dockerfile-archlinux ${repodir}/docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ -z ${DOCKER_CMD+x} ]; then | ||
# $DOCKER_CMD is not set -> use the default | ||
DOCKER_CMD=docker | ||
fi | ||
|
||
# Make sure the docker image exists | ||
dockerimg="fsarchiver-builder:latest" | ||
if ! "$DOCKER_CMD" inspect ${dockerimg} >/dev/null 2>/dev/null ; then | ||
echo "ERROR: You must build the following docker image before you run this script: ${dockerimg}" | ||
exit 1 | ||
fi | ||
|
||
# Determine the path to the git repository | ||
fullpath="$(realpath $0)" | ||
curdir="$(dirname ${fullpath})" | ||
repodir="$(realpath ${curdir}/..)" | ||
echo "curdir=${curdir}" | ||
echo "repodir=${repodir}" | ||
|
||
# Build fsarchiver in docker | ||
docker run --rm --user 1000:1000 -it \ | ||
--volume=${repodir}:/workspace \ | ||
${dockerimg} setarch x86_64 -- bash -c "make distclean ; ./autogen.sh && ./configure && make && make dist" | ||
res=$? | ||
if [ ${res} -ne 0 ] | ||
then | ||
echo "ERROR: Failed to build fsarchiver" | ||
exit 1 | ||
fi |