1
0

Dockerfile 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. FROM alpine
  2. ENV JAVA_HOME="/usr/lib/jvm/default-jvm"
  3. RUN apk update \
  4. && apk add --no-cache \
  5. libc6-compat \
  6. curl \
  7. git \
  8. subversion \
  9. openjdk7-jre-base \
  10. bash \
  11. && ln -fs /bin/bash /bin/sh
  12. # Installing CloudFoundry
  13. RUN cd /usr/local/bin \
  14. && curl -L "https://cli.run.pivotal.io/stable?release=linux64-binary&source=github" | tar -zx \
  15. && mkdir /lib64 \
  16. && ln -s /lib/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2 \
  17. && cf add-plugin-repo bluemix-cf-staging http://plugins.ng.bluemix.net >/dev/null 2>&1
  18. # Installing Go agent
  19. WORKDIR /var/lib
  20. RUN curl -sL -o go-agent-16.1.0.zip "https://download.go.cd/binaries/16.1.0-2855/generic/go-agent-16.1.0-2855.zip" \
  21. && unzip go-agent-16.1.0.zip \
  22. && mv go-agent-16.1.0 go-agent \
  23. && rm go-agent-16.1.0.zip
  24. RUN git config --global url."https://".insteadOf git://
  25. RUN rm -rf /tmp/* /var/tmp/* /var/cache/apk/*
  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. #ENTRYPOINT ["/bin/bash", "-c"]
  29. CMD until curl -s -o /dev/null "http://${GO_SERVER}:${GO_SERVER_PORT}"; do sleep 5; done; \
  30. if [ -n "$AGENT_KEY" ]; then \
  31. sed -i -e 's/=.*/=/g' -e "s/key=/key=$AGENT_KEY/" -e "s/resources=/resources=$AGENT_RESOURCES/" /var/lib/go-agent/config/autoregister.properties; \
  32. fi; \
  33. (/var/lib/go-agent/agent.sh &); while [ ! -f /var/lib/go-agent/go-agent-bootstrapper.log ]; do sleep 1; done; exec tail -F /var/lib/go-agent/*.log