############################################################################################### # This file is autogenerated by the repository at https://github.com/gocd/gocd. # Please file any issues or PRs at https://github.com/gocd/gocd ############################################################################################### FROM alpine:latest as gocd-agent-unzip ARG UID=1000 RUN \ apk --no-cache upgrade && \ apk add --no-cache curl && \ curl --fail --location --silent --show-error "https://download.gocd.org/binaries/21.1.0-12439/generic/go-agent-21.1.0-12439.zip" > /tmp/go-agent-21.1.0-12439.zip RUN unzip /tmp/go-agent-21.1.0-12439.zip -d / RUN mv /go-agent-21.1.0 /go-agent && chown -R ${UID}:0 /go-agent && chmod -R g=u /go-agent FROM centos:7 LABEL gocd.version="21.1.0" \ description="GoCD agent based on centos version 7" \ gocd.full.version="21.1.0-12439" \ gocd.git.sha="5a4959c7c4ede49165ec961b0219126cd5aa9e52" ADD https://github.com/krallin/tini/releases/download/v0.18.0/tini-static-amd64 /usr/local/sbin/tini # force encoding ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 ENV GO_JAVA_HOME="/gocd-jre" ENV BASH_ENV="/opt/rh/sclo-git212/enable" ENV ENV="/opt/rh/sclo-git212/enable" ARG UID=1000 ARG GID=1000 RUN \ # add mode and permissions for files we added above chmod 0755 /usr/local/sbin/tini && \ chown root:root /usr/local/sbin/tini && \ # add our user and group first to make sure their IDs get assigned consistently, # regardless of whatever dependencies get added # add user to root group for gocd to work on openshift useradd -u ${UID} -g root -d /home/go -m go && \ yum update -y && \ yum install --assumeyes centos-release-scl && \ yum install --assumeyes sclo-git212 mercurial subversion openssh-clients bash unzip curl procps sysvinit-tools coreutils && \ cp /opt/rh/sclo-git212/enable /etc/profile.d/sclo-git212.sh && \ yum clean all && \ curl --fail --location --silent --show-error 'https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.1%2B9/OpenJDK15U-jre_x64_linux_hotspot_15.0.1_9.tar.gz' --output /tmp/jre.tar.gz && \ mkdir -p /gocd-jre && \ tar -xf /tmp/jre.tar.gz -C /gocd-jre --strip 1 && \ rm -rf /tmp/jre.tar.gz && \ mkdir -p /go-agent /docker-entrypoint.d /go /godata RUN yum update -y ADD docker-entrypoint.sh / COPY --from=gocd-agent-unzip /go-agent /go-agent # ensure that logs are printed to console output COPY --chown=go:root agent-bootstrapper-logback-include.xml agent-launcher-logback-include.xml agent-logback-include.xml /go-agent/config/ RUN chown -R go:root /docker-entrypoint.d /go /godata /docker-entrypoint.sh \ && chmod -R g=u /docker-entrypoint.d /go /godata /docker-entrypoint.sh ############################################## RUN yum install git -y ##Adding Keys COPY --chown=go:root .ssh/ /home/go/.ssh/ RUN chmod -R 400 /home/go/.ssh/id_rsa.pub RUN chmod -R 400 /home/go/.ssh/id_rsa RUN chmod -R 400 /home/go/.ssh/known_hosts ######################################################### RUN chmod 777 docker-entrypoint.sh ENTRYPOINT ["/docker-entrypoint.sh"] USER go