-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add docker and cross compile for arm
- Loading branch information
devseed
committed
Nov 16, 2024
1 parent
a682fc6
commit c4d8657
Showing
6 changed files
with
104 additions
and
24 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
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
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
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
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 @@ | ||
ARG DOCKER_ARCH | ||
FROM --platform=${DOCKER_ARCH} debian:buster | ||
RUN apt-get -y update \ | ||
&& apt-get -y install make cmake tar p7zip git wget curl \ | ||
&& apt-get -y install build-essential \ | ||
&& apt-get -y install libgtk-3-dev libx11-dev |
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,30 @@ | ||
PROJECT_HOME=$(pwd) | ||
if [ -z "${DOCKER_ARCH}" ]; then | ||
DOCKER_ARCH=x86_64 | ||
fi | ||
DOKCER_FILE=script/Dockerfile | ||
DOCKER_IMAGE=tileviewer_${DOCKER_ARCH} | ||
DOCKER_RUN=${DOCKER_IMAGE}_run | ||
DOCKER_HOME=/project | ||
|
||
if [ -z "$USE_BUILDX" ]; then | ||
docker_build="docker build" | ||
else | ||
docker_build="docker buildx build" | ||
fi | ||
echo "## DOCKER_ARCH=${DOCKER_ARCH}" | ||
echo "## docker_build=${docker_build}" | ||
|
||
if [ -z "$(docker images | grep ${DOCKER_IMAGE})" ]; then | ||
$docker_build ./ --platform linux/${DOCKER_ARCH} \ | ||
--build-arg DOCKER_ARCH=${DOCKER_ARCH} \ | ||
-f ${DOKCER_FILE} -t ${DOCKER_IMAGE} | ||
fi | ||
|
||
if [ -z "$(docker ps | grep ${DOCKER_RUN})" ]; then | ||
docker run -d -it --rm -v ${PROJECT_HOME}:${DOCKER_HOME} \ | ||
--name ${DOCKER_RUN} ${DOCKER_IMAGE} | ||
fi | ||
|
||
docker exec -i -e BUILD_TYPE=$BUILD_TYPE -e BUILD_DIR=$BUILD_DIR \ | ||
${DOCKER_RUN} bash -c "cd ${DOCKER_HOME}; bash script/build_linux.sh" |