我创建了一堆本地部署管道作业,这些作业执行的操作包括删除现有容器,在本地构建服务,构建docker镜像,运行容器等等.这些不是CI / CD作业,只是用于部署的小型管道在开发期间本地
我现在要做的就是让所有开发人员都可以使用它,这样他们就可以简单地启动已经包含作业的jenkins的本地实例.
我的docker文件相当直接……
FROM jenkins:latest
USER root
RUN apt-get update
RUN apt-get install -y sudo
RUN echo "jenkins ALL=NOPASSWD: ALL" >> /etc/sudoers
# Docker
RUN apt-get update
RUN apt-get dist-upgrade -y
RUN apt-get install apt-transport-https ca-certificates -y
RUN sh -c "echo deb https://apt.dockerproject.org/repo debian-jessie main > /etc/apt/sources.list.d/docker.list"
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
RUN apt-get update
RUN apt-cache policy docker-engine
RUN apt-get install docker-engine -y
# .NET Core CLI dependencies
RUN echo "deb [arch=amd64] http://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.6 main" > /etc/apt/sources.list.d/llvm.list
&& wget -q -O - http://llvm.org/apt/llvm-snapshot.gpg.key|apt-key add -
&& apt-get update
&& apt-get install -y --no-install-recommends
clang-3.5
libc6
libcurl3
libgcc1
libicu52
liblldb-3.6
liblttng-ust0
libssl1.0.0
libstdc++6
libtinfo5
libunwind8
libuuid1
zlib1g
&& rm -rf /var/lib/apt/lists/*
#DotNetCore
RUN curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?linkid=847105
RUN mkdir -p /opt/dotnet && tar zxf dotnet.tar.gz -C /opt/dotnet
RUN ln -s /opt/dotnet/dotnet /usr/local/bin
# Minimal Jenkins Plugins
RUN /usr/local/bin/install-plugins.sh git matrix-auth workflow-aggregator docker-workflow blueocean credentials-binding
# Skip initial setup
ENV JAVA_OPTS -Djenkins.install.runSetupWizard=false
COPY LocallyDeployIdentityConfig.xml /var/jenkins_home/jobs/identity/config.xml
USER jenkins
我认为我能做的只是将一个作业配置文件复制到/ jobs / jobname文件夹中,然后就会显示该作业,但这不仅不会出现,而且现在我也无法手动创建作业.我现在得到一个java.io.IOException“没有这样的文件或目录” – 注意当我执行到正在运行的容器时,job和jobname目录存在,我的配置文件在那里.
有任何想法吗?