File Dockerfile of Package gocd-agent-base

# Copyright 2018 ThoughtWorks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

###############################################################################################
# This file is autogenerated by the repository at https://github.com/gocd/docker-gocd-agent.
# Please file any issues or PRs at https://github.com/gocd/docker-gocd-agent
###############################################################################################

#!BuildTag: gocd-agent-base
FROM opensuse/tumbleweed

# force encoding
ENV LANG en_US.UTF-8  
ENV LANGUAGE en_US:en  
ENV LC_ALL en_US.UTF-8

ARG UID=1000
ARG GID=1000

RUN zypper -n install shadow sudo git-core openssh curl glibc-locale-base

RUN \
# add our user and group first to make sure their IDs get assigned consistently,
# regardless of whatever dependencies get added
  groupadd -g ${GID} go && \
  useradd -u ${UID} -g go -d /home/go -m go && \
  mkdir -p /docker-entrypoint.d /go /godata

RUN zypper -n install vim
RUN zypper ar http://download.opensuse.org/repositories/openSUSE:/Tools:/GoCD/openSUSE_Tumbleweed openSUSE:Tools:GoCD
RUN zypper --gpg-auto-import-keys ref
RUN zypper -n install gocd-agent tini 

# the agent can edit its own code - the silly java world
RUN chown -R ${UID}:0 /go-agent && chmod -R g=u /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/

# Verify this exists. Previously it was /tini, when it was moved the container broke.
RUN test -e /usr/sbin/tini

ADD docker-entrypoint.sh /
RUN chmod a+x /docker-entrypoint.sh

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

ENTRYPOINT ["/docker-entrypoint.sh"]

openSUSE Build Service is sponsored by