Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove bash #26

Merged
merged 2 commits into from
Mar 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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