-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathDockerfile.centos7-build-env
52 lines (44 loc) · 1.84 KB
/
Dockerfile.centos7-build-env
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Copyright 2019 clair authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM centos:7
LABEL maintainer "[email protected]"
ARG GIT_TAG
RUN test -n "$GIT_TAG" # Expect Clair GIT TAG to be non-empty.
# Install Golang by retrieving the binary
ENV GO_VERSION=1.13.3
ENV GO_OS=linux
ENV GO_ARC=amd64
RUN curl https://dl.google.com/go/go${GO_VERSION}.${GO_OS}-${GO_ARC}.tar.gz --output go.tar.gz
RUN echo 0804bf02020dceaa8a7d7275ee79f7a142f1996bfd0c39216ccb405f93f994c0 go.tar.gz > GOCHECKSUM
RUN sha256sum -c GOCHECKSUM
RUN tar -C /usr/local -xzf go.tar.gz > /dev/null
ENV GOPATH=/go
ENV PATH=$PATH:/usr/local/go/bin:${GOPATH}/bin
# Verify go verion
RUN go version
# Install dependencies
RUN yum install -y --setopt=tsflags=nodocs --setopt=skip_missing_names_on_install=False git hg svn bzr gcc
ENV CFSSL_VERSION=1.3.4
RUN go get -u github.com/cloudflare/cfssl/cmd/cfssl
WORKDIR /go/src/github.com/cloudflare/cfssl
RUN git checkout ${CFSSL_VERSION}
RUN go install github.com/cloudflare/cfssl/cmd/cfssl
RUN go install github.com/cloudflare/cfssl/cmd/cfssljson
RUN go get -u github.com/coreos/jwtproxy/cmd/jwtproxy
# Build Clair with git tag
RUN git clone https://github.com/coreos/clair.git /go/src/github.com/coreos/clair
WORKDIR /go/src/github.com/coreos/clair
RUN git checkout $GIT_TAG
RUN go install github.com/coreos/clair/cmd/clair
RUN yum remove -y kernel-headers