Merge pull request #2 from tianon/docker-entrypoint

Add initial entrypoint script for handling direct "bash" flags ("docker run bash -c '...'")
This commit is contained in:
Tianon Gravi authored and GitHub committed 2017-02-08 13:36:04 -08:00
commit ebe992ca8d
19 files changed
+118

No files matched your search

+2
View File
@@ -21,6 +21,8 @@ before_script:
script:
- docker build -t "$image" .
- docker run -it --rm "$image" --version
- docker run -it --rm "$image" echo hi
- ~/official-images/test/run.sh "$image"
after_script:
+2
View File
@@ -115,4 +115,6 @@ RUN set -ex; \
# for some reason, 3.0.xx manifests as 3.00.xx (hence the extra "0" added in the following check)
[ "$(bash -c 'echo "${BASH_VERSION%%[^0-9.]*}"')" = "${_BASH_VERSION}0.$_BASH_LATEST_PATCH" ];
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["bash"]
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# first arg is `-f` or `--some-option`
# or there are no args
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
# docker run bash -c 'echo hi'
exec bash "$@"
fi
exec "$@"
+2
View File
@@ -114,4 +114,6 @@ RUN set -ex; \
bash --version; \
[ "$(bash -c 'echo "${BASH_VERSION%%[^0-9.]*}"')" = "$_BASH_VERSION.$_BASH_LATEST_PATCH" ];
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["bash"]
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# first arg is `-f` or `--some-option`
# or there are no args
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
# docker run bash -c 'echo hi'
exec bash "$@"
fi
exec "$@"
+2
View File
@@ -114,4 +114,6 @@ RUN set -ex; \
bash --version; \
[ "$(bash -c 'echo "${BASH_VERSION%%[^0-9.]*}"')" = "$_BASH_VERSION.$_BASH_LATEST_PATCH" ];
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["bash"]
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# first arg is `-f` or `--some-option`
# or there are no args
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
# docker run bash -c 'echo hi'
exec bash "$@"
fi
exec "$@"
+2
View File
@@ -117,4 +117,6 @@ RUN set -ex; \
bash --version; \
[ "$(bash -c 'echo "${BASH_VERSION%%[^0-9.]*}"')" = "$_BASH_VERSION.$_BASH_LATEST_PATCH" ];
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["bash"]
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# first arg is `-f` or `--some-option`
# or there are no args
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
# docker run bash -c 'echo hi'
exec bash "$@"
fi
exec "$@"
+2
View File
@@ -114,4 +114,6 @@ RUN set -ex; \
bash --version; \
[ "$(bash -c 'echo "${BASH_VERSION%%[^0-9.]*}"')" = "$_BASH_VERSION.$_BASH_LATEST_PATCH" ];
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["bash"]
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# first arg is `-f` or `--some-option`
# or there are no args
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
# docker run bash -c 'echo hi'
exec bash "$@"
fi
exec "$@"
+2
View File
@@ -114,4 +114,6 @@ RUN set -ex; \
bash --version; \
[ "$(bash -c 'echo "${BASH_VERSION%%[^0-9.]*}"')" = "$_BASH_VERSION.$_BASH_LATEST_PATCH" ];
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["bash"]
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# first arg is `-f` or `--some-option`
# or there are no args
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
# docker run bash -c 'echo hi'
exec bash "$@"
fi
exec "$@"
+2
View File
@@ -115,4 +115,6 @@ RUN set -ex; \
bash --version; \
[ "$(bash -c 'echo "${BASH_VERSION%%[^0-9.]*}"')" = "$_BASH_VERSION.$_BASH_LATEST_PATCH" ];
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["bash"]
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# first arg is `-f` or `--some-option`
# or there are no args
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
# docker run bash -c 'echo hi'
exec bash "$@"
fi
exec "$@"
+2
View File
@@ -115,4 +115,6 @@ RUN set -ex; \
bash --version; \
[ "$(bash -c 'echo "${BASH_VERSION%%[^0-9.]*}"')" = "$_BASH_VERSION.$_BASH_LATEST_PATCH" ];
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["bash"]
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# first arg is `-f` or `--some-option`
# or there are no args
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
# docker run bash -c 'echo hi'
exec bash "$@"
fi
exec "$@"
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# first arg is `-f` or `--some-option`
# or there are no args
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
# docker run bash -c 'echo hi'
exec bash "$@"
fi
exec "$@"
+1
View File
@@ -59,6 +59,7 @@ for version in "${versions[@]}"; do
s/^(ENV _BASH_PATCH_LEVEL) .*/\1 '"$patchLevel"'/;
s/^(ENV _BASH_LATEST_PATCH) .*/\1 '"$latestPatch"'/
' "$version/Dockerfile"
cp -a docker-entrypoint.sh "$version/"
)
travisEnv='\n - VERSION='"$version$travisEnv"
done