mirror of
https://github.com/bensuperpc/dockcross.git
synced 2024-11-13 22:51:31 +01:00
commit
9a8d19a52c
4
Makefile
4
Makefile
@ -10,7 +10,7 @@ DOCKER = docker
|
|||||||
ORG = dockcross
|
ORG = dockcross
|
||||||
|
|
||||||
# Directory where to generate the dockcross script for each images (e.g bin/dockcross-manylinux-x64)
|
# Directory where to generate the dockcross script for each images (e.g bin/dockcross-manylinux-x64)
|
||||||
BIN = bin
|
BIN = ./bin
|
||||||
|
|
||||||
# These images are built using the "build implicit rule"
|
# These images are built using the "build implicit rule"
|
||||||
STANDARD_IMAGES = android-arm linux-x86 linux-x64 linux-arm64 linux-armv5 linux-armv6 linux-armv7 linux-ppc64le windows-x86 windows-x64
|
STANDARD_IMAGES = android-arm linux-x86 linux-x64 linux-arm64 linux-armv5 linux-armv6 linux-armv7 linux-ppc64le windows-x86 windows-x64
|
||||||
@ -95,7 +95,7 @@ manylinux-x86.test: manylinux-x86
|
|||||||
Dockerfile: Dockerfile.in common.docker
|
Dockerfile: Dockerfile.in common.docker
|
||||||
sed '/common.docker/ r common.docker' Dockerfile.in > Dockerfile
|
sed '/common.docker/ r common.docker' Dockerfile.in > Dockerfile
|
||||||
|
|
||||||
base: Dockerfile
|
base: Dockerfile imagefiles/
|
||||||
$(DOCKER) build -t $(ORG)/base \
|
$(DOCKER) build -t $(ORG)/base \
|
||||||
--build-arg IMAGE=$(ORG)/base \
|
--build-arg IMAGE=$(ORG)/base \
|
||||||
--build-arg VCS_REF=`git rev-parse --short HEAD` \
|
--build-arg VCS_REF=`git rev-parse --short HEAD` \
|
||||||
|
@ -17,7 +17,7 @@ Features
|
|||||||
* Recent `CMake <https://cmake.org>`_ and ninja are precompiled.
|
* Recent `CMake <https://cmake.org>`_ and ninja are precompiled.
|
||||||
* Toolchain files configured for CMake.
|
* Toolchain files configured for CMake.
|
||||||
* Current directory is mounted as the container's workdir, ``/work``.
|
* Current directory is mounted as the container's workdir, ``/work``.
|
||||||
* Works with the `Docker Toolbox <https://www.docker.com/products/docker-toolbox>`_ on Mac OSX.
|
* Works with the `Docker for Mac <https://docs.docker.com/docker-for-mac/>`_ and `Docker for Windows <https://docs.docker.com/docker-for-windows/`_.
|
||||||
|
|
||||||
|
|
||||||
Cross compilers
|
Cross compilers
|
||||||
|
@ -171,18 +171,35 @@ fi
|
|||||||
# Set the docker run extra args (if any)
|
# Set the docker run extra args (if any)
|
||||||
FINAL_ARGS=${ARG_ARGS-${DOCKCROSS_ARGS}}
|
FINAL_ARGS=${ARG_ARGS-${DOCKCROSS_ARGS}}
|
||||||
|
|
||||||
# If we are not running via boot2docker
|
# Bash on Ubuntu on Windows
|
||||||
if [ -z $DOCKER_HOST ]; then
|
UBUNTU_ON_WINDOWS=$(grep -l Microsoft /proc/version)
|
||||||
|
# MSYS, Git Bash, etc.
|
||||||
|
MSYS=$(grep -l MINGW /proc/version)
|
||||||
|
|
||||||
|
if [ -z "$UBUNTU_ON_WINDOWS" -a -z "$MSYS" ]; then
|
||||||
USER_IDS="-e BUILDER_UID=$( id -u ) -e BUILDER_GID=$( id -g ) -e BUILDER_USER=$( id -un ) -e BUILDER_GROUP=$( id -gn )"
|
USER_IDS="-e BUILDER_UID=$( id -u ) -e BUILDER_GID=$( id -g ) -e BUILDER_USER=$( id -un ) -e BUILDER_GROUP=$( id -gn )"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Change the PWD when working in Docker on Windows
|
||||||
|
if [ -n "$UBUNTU_ON_WINDOWS" ]; then
|
||||||
|
HOST_PWD=$PWD
|
||||||
|
HOST_PWD=${HOST_PWD/\/mnt\//}
|
||||||
|
HOST_PWD=${HOST_PWD/\//:\/}
|
||||||
|
elif [ -n "$MSYS" ]; then
|
||||||
|
HOST_PWD=$PWD
|
||||||
|
HOST_PWD=${HOST_PWD/\//}
|
||||||
|
HOST_PWD=${HOST_PWD/\//:\/}
|
||||||
|
else
|
||||||
|
HOST_PWD=$PWD
|
||||||
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Now, finally, run the command in a container
|
# Now, finally, run the command in a container
|
||||||
#
|
#
|
||||||
tty -s && TTY_ARGS=-ti || TTY_ARGS=
|
tty -s && TTY_ARGS=-ti || TTY_ARGS=
|
||||||
CONTAINER_NAME=dockcross_$RANDOM
|
CONTAINER_NAME=dockcross_$RANDOM
|
||||||
docker run $TTY_ARGS --name $CONTAINER_NAME \
|
docker run $TTY_ARGS --name $CONTAINER_NAME \
|
||||||
-v $PWD:/work \
|
-v $HOST_PWD:/work \
|
||||||
$USER_IDS \
|
$USER_IDS \
|
||||||
$FINAL_ARGS \
|
$FINAL_ARGS \
|
||||||
$FINAL_IMAGE "$@"
|
$FINAL_IMAGE "$@"
|
||||||
|
@ -19,7 +19,6 @@ fi
|
|||||||
# If we are running docker natively, we want to create a user in the container
|
# If we are running docker natively, we want to create a user in the container
|
||||||
# with the same UID and GID as the user on the host machine, so that any files
|
# with the same UID and GID as the user on the host machine, so that any files
|
||||||
# created are owned by that user. Without this they are all owned by root.
|
# created are owned by that user. Without this they are all owned by root.
|
||||||
# If we are running from boot2docker, this is not necessary.
|
|
||||||
# The dockcross script sets the BUILDER_UID and BUILDER_GID vars.
|
# The dockcross script sets the BUILDER_UID and BUILDER_GID vars.
|
||||||
if [[ -n $BUILDER_UID ]] && [[ -n $BUILDER_GID ]]; then
|
if [[ -n $BUILDER_UID ]] && [[ -n $BUILDER_GID ]]; then
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user