Updated: docker build

This commit is contained in:
Aleksandr Soloshenko 2023-01-01 22:55:26 +07:00
parent 3ae6eba61e
commit da4687d95c
2 changed files with 4 additions and 3 deletions

View File

@ -5,7 +5,7 @@ ARG SSH_PRV_KEY
ARG APP
WORKDIR /go/src
RUN apk add --no-cache git=2.36.2-r0 openssh-client-default=9.0_p1-r2
RUN apk add --no-cache git=2.38.2-r0 openssh-client-default=9.1_p1-r1
RUN mkdir -p /root/.ssh && \
chmod 0700 /root/.ssh && \
@ -44,7 +44,6 @@ ENV GOOSE_MIGRATION_DIR=/app/migrations
COPY --from=build /go/bin/goose /app/goose
COPY scripts/docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
# `boilerplate` should be replaced here as well
COPY db/migrations /app/migrations

View File

@ -16,7 +16,7 @@ else
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
fi
TAG=${GIT_TAG:-v"${GIT_BRANCH}"}
TAG=${GIT_TAG:-v"${GIT_BRANCH////-}"}
if [ -z "$TAG" ]; then
exit 0
fi
@ -40,6 +40,8 @@ FULL_VERSION=${TAG:1}
PARTS=$(echo ${FULL_VERSION} | tr "." "\n")
VERSION=
set -e
docker build ${DOCKER_PARAMS[*]} -t ${DOCKER_IMAGE}:${FULL_VERSION} --build-arg SSH_PRV_KEY="$SSH_PRV_KEY" --build-arg APP="$APP" .
docker push ${DOCKER_IMAGE}:${FULL_VERSION}