This repository has been archived by the owner on Jan 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
builder.dockerfile
28 lines (25 loc) · 1.26 KB
/
builder.dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM golang:1.15.0-buster AS builder
# hadolint ignore=DL3008
RUN apt-get update && \
apt-get install -y --no-install-recommends \
xz-utils && \
rm -rf /var/lib/apt/lists/*
WORKDIR /work
# Create appuser
ENV USER=appuser
ENV UID=10001
RUN groupadd -r --gid ${UID} ${USER} && useradd --uid ${UID} -m --no-log-init -g ${USER} ${USER}
# Install golangci-lint
ARG GOLANGCI_LINT_VERSION=1.31.0
RUN curl -L -o /tmp/golangci.tar.gz "https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_LINT_VERSION}/golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz" && \
tar -C /tmp -zxvf /tmp/golangci.tar.gz && \
mv /tmp/golangci-lint*/golangci-lint /usr/local/bin
# Install shellcheck
ARG SHELLCHECK_VERSION=v0.7.1
RUN curl -L -o /tmp/shellcheck.tar.xz "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" && \
tar -C /tmp -xJv < /tmp/shellcheck.tar.xz && \
mv /tmp/shellcheck-${SHELLCHECK_VERSION}/shellcheck /usr/local/bin
# Install hadolint
ARG HADOLINT_VERSION=v1.17.5
RUN curl -L -o /usr/local/bin/hadolint "https://github.com/hadolint/hadolint/releases/download/${HADOLINT_VERSION}/hadolint-Linux-x86_64" && chmod a+x /usr/local/bin/hadolint
ENTRYPOINT ["/work/make.sh"]