1
0

Dockerfile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. FROM debian
  2. ARG GO_AGENT_VERSION=16.1.0
  3. ARG GO_AGENT_BUILD=2855
  4. RUN apt-get clean && apt-get update \
  5. && apt-get install -y \
  6. curl \
  7. default-jre-headless \
  8. git \
  9. subversion
  10. RUN apt-get clean && apt-get install -y mongodb
  11. RUN apt-get clean && apt-get install -y python-dev
  12. RUN curl -sL https://deb.nodesource.com/setup_5.x | bash -E - \
  13. && apt-get update \
  14. && apt-get install -y \
  15. build-essential \
  16. nodejs \
  17. && apt-get clean \
  18. && rm -rf /var/lib/apt/listss/* \
  19. && mkdir -p /data/db
  20. # Installing Go agent
  21. RUN cd /tmp \
  22. && curl -sL -o go-agent.deb "https://download.go.cd/binaries/${GO_AGENT_VERSION}-${GO_AGENT_BUILD}/deb/go-agent-${GO_AGENT_VERSION}-${GO_AGENT_BUILD}.deb" \
  23. && dpkg -i -E go-agent.deb \
  24. && sed -i -e 's#GO_SERVER=127.0.0.1#GO_SERVER=gocd-server#' /etc/default/go-agent
  25. RUN git config --global url."https://".insteadOf git://
  26. #VOLUME ["/var/lib/go-agent", "/var/log/go-agent", "/var/go/.ssh"]
  27. COPY autoregister.properties /var/lib/go-agent/config/autoregister.properties
  28. CMD until curl -s -o /dev/null "http://${GO_SERVER}:${GO_SERVER_PORT}"; do sleep 5; done; \
  29. if [ -n "$AGENT_KEY" ]]; then \
  30. sed -i -e 's/=.*/=/g' -e "s/key=/key=$AGENT_KEY/" -e "s/resources=/resources=$AGENT_RESOURCES/" /var/lib/go-agent/config/autoregister.properties; \
  31. fi; \
  32. (/usr/share/go-agent/agent.sh &); (service mongodb start); while [ ! -f /var/log/go-agent/go-agent-bootstrapper.log ]; do sleep 1; done; exec tail -F /var/log/go-agent/*