Last active
December 28, 2015 17:19
-
-
Save juniorz/7534920 to your computer and use it in GitHub Desktop.
ThoughtWorks Go Agent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------------------------------------------------------------------- | |
# $ docker build -t juniorz/go-agent git://gist.github.com/7534920.git | |
# ------------------------------------------------------------------- | |
# 1. $ docker run -d -l go-server:go_server -p 8080:8153 juniorz/go-agent | |
# 2. Go to http://localhost:8080/go/ | |
# ------------------------------------------------------------------- | |
FROM phusion/baseimage:0.9.1 | |
MAINTAINER Reinaldo Junior <[email protected]> | |
RUN apt-get update && apt-get upgrade -y | |
# Remove authentication rights for insecure_key. | |
RUN echo /bin/sh -c \"rm -f /root/.ssh/authorized_keys /home/*/.ssh/authorized_keys\" > /sbin/remove_authorized_keys &&\ | |
chmod 0700 /sbin/remove_authorized_keys | |
# To remove the key, run: | |
# curl https://raw.github.com/phusion/baseimage-docker/master/image/insecure_key |\ | |
# ssh -i /dev/stdin root@$(docker inspect $CID | grep IPAddress | cut -d '"' -f 4) /sbin/remove_authorized_keys | |
# Set correct environment variables. | |
ENV HOME /root | |
# Installs | |
RUN curl -# http://download01.thoughtworks.com/go/13.3.1/ga/go-agent-13.3.1-18130.deb -o /tmp/go.deb | |
RUN export LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive RUNLEVEL=0 &&\ | |
apt-get install -y java7-runtime-headless &&\ | |
dpkg -i /tmp/go.deb | |
# Disables init | |
#RUN /etc/init.d/go-agent stop &&\ | |
# update-rc.d -f go-agent remove &&\ | |
# rm /etc/init.d/go-agent | |
# Adds go-agent service | |
#RUN mkdir /etc/service/go-agent | |
#ADD go-server.sh /etc/service/go-agent/run | |
#RUN chmod 0755 /etc/service/go-agent/run | |
# Clean up APT when done. | |
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | |
# Use baseimage-docker's init process. | |
CMD ["/sbin/my_init"] | |
# EXPOSE 8153 | |
# EXPOSE 8154 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -xeu | |
# From /etc/init.d/go-agent | |
[ -r /etc/default/go-agent ] && . /etc/default/go-agent | |
[ -d /var/run/go-agent ] || (mkdir /var/run/go-agent && chown -R go:go /var/run/go-agent) | |
export PRODUCTION_MODE="N" | |
export DAEMON="N" | |
# export GO_SERVER=127.0.0.1 | |
# export GO_SERVER_PORT=8153 | |
exec chpst -u go /usr/share/go-agent/agent.sh >> /var/log/go-agent/go-agent-bootstrapper.log 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment