-
Hi, I am using github actions. !/bin/sh
set -e -u
CONTAINER_HOME_DIR=/home/builder
UNAME=$(uname)
if [ "$UNAME" = Darwin ]; then
# Workaround for mac readlink not supporting -f.
REPOROOT=$PWD
else
REPOROOT="$(dirname $(readlink -f $0))/../"
fi
if [ -n "$(command -v getenforce)" ] && [ "$(getenforce)" = Enforcing ]; then
VOLUME=$REPOROOT:$CONTAINER_HOME_DIR/termux-packages:z
else
VOLUME=$REPOROOT:$CONTAINER_HOME_DIR/termux-packages
fi
: ${TERMUX_BUILDER_IMAGE_NAME:="termux/package-builder:legacy"}
: ${CONTAINER_NAME:=termux-package-builder-legacy}
USER=builder
SUDO="sudo"
echo "Running container '$CONTAINER_NAME' from image '$TERMUX_BUILDER_IMAGE_NAME'..."
$SUDO docker start $CONTAINER_NAME >/dev/null 2>&1 || {
echo "Creating new container..."
$SUDO docker run \
--detach \
--init \
--name $CONTAINER_NAME \
--volume $VOLUME \
--tty \
$TERMUX_BUILDER_IMAGE_NAME
if [ "$UNAME" != Darwin ]; then
if [ $(id -u) -ne 1001 -a $(id -u) -ne 0 ]; then
echo "Changed builder uid/gid... (this may take a while)"
$SUDO docker exec $DOCKER_TTY $CONTAINER_NAME sudo chown -R $(id -u) $CONTAINER_HOME_DIR
$SUDO docker exec $DOCKER_TTY $CONTAINER_NAME sudo chown -R $(id -u) /data
$SUDO docker exec $DOCKER_TTY $CONTAINER_NAME sudo usermod -u $(id -u) builder
$SUDO docker exec $DOCKER_TTY $CONTAINER_NAME sudo groupmod -g $(id -g) builder
fi
fi
}
# Set traps to ensure that the process started with docker exec and all its children are killed.
#. "$TERMUX_SCRIPTDIR/scripts/utils/docker/docker.sh"; docker__setup_docker_exec_traps
if [ "$#" -eq "0" ]; then
set -- bash
fi
export DOCKER_EXEC_PID_FILE_PATH="/usr/sbin/docker-init"
$SUDO docker exec --env "DOCKER_EXEC_PID_FILE_PATH=$DOCKER_EXEC_PID_FILE_PATH" --interactive $CONTAINER_NAME "$@"
Log
Note i just ran curl inside build.sh file of my custom package. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Running and building in the android-5 docker container works fine for me. We don't use Regarding permission denied, to where are you trying to curl the file? Who owns and what are the permissions of that folder? |
Beta Was this translation helpful? Give feedback.
-
I don't know why the file won't download,it is located in public repository and should download fine. The only thing i can think of that could have caused this could be how the environment is setup. Could you provide a link to your run_script.sh file that you've said works. |
Beta Was this translation helpful? Give feedback.
-
Read https://github.com/termux/termux-packages/wiki/Build-environment#multiple-containers |
Beta Was this translation helpful? Give feedback.
-
@Grimler91 and @agnostic-apollo , it has worked all i had to do was to was to prefix |
Beta Was this translation helpful? Give feedback.
@Grimler91 and @agnostic-apollo , it has worked all i had to do was to was to prefix
./build-package -I -a arm <package_name>
withsudo
. @agnostic-apollo thank you for the explanation though changing the container name had no effect and still i needed permission to do everything. My docker knowledge i kinda shallow so maybe i wrongly configured my environment. I have already suceeded with building python 3.11.1 and vim 9.0.