generated from d2iq-archive/golang-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.ci
37 lines (29 loc) · 1.7 KB
/
Dockerfile.ci
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
29
30
31
32
33
34
35
36
37
# Copyright 2022 D2iQ, Inc. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# syntax=docker/dockerfile:1
FROM debian:bullseye-20211201-slim
RUN apt-get update && apt-get install -y \
bash \
build-essential \
bzip2 \
curl \
direnv \
git \
python3 \
python3-pip \
unzip \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install --upgrade yamale yamllint pre-commit gitlint
ARG ASDF_VERSION
RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v${ASDF_VERSION}
RUN echo ". ${HOME}/.asdf/asdf.sh" >> ${HOME}/.bashrc
RUN --mount=type=bind,target=/tmp/dkp-cli,readwrite=true \
cd /tmp/dkp-cli && \
bash -ec ". ~/.asdf/asdf.sh && make install-tools" && \
pre-commit install -t pre-commit -t commit-msg --install-hooks
ARG DOCKER_VERSION
RUN curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz | \
tar xz -C /usr/local/bin --strip-components=1 docker/docker
# needed to be able to pull private repos, e.g. in 'go mod download'
RUN git config --global url."[email protected]:".insteadOf "https://github.com/"
RUN mkdir -p ~/.ssh && echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=' > ~/.ssh/known_hosts