Commit Graph

32 Commits

Author SHA1 Message Date
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
Guy Margalit
4606b71e68 Missing shift in dockcross -- command [args]
Otherwise `--` is sent as the command...
2017-10-26 15:26:04 +03: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
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
chadawagner
9373f029f4 quote HOST_PWD in docker cmd to allow spaces 2016-11-17 21:19:54 -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
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
c05d52310a dockcross: Ensure running "update commands" exits script with correct status 2016-09-21 20:25:11 -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
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
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