teleport/build.assets/Dockerfile-centos6-fips
Gus Luxton 01c2924db7
Update CentOS 6 buildboxes to use vault packages (#5341)
* Also stop building Go from source and use prebuilt binary for regular CentOS 6 builds

* Add notes on vault change, also replace semicolons in Dockerfiles
2021-01-21 13:34:00 -04:00

54 lines
2.2 KiB
Plaintext

# This Dockerfile makes the "build box": the container used to build official
# releases of Teleport and its documentation.
FROM centos:6
ENV LANGUAGE=en_US.UTF-8 \
LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 \
LC_CTYPE=en_US.UTF-8
# Replace regular CentOS 6 mirror list with vault.centos.org, as CentOS 6 is EOL
# and regular mirrors aren't hosted any more.
RUN sed -i 's%^mirrorlist%#mirrorlist%g' /etc/yum.repos.d/* && \
sed -i 's%#baseurl=http://mirror.centos.org%baseurl=http://vault.centos.org%g' /etc/yum.repos.d/* && \
yum makecache fast && \
yum -y install gcc pam-devel glibc-devel net-tools tree git zip && \
yum clean all
ARG UID
ARG GID
RUN (groupadd ci --gid=$GID -o && useradd ci --uid=$UID --gid=$GID --create-home --shell=/bin/sh && \
mkdir -p -m0700 /var/lib/teleport && chown -R ci /var/lib/teleport)
# Install etcd.
RUN (curl -L https://github.com/coreos/etcd/releases/download/v3.3.9/etcd-v3.3.9-linux-amd64.tar.gz | tar -xz && \
cp etcd-v3.3.9-linux-amd64/etcd* /bin/)
# BoringCrypto (unlike regular Go) requires glibc 2.14, so we have to build from source.
# 1) Install binary go runtime for bootstrapping
# 2) Get source for the correct Go boringcrypto runtime and compile it with Go bootstrap runtime
# 3) Erase Go bootstrap runtime and create build directories
# 4) Print compiled Go version
ARG RUNTIME
ARG GO_BOOTSTRAP_RUNTIME=go1.9.7
RUN mkdir -p /go-bootstrap && cd /go-bootstrap && curl https://dl.google.com/go/${GO_BOOTSTRAP_RUNTIME}.linux-amd64.tar.gz | tar xz && \
mkdir -p /opt && cd /opt && curl https://go-boringcrypto.storage.googleapis.com/${RUNTIME}b5.src.tar.gz | tar xz && \
cd /opt/go/src && GOROOT_BOOTSTRAP=/go-bootstrap/go ./make.bash && \
rm -rf /go-bootstrap && \
mkdir -p /go/src/github.com/gravitational/teleport && \
chmod a+w /go && \
chmod a+w /var/lib && \
chmod a-w / && \
/opt/go/bin/go version
ENV GOPATH="/go" \
GOROOT="/opt/go" \
PATH="$PATH:/opt/go/bin:/go/bin:/go/src/github.com/gravitational/teleport/build"
# Install PAM module and policies for testing.
COPY pam/ /opt/pam_teleport/
RUN make -C /opt/pam_teleport install
VOLUME ["/go/src/github.com/gravitational/teleport"]
EXPOSE 6600 2379 2380