Dockerfile 938 Bytes
Newer Older
1 2
# Base image: https://hub.docker.com/_/golang/
FROM golang:latest
Erick Hitter's avatar
Erick Hitter committed
3 4 5

LABEL maintainer="ethitter"
LABEL version="1.0"
6 7 8 9

# Install golint
ENV GOPATH /go
ENV PATH ${GOPATH}/bin:$PATH
Erick Hitter's avatar
Erick Hitter committed
10
RUN go get -u golang.org/x/lint/golint
11 12

# Add apt key for LLVM repository
Erick Hitter's avatar
Erick Hitter committed
13
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
14 15 16
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -

# Add LLVM apt repository
Erick Hitter's avatar
Erick Hitter committed
17
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
18 19 20 21 22 23 24 25 26 27
RUN echo "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-5.0 main" | tee -a /etc/apt/sources.list

# Install clang from LLVM repository
RUN apt-get update && apt-get install -y --no-install-recommends \
    clang-5.0 \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Set Clang as default CC
ENV set_clang /etc/profile.d/set-clang-cc.sh
Erick Hitter's avatar
Erick Hitter committed
28
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
29
RUN echo "export CC=clang-5.0" | tee -a ${set_clang} && chmod a+x ${set_clang}