Skip to content

Commit

Permalink
переопределил entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Segate-ekb committed Nov 23, 2024
1 parent 76c900a commit 4f66881
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
10 changes: 7 additions & 3 deletions k8s-jenkins-agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@ ARG user=jenkins

USER root
COPY ./k8s-jenkins-agent/jenkins-agent /usr/local/bin/jenkins-agent
RUN chmod +x /usr/local/bin/jenkins-agent &&\
ln -s /usr/local/bin/jenkins-agent /usr/local/bin/jenkins-slave
COPY ./k8s-jenkins-agent/docker-entrypoint.sh /docker-entrypoint.sh

RUN chmod +x /usr/local/bin/jenkins-agent \
&& ln -s /usr/local/bin/jenkins-agent /usr/local/bin/jenkins-slave \
&& chmod 755 /docker-entrypoint.sh \
&& chmod +x /docker-entrypoint.sh
# USER ${user}

LABEL \
Expand All @@ -76,4 +80,4 @@ LABEL \
org.opencontainers.image.source="https://github.com/jenkinsci/docker-agent" \
org.opencontainers.image.licenses="MIT"

ENTRYPOINT ["/usr/local/bin/jenkins-agent"]
ENTRYPOINT ["/docker-entrypoint.sh"]
7 changes: 7 additions & 0 deletions k8s-jenkins-agent/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

if [ -f "/init" ]; then
/init &
fi

/usr/local/bin/jenkins-agent "$@"
6 changes: 0 additions & 6 deletions k8s-jenkins-agent/jenkins-agent
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@
# the agent skips connecting to an HTTP(S) port for connection info.
# * JENKINS_PROTOCOLS: Specify the remoting protocols to attempt when instanceIdentity is provided.

############## ВСТАВКА СТАРТА ИКСОВ В СТАНДАРТНЫЙ jenkins-agent ############
if [ -f "/init" ]; then
/init &
fi
############################### Конец вставки ##############################

if [ $# -eq 1 ] && [ "${1#-}" = "$1" ] ; then

# if `docker run` only has one arguments and it is not an option as `-help`, we assume user is running alternate command like `bash` to inspect the image
Expand Down

0 comments on commit 4f66881

Please sign in to comment.