-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run teamcity agent under buildagent user using gosu, fixes #16 #23
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,19 @@ COPY dist/buildagent /opt/buildagent | |
RUN useradd -m buildagent && \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @stayclassychicago @yaegor user There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alternatively, we can create There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not think either is necessary for this minimal agent image. The teamcity-docker-agent provisions both:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree, I missed that |
||
chmod +x /run-agent.sh /run-services.sh && sync | ||
|
||
ENV GOSU_VERSION 1.10 | ||
RUN set -x \ | ||
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \ | ||
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \ | ||
&& export GNUPGHOME="$(mktemp -d)" \ | ||
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this step still work for you? This fails with keyserver communications error (below). Not sure if this is a regional issue (if so are there mirrors for this keyserver) or if you are able to validate this is still successful ?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it does for me, let me check if ubuntu apt key servers have this key. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cold you please check if following works for you:
It is weird, that it can't connect; keyserver.ubuntu.com is part of sks pool as well. |
||
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \ | ||
&& rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \ | ||
&& chmod +x /usr/local/bin/gosu \ | ||
&& gosu nobody true | ||
|
||
RUN chown -R buildagent:buildagent /opt/buildagent | ||
|
||
CMD ["/run-services.sh"] | ||
|
||
EXPOSE 9090 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider chown for
buildagent
user during 'initialization' (in addition to the Dockerfile), either:A) in this entrypoint
B) As an entry in /services/
Otherwise this may break for users of
jetbrains/teamcity-agent
which run "Docker from the host". The permissions need to be set at container 'runtime' since the checkout dir and temp dir are bind-mount VOLUMEs; as explained here: https://hub.docker.com/r/jetbrains/teamcity-agent/There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stayclassychicago done