Commit Graph

73 Commits

Author SHA1 Message Date
Nadav
9572d88a7a
Update dockcross
Fixed CFG_FILE not referring to the variable $CFG_FILE.
2018-07-11 09:27:02 +03:00
Nadav Ruskin
c6c4bc078a Fixed trying to read wsl.conf when it's missing 2018-07-10 16:55:17 +03:00
Jean-Christophe Fillion-Robin
2e1e18e187
common.docker: Speed-up manylinux-x86 image build downloading CMake binary
x86 version of CMake compatible with Centos5 is now available at
https://github.com/dockbuild/CMake/releases
2018-06-09 14:14:19 -04:00
Jean-Christophe Fillion-Robin
2b93dd5412
Centralize python packages installation adding "install-python-packages" script 2018-06-09 00:07:33 -04:00
Jean-Christophe Fillion-Robin
2a425ac1ad
install-gosu-binary.sh: install sudo wrapper when executing the script 2018-06-09 00:07:33 -04:00
Matt McCormick
9d4bb8a0eb
Merge pull request #229 from Nadav-Eyesight/wsl_better_support
Wsl better support
2018-06-06 21:30:55 -04:00
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