Commit Graph

167 Commits

Author SHA1 Message Date
Jean-Christophe Fillion-Robin
1f2e82f089
install-gosu-binary: Improve gpg key download listing additonal servers 2018-06-06 14:34:04 -04:00
Jean-Christophe Fillion-Robin
cb157b7457
common.docker: Optimize image size installing "liquidprompt" in existing RUN command 2018-06-06 13:46:00 -04:00
Jean-Christophe Fillion-Robin
4dce58cfec
common.*: Optimize image size introducing "install-gosu-binary.sh" script
Script was copied from https://github.com/dockbuild/dockbuild
2018-06-06 13:45:59 -04:00
Jean-Christophe Fillion-Robin
007899c2a5
STYLE: For consistency, rename install-ninja.sh to build-and-install-ninja.sh 2018-06-06 13:45:59 -04:00
Jean-Christophe Fillion-Robin
71759485f9
build-and-install-cmake.sh: Improve script to speedup build time
* faster source checkout specifying tag and depth
* remove obsolete comments
* disable testing
2018-06-06 13:45:59 -04:00
Jean-Christophe Fillion-Robin
f1a8f69f4d
build-and-install-openssl.sh, install-cmake-binary.sh: Tweak install scripts
* Consistently use "/usr/src" as download and staging area

* install-cmake-binary: Introduce CMAKE_ROOT var

* build-and-install-openssl: Remove redundant -fPIC flag, download openssl sources using "wget"
2018-06-06 13:45:52 -04:00
Nadav Ruskin
406a1b60f9 Helper script now works on wsl with modified roots 2018-05-27 11:44:06 +03:00
Nadav Ruskin
187afc10d7 Started work on wsl support for every mount point 2018-05-23 17:59:03 +03:00
Francois Budin
602fb22cce ENH: Compile git with SSL support
Older versions of git included in older linux distributions are not able
to download source from Github. A newer version is required with a newer
OpenSSL. This requires to also build curl with the same OpenSSL.

CMake is downloaded precompiled if available (64bits system) or compiled
from source otherwise.
2018-04-14 19:12:07 -04:00
Jean-Christophe Fillion-Robin
53d98cf4ff Fix download of files using up-to-date "curl" instead of "wget"
In few images, curl is only tool that able to download from https
source requiring TLS 1.2
2018-04-13 15:01:54 -04:00
Jean-Christophe Fillion-Robin
7b76882b56
entrypoint.sh: Account for image tag when updating help text
This commit is a follow up of b7028af (entrypoint.sh: Update help
text so that current image name is used)

It ensures that the suggested script in the help text doesn't include ":"
in its name.

Assuming DEFAULT_DOCKCROSS_IMAGE is set to "dockcross/imagename:latest"

Instead of suggesting:

  [...]
  # docker run --rm dockcross/imagename:latest > dockcross-imagename:latest
  # chmod +x dockcross-imagename:latest
  [...]

it will now suggest

  [...]
  # docker run --rm dockcross/imagename:latest > dockcross-imagename-latest
  # chmod +x dockcross-imagename-latest
  [...]

xref https://github.com/dockbuild/dockbuild/issues/30

[ci skip]
2018-03-29 21:04:52 -04:00
Jean-Christophe Fillion-Robin
b7028af76e
entrypoint.sh: Update help text so that current image name is used
xref https://github.com/dockbuild/dockbuild/issues/30
2018-03-29 04:43:26 -04:00
Emmerich
396d5fe4f8 Changed Windows Subsystem for Linux's PWD to be the physical path rather than relative since windows cannot traverse a relative path inside the Linux subsystem. 2018-01-29 18:20:10 +02:00
Korijn van Golen
6f299349dd
bump cmake to v3.10.1 2017-12-21 08:52:51 +01:00
Guy Margalit
4606b71e68 Missing shift in dockcross -- command [args]
Otherwise `--` is sent as the command...
2017-10-26 15:26:04 +03:00
Dan Jacques
7dd46fa045 Implement "ct-ng" building, add "linux-mips".
Add a mechanism to construct a full cross-compiler environment using the
"crosstool-ng" cross-compiler building utility. This is implemented in
the new "common.crosstool" include, and augments the "dockcross/base"
base image.

Update Makefile to consolidate Dockerfile generation, notably the
"sed"-based inclusion directives.

Finally, employ all of this to generate a "linux-mips" 32-bit hard-float
MIPS cross-compiler Dockcross image.
2017-09-01 10:09:31 -04:00
Constantine Grantcharov
b1cef063a1 Fix $HOME directory ownership permissions
BUG:

Creating a new directory under /home/<user>/ from the /work folder does
not work. In fact, going into the home directory and trying to run mkdir
fails as well.

SOLUTION:

Turns out chown -R <user>:<user> was run on $HOME/* instead of on $HOME.
This means that /home/<user> was still under the ownership of root:root,
hence preventing any writes to non-root users.
2017-06-29 08:31:33 -04:00
Matt McCormick
68962e0e84 Merge pull request #138 from conz27/ssh_support
SSH Support for Git Clone / Checkout
2017-05-13 11:04:25 -04:00
Constantine Grantcharov
bf0f74cfd3 SSH Support for Git Clone / Checkout
Added SSH support to enable Git checkouts that use SSH instead of
HTTP(S).

The SSH directory is assumed to be in $HOME/.ssh; however:

export SSH_DIR=/my/custom/dir

will override the setting and allow for configurable settings.

$SSH_DIR is then mounted as host-volume in the Docker container and
placed in /home/<user>/.ssh
2017-05-12 23:52:20 -04:00
Matt McCormick
5e83a6945d manylinux: Do not over ride repositories
The upstream manylinux images have switched to the CentOS Vault
repositories.

This addresses the manylinux-x86 image build.
2017-05-12 22:28:38 -04:00
Jean-Christophe Fillion-Robin
065448460f
manylinux: Add missing repo files
This commit includes files omitted in commit 6e59959 (manylinux: Use
CentOS Vault repositories)

Reported-by: Constantine Grantcharov <cgrantcharov@trustpointinnovation.com>
2017-05-11 00:01:54 -04:00
Jean-Christophe Fillion-Robin
dd9d902538
Fix "text file busy" error reported when using AUFS storage driver
This commit fixes the following error specific to AUFS:

/dockcross/entrypoint.sh: line 47: /usr/bin/gosu: Text file busy
/dockcross/entrypoint.sh: line 47: /usr/bin/gosu: Success

Thanks @sobolevn
See https://github.com/moby/moby/issues/13594#issuecomment-262441366
2017-05-01 16:35:28 -04:00
Jean-Christophe Fillion-Robin
6e59959a6a
manylinux: Use CentOS Vault repositories
Backported from thewtex/docker-centos-build@26f7fd3

CentOS 5 is no longer supported and requests to obtain information from
the mirrors fails. However, the packages are still available on the
"Vault" mirrors.

Comment out the `mirrorlist` entries and set `enabled=0` in
CentOS-Base.repo, add entries for 5.11 in CentOS-Vault.repo and mark
them `enabled=1`.
2017-05-01 16:35:28 -04:00
Matt McCormick
4c3612da2b common: Use gosu to replace chpst and add sudo abilities
From:

  https://github.com/tianon/gosu
2017-04-22 23:35:12 -04:00
Matt McCormick
89ef580768 common: Bump Ninja to 1.7.2 2017-04-15 11:45:18 -04:00
Matt McCormick
be603d62cf common: Bump CMake to v3.8.0 2017-04-15 11:44:57 -04:00
Matt McCormick
c25807acda dockcross: Do not leave dangling container on update-script
Addesses #103
2017-01-25 11:01:48 -05:00
Jean-Christophe Fillion-Robin
2511a92d17
dockcross: Check if "/proc/version" exists and fix error on MacOSX. Fixes #94
This commit will avoid the following error from being reported
on MacOSX:

```
docker run --rm dockcross/linux-armv7 > ./dockcross-linux-armv7
chmod +x ./dockcross-linux-armv7
./dockcross-linux-armv7 bash -c '$CC test/C/hello.c -o hello_arm'
grep: /proc/version: No such file or directory
grep: /proc/version: No such file or directory
```

Reported-by: Chris Warth <cswarth@gmail.com>
2016-12-05 01:32:14 -05:00
Jean-Christophe Fillion-Robin
c0fe1e2313
dockcross: Ensure deletion error are ignored
This commit follows up on 2e71db2 (dockcross: Ignore deletion error
when running in unprivileged LXC container) by hiding the message
only when (a) the command output matches the expected error message
and (b) is executed on CircleCI.

Doing so will avoid adding "noise" to log of service like CircleCI
that are effectively running docker in unprivileged LXC container.

See #50
2016-11-28 19:50:42 -05:00
Jean-Christophe Fillion-Robin
4ad3e1a94f
dockcross: Add support for per-project configuration 2016-11-26 21:47:11 -05:00
Jean-Christophe Fillion-Robin
dee44ef426
imagefiles: Reduce wget verbosity using --progress=bar:force 2016-11-26 19:59:07 -05:00
Jean-Christophe Fillion-Robin
8077008a10
common: Introduce "install-ninja.sh" 2016-11-25 15:51:42 -05:00
Jean-Christophe Fillion-Robin
0552c37fea
common.docker: Improve OpenSSL and CMake install introducing helper scripts
To accommodate the requirements associated with x86 and x64 images, the
command building OpenSSL and CMake became overly complex and hard to
maintain.

This commit has multiple purposes:

(1) simplify common.docker

(2) fix the building of 64-bit shared libraries against the static openssl
libraries by passing the -fPIC flag.

(3) ensure [many]linux-x86 and [many]linux-x64 images have an up-to-date
OpenSSL install. Openssl static libraries are installed in /usr

(4) simplify and speedup CMake build avoiding the second build with
explicit -DCMAKE_USE_OPENSSL:BOOL=ON. Indeed, configuring CMake on Linux
already looks for OpenSSL.

(5) speedup download of CMake source directly downloading the archive
corresponding to the revision.

(6) test CMake by:
  - running CMake.FileDownload test
  - trying to download a file served over https
2016-11-21 06:08:30 -05:00
chadawagner
9373f029f4 quote HOST_PWD in docker cmd to allow spaces 2016-11-17 21:19:54 -08:00
Matt McCormick
6b71b08cbd doc: We support Docker for Mac and Docker for Windows
No longer support boot2docker on these platforms
2016-11-16 19:08:04 -08:00
Matt McCormick
d9d65ffcc9 dockcross: Add support for Windows
Tested on Git Bash and Bash on Ubuntu for Windows.

There are some issue with building the Docker image itself, but using the
images works great.
2016-11-16 19:02:55 -08:00
Jean-Christophe Fillion-Robin
8923c6a3c7
manylinux.common: Fix warning changing ownership of python install
While the use of sudo (made possible by 53cf084) allows to install
additional packages, the warning copied below was still reported.

To avoid this warning and streamline the installation of new packages,
this commit (1) introduces the concept of "pre_exec" entrypoint hook
and (2) adds such a hook to change the ownership of python "bin" and
"site-packages" directories for the manylinux images.

Warning reported are similar to this one:

```
The directory '/home/jcfr/.cache/pip/http' or its parent directory is
not owned by the current user and the cache has been disabled. Please
check the permissions and owner of that directory. If executing pip
with sudo, you may want sudo's -H flag.
```

Note that the sudo "-H" flag suggested in the warning is not available
in centos.
2016-11-04 22:58:31 -04:00
Jean-Christophe Fillion-Robin
f31e582f80
dockcross: Simplify container name generation using $RANDOM
This commit removes the complex pipeline leveraging output from
/dev/urandom and simply uses $RANDOM variable. For the purpose
of generating an available container name, it will works well.

Suggested-by: Matt McCormick <matt.mccormick@kitware.com>
2016-10-30 23:46:01 -04:00
Jean-Christophe Fillion-Robin
bd234af0a9
dockcross: Prevent dockcross from blocking when used with Python subprocess
As explained in [1], when using dockcross from python subprocess, the
interactive mode is disabled and output of "cat /dev/urandom" is block
buffered instead of being line buffered.

Workaround to this problem is to simply read a fixed amount of characters
from urandom.

The following two snippets illustrates the problem and the
the implemented  solution:

Works

```python
import subprocess as sp
sp.check_call("var=$(head -c 500 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9' | fold -w 7 | head -n 1); echo $var", shell=True)
```

=> output random string


Fail:

```python
import subprocess as sp
sp.check_call("var=$(cat /dev/urandom | base64 | tr -dc 'a-zA-Z0-9' | fold -w 7 | head -n 1); echo $var", shell=True)
```

=> Hang

[1] http://stackoverflow.com/questions/16805827/unable-to-read-stdout-from-a-running-process#16806506
2016-10-30 03:27:10 -04:00
Jean-Christophe Fillion-Robin
3288c877e5
dockcross: Fix "tr: Illegal byte sequence" when generating container name on MacOSx
See #50
2016-10-27 13:20:31 -04:00
Jean-Christophe Fillion-Robin
c5edcb3a74
dockcross: Ensure exit code associated with run command is always returned 2016-10-27 11:37:07 -04:00
Jean-Christophe Fillion-Robin
904cb09858
dockcross: Change name of container from "dockcross" to "dockcross_RAND"
where RAND is a 7 characters long randomly generated alphanumeric string.

Note that container name can NOT start with "_",
only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed

See #50
2016-10-27 11:37:03 -04:00
Jean-Christophe Fillion-Robin
7a8f4fab0e
dockcross: Do not output any text after container is removed
See #50
2016-10-27 11:19:37 -04:00
Jean-Christophe Fillion-Robin
2e71db2234
dockcross: Ignore deletion error when running in unprivileged LXC container
This commit workarounds the problem described in [1] and [2] by ignoring error
happening when deleting container in unprivileged LXC container.

Fixes #50

[1] https://circleci.com/docs/docker-btrfs-error/
[2] https://discuss.circleci.com/t/docker-error-removing-intermediate-container/70
2016-10-26 23:24:25 -04:00
Jean-Christophe Fillion-Robin
af75453ed0 base/dockcross: Run docker with "-ti" only if a tty or pts is attached
This commit reverts f07ca00 (base: Do not add -i -t flags to run command
by default) and ensure tty is available before specifying the flags.
2016-09-23 11:33:29 -04:00
Jean-Christophe Fillion-Robin
aa2c24cb3b base/dockcross: Run docker using -t to support CTRL-C 2016-09-22 23:34:08 -04:00
Jean-Christophe Fillion-Robin
995c9091e5 manylinux: Grant current user password less sudo access.
This will allow build script like "build-wheels.sh" to run command like
the following (see [1]):

  sudo yum install -y atlas-devel

It will also allow to pip install using sudo and avoid error reported in [3].

That said, instead of running pip using sudo, the recommended approach
is to specify the "--user" flag [2]

[1] 893d92517e/travis/build-wheels.sh

[2] http://stackoverflow.com/questions/7143077/how-can-i-install-packages-in-my-home-folder-with-pip#7143496

[3] Error reported when running pip without "sudo pip install <packagename" or "pip install --user <packagename>"
```
Exception:
Traceback (most recent call last):
  File "/opt/_internal/cpython-2.7.11-ucs2/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/opt/_internal/cpython-2.7.11-ucs2/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run
    prefix=options.prefix_path,
  File "/opt/_internal/cpython-2.7.11-ucs2/lib/python2.7/site-packages/pip/req/req_set.py", line 736, in install
    requirement.uninstall(auto_confirm=True)
  File "/opt/_internal/cpython-2.7.11-ucs2/lib/python2.7/site-packages/pip/req/req_install.py", line 742, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/opt/_internal/cpython-2.7.11-ucs2/lib/python2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/opt/_internal/cpython-2.7.11-ucs2/lib/python2.7/site-packages/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/opt/_internal/cpython-2.7.11-ucs2/lib/python2.7/shutil.py", line 303, in move
    os.unlink(src)
OSError: [Errno 13] Permission denied: '/opt/_internal/cpython-2.7.11-ucs2/bin/easy_install'
```
2016-09-22 19:21:24 -04:00
Matt McCormick
131e6408ee Merge pull request #38 from jcfr/36-support-disabling-toolchain-cmake-option
36 support disabling toolchain cmake option
2016-09-22 11:23:09 -04:00
Jean-Christophe Fillion-Robin
4876f14356 base/cmake: Do not pass toolchain option when using incompatible cmake option
Also revert the changes to ccmake.sh, the restriction doesn't apply to it.

Suggested-by: Matt McCormick <matt.mccormick@kitware.com>
2016-09-21 21:11:33 -04:00
Jean-Christophe Fillion-Robin
c05d52310a dockcross: Ensure running "update commands" exits script with correct status 2016-09-21 20:25:11 -04:00
Jean-Christophe Fillion-Robin
c525ad106e cmake/ccmake: Provide a mechanism to disable passing of toolchain file
By default the toolchain file is always passed as an option to cmake/ccmake

It can be explicitly disabled setting the environment variable
DOCKCROSS_PASS_CMAKE_TOOLCHAIN_FILE to 0
2016-09-21 19:06:51 -04:00
Jean-Christophe Fillion-Robin
43e46710e6 dockcross: Add support for special update commands. Fixes #34 2016-09-21 16:31:09 -04:00
Jean-Christophe Fillion-Robin
1eac15c210 dockcross: Add warning regarding location of DEFAULT_DOCKCROSS_IMAGE 2016-09-21 16:29:00 -04:00
Matt McCormick
f07ca0043c base: Do not add -i -t flags to run command by default
Allow the dockcross script to be used in scripts where a tty is not available.
2016-08-31 22:31:58 -04:00
Matt McCormick
1ed3548655 base: Add cmake wrapper scripts for CMAKE_TOOLCHAIN_FILE
All images should define this variables.

Disable build tests on the base image because it is not configured for cross
compiling.
2016-07-22 08:48:59 -04:00
Jean-Christophe Fillion-Robin
96f3514bf2 Dockerfiles: Rename working directory from "/build" to "/work"
Since the directory will contain both sources and build, this commit
generalizes its name.
2016-07-16 01:12:58 -04:00
Matt McCormick
04c7d0de18 Rename project and repository to dockcross 2016-07-15 23:46:08 -04:00
Matt McCormick
30e29f3bbb browser-asmjs: cp ~/.emscripten, etc to the user home in the entrypoint 2016-07-06 15:33:35 -04:00
Matt McCormick
42ff489565 dockcross: Improve end of script help formatting 2016-07-05 21:50:20 -04:00
Matt McCormick
a5d5307a97 dockcross: Remove duplicate option parsing 2016-07-05 21:49:07 -04:00
Matt McCormick
8cd9083ae6 dockcross: Improve command help 2016-07-04 22:27:04 -04:00
Matt McCormick
5aa3cd3867 dockcross: Add short flags 2016-07-04 22:17:22 -04:00
Matt McCormick
3a96030b23 base: support BUILDER_USER, BUILDER_GROUP, and liquidprompt bash 2016-07-04 22:03:10 -04:00
Matt McCormick
fdb18671e3 dockcross: make the default image specific to each compiler 2016-07-04 00:10:36 -04:00
Roman Valls Guimera
9ff528dd49 Remove old README.md [ci skip] 2016-05-31 09:04:58 +02:00
Roman Valls Guimera
7e6150cf29 Tidy up and consolidate both README.rst/README.md into one. Introduce linux-armv5. 2016-05-30 22:50:22 +02:00
Sven Fischer
8e344a9537 Added functionality to ease the use of X image
Functionality borrowed from the Raspberry Pi cross compile docker build
file from https://github.com/sdt/docker-raspberry-pi-cross-compiler
2016-05-30 22:50:22 +02:00