FROM centos:7
LABEL org.opencontainers.image.authors="Daniel Fox <dan.fox@tigera.io>"
ENV STREAM=el7

ARG UID
ARG GID

COPY install-centos-build-deps install-centos-build-deps
RUN ./install-centos-build-deps

# rpmbuild requires the current user to exist inside the container, copy in
# some user/group entries calculated by the makefile.
# use `--force` and `-o` since tests can run under root and command will fail with duplicate error
RUN groupadd --force --gid=$GID user && useradd -o --home=/ --gid=$GID --uid=$UID user
RUN /install-centos-build-deps

WORKDIR /code
