diff --git a/Dockerfile b/Dockerfile index cb90a71..bc8e7e3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM docker:latest +FROM cubetiq/calpine-docker:latest -RUN apk add bash +RUN apk update COPY ./entrypoint.sh /entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh index f92525d..648ac7a 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,8 +1,8 @@ -#!/bin/bash +#!/bin/sh #### Current working directory is: /github/workspace #### WORKDIR=$(pwd) -echo "Workdir => ${WORKDIR}" +echo "Working directory => $WORKDIR" if [ ! -z $INPUT_USERNAME ]; then echo $INPUT_PASSWORD | docker login $INPUT_REGISTRY -u $INPUT_USERNAME --password-stdin @@ -15,7 +15,7 @@ then INPUT_OPTIONS="$INPUT_OPTIONS --network $INPUT_DOCKER_NETWORK" fi if [ -z $INPUT_SHELL ]; -then INPUT_SHELL=sh +then INPUT_SHELL=/bin/sh fi if [ -z $INPUT_IMAGE ]; @@ -26,12 +26,4 @@ if [ -z $semicolon_delimited_script ]; then semicolon_delimited_script="echo $(whoami)" fi -echo "My name is: $(whoami)" - -echo "Start executing docker..." - -mkdir hello - -echo "Hello World" > hello/hello.txt - -docker run --workdir /github/workspace -v "$(pwd)":"/github/workspace" -v "/var/run/docker.sock":"/var/run/docker.sock" --entrypoint=sh $INPUT_IMAGE -c "docker version; docker ps; pwd; ls; ls /" \ No newline at end of file +exec docker run --workdir $WORKDIR -v "$WORKDIR":"$WORKDIR" -v "/var/run/docker.sock":"/var/run/docker.sock" $INPUT_OPTIONS --entrypoint=$INPUT_SHELL $INPUT_IMAGE -c "`cat semicolon_delimited_script`" \ No newline at end of file