Skip to content

Commit

Permalink
Merge pull request #26 from blueyed/remove-bash
Browse files Browse the repository at this point in the history
Remove bash
  • Loading branch information
blueyed authored Mar 25, 2017
2 parents bd22b38 + 6e443db commit e8fb50c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
FROM alpine:3.5

RUN apk --update add bash \
&& rm -rf /var/cache/apk/* /tmp/* /var/tmp/*

RUN adduser -h /home -s /bin/bash -D -u 8465 vimtest
RUN adduser -h /home -s /bin/sh -D -u 8465 vimtest

RUN mkdir -p /vim /vim-build/bin /plugins
RUN chown vimtest:vimtest /home /plugins
Expand Down
12 changes: 12 additions & 0 deletions example/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,17 @@ test: test-setup
for vim in $$vims; do \
$(DOCKER) $$vim '+Vader! test/*'; \
done
out=$$(docker run --rm "$(IMAGE)" /vim-build/bin/argecho "arg1" "arg 2"); \
for line in "PWD=/" "Running as: root" "Arguments:" "arg1" "arg 2"; do \
if ! echo "$$out" | grep -qFx -e "$$line"; then \
echo "Line not found: $$line"; echo "$$out"; exit 1; \
fi \
done
out=$$(docker run --rm "$(IMAGE)" argecho "arg1" "arg 2"); \
for line in "Running as: vimtest" "PWD=/testplugin" "Arguments:" "-u" "/home/vimrc" "-i" "NONE" "arg1" "arg 2"; do \
if ! echo "$$out" | grep -qFx -e "$$line"; then \
echo "Line not found: $$line"; echo "$$out"; exit 1; \
fi \
done

.PHONY: test-setup test
4 changes: 2 additions & 2 deletions scripts/argecho.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

echo "Running as: $(whoami)"

Expand All @@ -9,6 +9,6 @@ env
echo
echo "Arguments:"
while [ $# -gt 0 ]; do
echo $1
echo "$1"
shift
done
4 changes: 3 additions & 1 deletion scripts/install_vim.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

set -e

Expand All @@ -20,6 +20,8 @@ build() {
[ -z $NAME ] && NAME="vim-${TAG}"
[ -z $TAG ] && bail "-tag is required"

apk add ncurses

VIM_NAME="vim_${TAG}_py${PYTHON}_rb${RUBY}_lua${LUA}"
VIM_PATH="/vim-build/$VIM_NAME"
VIM_BIN="$VIM_PATH/bin/vim"
Expand Down
6 changes: 3 additions & 3 deletions scripts/run_vim.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
#!/bin/sh

BIN=$1
shift

if [ "$BIN" == "bash" ] || [ -z "$BIN" ]; then
exec /bin/bash
if [ "$BIN" = "sh" ] || [ -z "$BIN" ]; then
exec /bin/sh
fi
if ! [ -x "/vim-build/bin/$BIN" ]; then
exec "$BIN" "$@"
Expand Down

0 comments on commit e8fb50c

Please sign in to comment.