I am trying to add ssh to my dockerfile and locally the container runs fine. but on jenkins k8s cluster it fails to come up and exits. any hint? error
Defaulted container "main" out of: main, jnlp
exec /sbin/tini: no such file or directory
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
git \
fuse \
openjdk-11-jdk-headless \
ssh
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /sbin/tini
RUN chmod +x /sbin/tini
pod yaml on jenkins is
apiVersion: v1
kind: Pod
spec:
imagePullSecrets:
- name: artifactory-creds
containers:
- name: main
image: artifactory.team/ssh-05ba8e
securityContext:
capabilities:
add:
- SYS_ADMIN
privileged: true
runAsUser: 0
procMount: Default
command:
- /sbin/tini
args:
- --
- sleep
- infinity
jenkinsfile
stages {
stage('Formatting and Style') {
agent {
label 'ssh-pod'
}
when { expression { !params.Refresh } }
steps {
container('main') {
sh 'echo "using image with SSH Agent\n"'
checkoutUtil(
credentialsId: 'git-ssh',
remoteUrl: "$REPO_MIRROR_URL",
branch: 'main'
)
}
/sbin/tini
with sleep and check if you can see it withls
.FROM --platform=linux/amd64 ubuntu:20.04