N
N
Nazar Mokrinsky2015-01-26 01:13:52
linux
Nazar Mokrinsky, 2015-01-26 01:13:52

Strange error while building Docker container (Bash)?

There is a line in the Dockerfile :

 || MYSQL_PASSWORD=`pwgen -s 20 1` && \

On my system (Ubuntu 15.04 x64) it works as expected, but when building the container, it crashes:
/bin/sh: 1: [[: not found

Any ideas why this might happen? It seems Bash syntax should be the same everywhere.

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
Z
Zr, 2015-01-26
@nazarpc

On most systems /bin/sh, this is not GNU Bash ( /bin/bash). And in Ubuntu too - there sh- it's Debian ASH, which [[can't.

A
Archie Kuznetsov, 2015-01-26
@Wolf4ara

In general, this bracket is a separate utility:

[email protected]:~:26/01/15-09:05$ ls -l /usr/bin/[
-rwxr-xr-x 1 root root 35248 Янв 27  2013 /usr/bin/[

most likely this path is not registered in PATH in the environment of the script
Check:
[email protected]:~:26/01/15-09:06$ whereis [
[: /usr/bin/[ /usr/bin/X11/[ /usr/share/man/man1/[.1.gz

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question