config.xml is overwritten on first start of docker container

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

config.xml is overwritten on first start of docker container

Stefan Rademacher
Hi there,

I am currently working on a Docker image, that is derived from jenkins:alpine.
In my Dockerfile I copy a config.xml in the the reference content directory (/usr/share/jenkins/ref) and add some xml content with Ansible-XML. (The content added, is a cloud configuration for a Docker host)

After starting my container, I can see my config.xml in /var/jenkins_home for a couple of seconds.
After that, it is overwritten with a default config.xml. This seems to happen, some time during the start of the server. The problem cannot even be solved by using the filename config.xml.override, as suggested in the docs of the official docker image.

Weirdly, I can’t reproduce this error, when I start Jenkins without docker. In that case, my custom config.xml is kept as is on the first start of Jenkins.

In Jenkins.java (https://github.com/jenkinsci/jenkins/blob/3e2e01717976a1f1221874bfd576429c5c48b8a6/core/src/main/java/jenkins/model/Jenkins.java#L3015) I can’t find anything, that explains the overwriting of my config.xml.

Does anyone have an idea, why this happens?

Thanks and best regards
Stefan Rademacher

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/3CA43885-85DD-4530-9FC8-9F2465F949FD%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

About the Publish Over CIFS Plugin Issues

Wang Jianbao
Hi,
     I’m trying use the Publish Over CIFS Plugin to upload my android artifacts to remote shared folder,
but It is so slow that I almost cost 10min to upload 20KB data. What can I do to improve the speed?
 
Thanks a lot.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/92660B94-3E3F-4349-B57B-687FFC7F700E%40qq.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: config.xml is overwritten on first start of docker container

Mark Waite-2
In reply to this post by Stefan Rademacher
Since you're adding the configuration in your Dockerfile, it should be there when the docker image is created.  Since you can see it for the first few seconds in the running image, I think that means the jenkins.sh startup process which copies from "ref" to "/var/jenkins_home" did what it was expected to do (though there is a risk you're seeing it before jenkins.sh copies in the file from ref/config.xml).

Since a change is happening after jenkins.sh has copied the ref content into the runtime location, I assume it must be something other than the jenkins.sh startup process which is replacing your modified ref/config.xml file with a different config.xml file.  However, I don't know of anything after that which could make that type of change.

Are you entirely sure that the modified file is in the /var/jenkins_home directory even after the jenkins.sh script has run?

I regularly use a modified config.xml to configure a Jenkins Docker instance, and it has worked quite well for me.  If you'd like to compare how mine is configured, you could look at https://github.com/MarkEWaite/docker/blob/lts-with-plugins/ref/config.xml .

Thanks,
Mark Waite

On Mon, Dec 19, 2016 at 12:27 AM Stefan Rademacher <[hidden email]> wrote:
Hi there,

I am currently working on a Docker image, that is derived from jenkins:alpine.
In my Dockerfile I copy a config.xml in the the reference content directory (/usr/share/jenkins/ref) and add some xml content with Ansible-XML. (The content added, is a cloud configuration for a Docker host)

After starting my container, I can see my config.xml in /var/jenkins_home for a couple of seconds.
After that, it is overwritten with a default config.xml. This seems to happen, some time during the start of the server. The problem cannot even be solved by using the filename config.xml.override, as suggested in the docs of the official docker image.

Weirdly, I can’t reproduce this error, when I start Jenkins without docker. In that case, my custom config.xml is kept as is on the first start of Jenkins.

In Jenkins.java (https://github.com/jenkinsci/jenkins/blob/3e2e01717976a1f1221874bfd576429c5c48b8a6/core/src/main/java/jenkins/model/Jenkins.java#L3015) I can’t find anything, that explains the overwriting of my config.xml.

Does anyone have an idea, why this happens?

Thanks and best regards
Stefan Rademacher

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/3CA43885-85DD-4530-9FC8-9F2465F949FD%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtHi4pa7sHqPBZOam1DHsjacb2GLYpPE5kGmuq9nGOwu6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: config.xml is overwritten on first start of docker container

Stefan Rademacher-2
Thanks for your reply. I tried to narrow things down:

A simple Dockerfile, that only copies "my" config.xml to /usr/share/jenkins/ref/ works fine. The config.xml is kept unmodified as expected.
(The only thing, that is different between "my" config.xml and a default config.xml is the line <disableSignup>false</disableSignup>, which is true by default.)
FROM jenkins:alpine
COPY config
.xml /usr/share/jenkins/ref/
See https://github.com/sradi/jenkins-provisioning-problem/tree/5eea71d967cba618884aafb2b74245f75d0900e8

Adding some scripts to init.groovy.d (change number of executors and create a default user 'admin')... Still everything works as expected.
See https://github.com/sradi/jenkins-provisioning-problem/tree/12a431ccac229b3d24f5404e0aedc7d02810a8b1

Additionally run 'install-plugins.sh'... PROBLEM OCCURS: The config.xml is unexpectedly modified (disableSignup is reset to 'true').

FROM jenkins:alpine
RUN
/usr/local/bin/install-plugins.sh matrix-auth
COPY init
.groovy.d/* /usr/share/jenkins/ref/init.groovy.d/
COPY config.xml /usr/share/jenkins/ref/
See https://github.com/sradi/jenkins-provisioning-problem/tree/e073854ecd0e017d53f804c45a971399080efb46

When I only keep the plugin installation in my Dockerfile and remove any init script, the problem again, does NOT occur.
See https://github.com/sradi/jenkins-provisioning-problem/tree/d1a8b5a70016701db2559804896a77921b67ab17

Summary: As soon as I use an init script, that e. g. changes my numer of executors AND use install-plugins.sh in my Dockerfile, the problem occurs.

The problem can be reproduced, if you checkout the different commits of the repository, mentioned above, and run the following commands:
docker build --rm -t jenkinsproblem:latest .
docker run
-p 8080:8080 -p 50000:50000 -d --name jenkinsproblem_1 jenkinsproblem
# run this several times, until you see, that numExecutors is changed to '0'. If 'disableSignup' changed from 'false' to 'true' the problem is reproduced.
docker
exec jenkinsproblem_1 cat /var/jenkins_home/config.xml

Hope, anyone can help me. Is this a bug?

Thanks a lot and best regards
Stefan



Am Montag, 19. Dezember 2016 17:59:21 UTC+1 schrieb Mark Waite:
Since you're adding the configuration in your Dockerfile, it should be there when the docker image is created.  Since you can see it for the first few seconds in the running image, I think that means the jenkins.sh startup process which copies from "ref" to "/var/jenkins_home" did what it was expected to do (though there is a risk you're seeing it before jenkins.sh copies in the file from ref/config.xml).

Since a change is happening after jenkins.sh has copied the ref content into the runtime location, I assume it must be something other than the jenkins.sh startup process which is replacing your modified ref/config.xml file with a different config.xml file.  However, I don't know of anything after that which could make that type of change.

Are you entirely sure that the modified file is in the /var/jenkins_home directory even after the jenkins.sh script has run?

I regularly use a modified config.xml to configure a Jenkins Docker instance, and it has worked quite well for me.  If you'd like to compare how mine is configured, you could look at <a href="https://github.com/MarkEWaite/docker/blob/lts-with-plugins/ref/config.xml" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FMarkEWaite%2Fdocker%2Fblob%2Flts-with-plugins%2Fref%2Fconfig.xml\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG1l1XM3-c7Ia_gjzZmp_fJvx6JUw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FMarkEWaite%2Fdocker%2Fblob%2Flts-with-plugins%2Fref%2Fconfig.xml\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG1l1XM3-c7Ia_gjzZmp_fJvx6JUw&#39;;return true;">https://github.com/MarkEWaite/docker/blob/lts-with-plugins/ref/config.xml .

Thanks,
Mark Waite

On Mon, Dec 19, 2016 at 12:27 AM Stefan Rademacher <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="9gw6iSNEAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">radema...@...> wrote:
Hi there,

I am currently working on a Docker image, that is derived from jenkins:alpine.
In my Dockerfile I copy a config.xml in the the reference content directory (/usr/share/jenkins/ref) and add some xml content with Ansible-XML. (The content added, is a cloud configuration for a Docker host)

After starting my container, I can see my config.xml in /var/jenkins_home for a couple of seconds.
After that, it is overwritten with a default config.xml. This seems to happen, some time during the start of the server. The problem cannot even be solved by using the filename config.xml.override, as suggested in the docs of the official docker image.

Weirdly, I can’t reproduce this error, when I start Jenkins without docker. In that case, my custom config.xml is kept as is on the first start of Jenkins.

In Jenkins.java (<a href="https://github.com/jenkinsci/jenkins/blob/3e2e01717976a1f1221874bfd576429c5c48b8a6/core/src/main/java/jenkins/model/Jenkins.java#L3015" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fjenkins%2Fblob%2F3e2e01717976a1f1221874bfd576429c5c48b8a6%2Fcore%2Fsrc%2Fmain%2Fjava%2Fjenkins%2Fmodel%2FJenkins.java%23L3015\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEVhWcJLzMRPGhO7ZC08Q9_aEH7Ng&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fjenkins%2Fblob%2F3e2e01717976a1f1221874bfd576429c5c48b8a6%2Fcore%2Fsrc%2Fmain%2Fjava%2Fjenkins%2Fmodel%2FJenkins.java%23L3015\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEVhWcJLzMRPGhO7ZC08Q9_aEH7Ng&#39;;return true;">https://github.com/jenkinsci/jenkins/blob/3e2e01717976a1f1221874bfd576429c5c48b8a6/core/src/main/java/jenkins/model/Jenkins.java#L3015) I can’t find anything, that explains the overwriting of my config.xml.

Does anyone have an idea, why this happens?

Thanks and best regards
Stefan Rademacher

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="9gw6iSNEAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/3CA43885-85DD-4530-9FC8-9F2465F949FD%40gmail.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/3CA43885-85DD-4530-9FC8-9F2465F949FD%40gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/3CA43885-85DD-4530-9FC8-9F2465F949FD%40gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/3CA43885-85DD-4530-9FC8-9F2465F949FD%40gmail.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/8027cc17-e759-498f-acf8-4bb512d92851%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: config.xml is overwritten on first start of docker container

Mark Waite-2
That description seems like a bug to me, though I can't see anything in the Docker scripts that helps me understand where the problem would be.  If I understand your description correctly, you need both the init.groovy.d scripts and the install-plugins.sh call before you see the problem.  The groovy scripts seem to be making standard calls to load and save configuration, and the install-plugins.sh script doesn't seem to make any changes to the root config.xml file.

I believe the https://github.com/jenkinsci/docker repository has a place for bug reports.  You probably want to submit a detailed description there, in hopes one of the maintainers is able to help.

Mark Waite

On Wed, Dec 28, 2016 at 8:39 AM Stefan Rademacher <[hidden email]> wrote:
Thanks for your reply. I tried to narrow things down:

A simple Dockerfile, that only copies "my" config.xml to /usr/share/jenkins/ref/ works fine. The config.xml is kept unmodified as expected.
(The only thing, that is different between "my" config.xml and a default config.xml is the line <disableSignup>false</disableSignup>, which is true by default.)
FROM jenkins:alpine
COPY config
.xml /usr/share/jenkins/ref/
See https://github.com/sradi/jenkins-provisioning-problem/tree/5eea71d967cba618884aafb2b74245f75d0900e8

Adding some scripts to init.groovy.d (change number of executors and create a default user 'admin')... Still everything works as expected.
See https://github.com/sradi/jenkins-provisioning-problem/tree/12a431ccac229b3d24f5404e0aedc7d02810a8b1

Additionally run 'install-plugins.sh'... PROBLEM OCCURS: The config.xml is unexpectedly modified (disableSignup is reset to 'true').

FROM jenkins:alpine
RUN
/usr/local/bin/install-plugins.sh matrix-auth
COPY init
.groovy.d/* /usr/share/jenkins/ref/init.groovy.d/
COPY config.xml /usr/share/jenkins/ref/
See https://github.com/sradi/jenkins-provisioning-problem/tree/e073854ecd0e017d53f804c45a971399080efb46

When I only keep the plugin installation in my Dockerfile and remove any init script, the problem again, does NOT occur.
See https://github.com/sradi/jenkins-provisioning-problem/tree/d1a8b5a70016701db2559804896a77921b67ab17

Summary: As soon as I use an init script, that e. g. changes my numer of executors AND use install-plugins.sh in my Dockerfile, the problem occurs.

The problem can be reproduced, if you checkout the different commits of the repository, mentioned above, and run the following commands:
docker build --rm -t jenkinsproblem:latest .
docker run
-p 8080:8080 -p 50000:50000 -d --name jenkinsproblem_1 jenkinsproblem
# run this several times, until you see, that numExecutors is changed to '0'. If 'disableSignup' changed from 'false' to 'true' the problem is reproduced.
docker
exec jenkinsproblem_1 cat /var/jenkins_home/config.xml

Hope, anyone can help me. Is this a bug?

Thanks a lot and best regards
Stefan



Am Montag, 19. Dezember 2016 17:59:21 UTC+1 schrieb Mark Waite:
Since you're adding the configuration in your Dockerfile, it should be there when the docker image is created.  Since you can see it for the first few seconds in the running image, I think that means the jenkins.sh startup process which copies from "ref" to "/var/jenkins_home" did what it was expected to do (though there is a risk you're seeing it before jenkins.sh copies in the file from ref/config.xml).

Since a change is happening after jenkins.sh has copied the ref content into the runtime location, I assume it must be something other than the jenkins.sh startup process which is replacing your modified ref/config.xml file with a different config.xml file.  However, I don't know of anything after that which could make that type of change.

Are you entirely sure that the modified file is in the /var/jenkins_home directory even after the jenkins.sh script has run?

I regularly use a modified config.xml to configure a Jenkins Docker instance, and it has worked quite well for me.  If you'd like to compare how mine is configured, you could look at https://github.com/MarkEWaite/docker/blob/lts-with-plugins/ref/config.xml .

Thanks,
Mark Waite

On Mon, Dec 19, 2016 at 12:27 AM Stefan Rademacher <[hidden email]> wrote:
Hi there,

I am currently working on a Docker image, that is derived from jenkins:alpine.
In my Dockerfile I copy a config.xml in the the reference content directory (/usr/share/jenkins/ref) and add some xml content with Ansible-XML. (The content added, is a cloud configuration for a Docker host)

After starting my container, I can see my config.xml in /var/jenkins_home for a couple of seconds.
After that, it is overwritten with a default config.xml. This seems to happen, some time during the start of the server. The problem cannot even be solved by using the filename config.xml.override, as suggested in the docs of the official docker image.

Weirdly, I can’t reproduce this error, when I start Jenkins without docker. In that case, my custom config.xml is kept as is on the first start of Jenkins.

In Jenkins.java (https://github.com/jenkinsci/jenkins/blob/3e2e01717976a1f1221874bfd576429c5c48b8a6/core/src/main/java/jenkins/model/Jenkins.java#L3015) I can’t find anything, that explains the overwriting of my config.xml.

Does anyone have an idea, why this happens?

Thanks and best regards
Stefan Rademacher

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/8027cc17-e759-498f-acf8-4bb512d92851%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtFmi9ERf1%2Bj8-hZw0%3DT33ZdfOQswx%3DvB6R7n_d4p-fTEA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: config.xml is overwritten on first start of docker container

Jose Gerardo Pineda Galindo
I think I am late by a year jeje. But I ran into the same problem. Later I realized the config.xml was overwritten because I had other 2 groovy scripts that created a new user, then when running the container I saw those groovy scripts being executed and the config.xml file was generated, overwritting the one I copied to jenkins. So just to be sure check that you don't have a groovy script that generates security settings for the user.

Best regards,

On Wednesday, December 28, 2016 at 3:48:45 PM UTC-6, Mark Waite wrote:
That description seems like a bug to me, though I can't see anything in the Docker scripts that helps me understand where the problem would be.  If I understand your description correctly, you need both the init.groovy.d scripts and the install-plugins.sh call before you see the problem.  The groovy scripts seem to be making standard calls to load and save configuration, and the install-plugins.sh script doesn't seem to make any changes to the root config.xml file.

I believe the <a href="https://github.com/jenkinsci/docker" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fdocker\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHBp-Wg0Dnw5kqg8o__Bs_ANMR2mg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fdocker\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHBp-Wg0Dnw5kqg8o__Bs_ANMR2mg&#39;;return true;">https://github.com/jenkinsci/docker repository has a place for bug reports.  You probably want to submit a detailed description there, in hopes one of the maintainers is able to help.

Mark Waite

On Wed, Dec 28, 2016 at 8:39 AM Stefan Rademacher <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="1JoGcycXAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">sr...@...> wrote:
Thanks for your reply. I tried to narrow things down:

A simple Dockerfile, that only copies "my" config.xml to /usr/share/jenkins/ref/ works fine. The config.xml is kept unmodified as expected.
(The only thing, that is different between "my" config.xml and a default config.xml is the line <disableSignup>false</disableSignup>, which is true by default.)
FROM jenkins:alpine
COPY config
.xml /usr/share/jenkins/ref/
See <a href="https://github.com/sradi/jenkins-provisioning-problem/tree/5eea71d967cba618884aafb2b74245f75d0900e8" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fsradi%2Fjenkins-provisioning-problem%2Ftree%2F5eea71d967cba618884aafb2b74245f75d0900e8\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE_jeoABT14OheG6QhHMLjUI--z6A&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fsradi%2Fjenkins-provisioning-problem%2Ftree%2F5eea71d967cba618884aafb2b74245f75d0900e8\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE_jeoABT14OheG6QhHMLjUI--z6A&#39;;return true;">https://github.com/sradi/jenkins-provisioning-problem/tree/5eea71d967cba618884aafb2b74245f75d0900e8

Adding some scripts to init.groovy.d (change number of executors and create a default user 'admin')... Still everything works as expected.
See <a href="https://github.com/sradi/jenkins-provisioning-problem/tree/12a431ccac229b3d24f5404e0aedc7d02810a8b1" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fsradi%2Fjenkins-provisioning-problem%2Ftree%2F12a431ccac229b3d24f5404e0aedc7d02810a8b1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFVVbHgSX2bphB5CIVgZmV14XeQLA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fsradi%2Fjenkins-provisioning-problem%2Ftree%2F12a431ccac229b3d24f5404e0aedc7d02810a8b1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFVVbHgSX2bphB5CIVgZmV14XeQLA&#39;;return true;">https://github.com/sradi/jenkins-provisioning-problem/tree/12a431ccac229b3d24f5404e0aedc7d02810a8b1

Additionally run 'install-plugins.sh'... PROBLEM OCCURS: The config.xml is unexpectedly modified (disableSignup is reset to 'true').

FROM jenkins:alpine
RUN
/usr/local/bin/install-plugins.sh matrix-auth
COPY init
.groovy.d/* /usr/share/jenkins/ref/init.groovy.d/
COPY config.xml /usr/share/jenkins/ref/
See<a href="https://github.com/sradi/jenkins-provisioning-problem/tree/e073854ecd0e017d53f804c45a971399080efb46" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fsradi%2Fjenkins-provisioning-problem%2Ftree%2Fe073854ecd0e017d53f804c45a971399080efb46\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF3F-X5-AHdgnP_rBfWhSEv54GZrw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fsradi%2Fjenkins-provisioning-problem%2Ftree%2Fe073854ecd0e017d53f804c45a971399080efb46\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF3F-X5-AHdgnP_rBfWhSEv54GZrw&#39;;return true;"> https://github.com/sradi/jenkins-provisioning-problem/tree/e073854ecd0e017d53f804c45a971399080efb46

When I only keep the plugin installation in my Dockerfile and remove any init script, the problem again, does NOT occur.
See <a href="https://github.com/sradi/jenkins-provisioning-problem/tree/d1a8b5a70016701db2559804896a77921b67ab17" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fsradi%2Fjenkins-provisioning-problem%2Ftree%2Fd1a8b5a70016701db2559804896a77921b67ab17\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHvF5B3w9wPF0L42KhrGnbOx3ZR8A&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fsradi%2Fjenkins-provisioning-problem%2Ftree%2Fd1a8b5a70016701db2559804896a77921b67ab17\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHvF5B3w9wPF0L42KhrGnbOx3ZR8A&#39;;return true;">https://github.com/sradi/jenkins-provisioning-problem/tree/d1a8b5a70016701db2559804896a77921b67ab17

Summary: As soon as I use an init script, that e. g. changes my numer of executors AND use install-plugins.sh in my Dockerfile, the problem occurs.

The problem can be reproduced, if you checkout the different commits of the repository, mentioned above, and run the following commands:
docker build --rm -t jenkinsproblem:latest .
docker run
-p 8080:8080 -p 50000:50000 -d --name jenkinsproblem_1 jenkinsproblem
# run this several times, until you see, that numExecutors is changed to '0'. If 'disableSignup' changed from 'false' to 'true' the problem is reproduced.
docker
exec jenkinsproblem_1 cat /var/jenkins_home/config.xml

Hope, anyone can help me. Is this a bug?

Thanks a lot and best regards
Stefan



Am Montag, 19. Dezember 2016 17:59:21 UTC+1 schrieb Mark Waite:
Since you're adding the configuration in your Dockerfile, it should be there when the docker image is created.  Since you can see it for the first few seconds in the running image, I think that means the jenkins.sh startup process which copies from "ref" to "/var/jenkins_home" did what it was expected to do (though there is a risk you're seeing it before jenkins.sh copies in the file from ref/config.xml).

Since a change is happening after jenkins.sh has copied the ref content into the runtime location, I assume it must be something other than the jenkins.sh startup process which is replacing your modified ref/config.xml file with a different config.xml file.  However, I don't know of anything after that which could make that type of change.

Are you entirely sure that the modified file is in the /var/jenkins_home directory even after the jenkins.sh script has run?

I regularly use a modified config.xml to configure a Jenkins Docker instance, and it has worked quite well for me.  If you'd like to compare how mine is configured, you could look at <a href="https://github.com/MarkEWaite/docker/blob/lts-with-plugins/ref/config.xml" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FMarkEWaite%2Fdocker%2Fblob%2Flts-with-plugins%2Fref%2Fconfig.xml\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG1l1XM3-c7Ia_gjzZmp_fJvx6JUw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FMarkEWaite%2Fdocker%2Fblob%2Flts-with-plugins%2Fref%2Fconfig.xml\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG1l1XM3-c7Ia_gjzZmp_fJvx6JUw&#39;;return true;">https://github.com/MarkEWaite/docker/blob/lts-with-plugins/ref/config.xml .

Thanks,
Mark Waite

On Mon, Dec 19, 2016 at 12:27 AM Stefan Rademacher <[hidden email]> wrote:
Hi there,

I am currently working on a Docker image, that is derived from jenkins:alpine.
In my Dockerfile I copy a config.xml in the the reference content directory (/usr/share/jenkins/ref) and add some xml content with Ansible-XML. (The content added, is a cloud configuration for a Docker host)

After starting my container, I can see my config.xml in /var/jenkins_home for a couple of seconds.
After that, it is overwritten with a default config.xml. This seems to happen, some time during the start of the server. The problem cannot even be solved by using the filename config.xml.override, as suggested in the docs of the official docker image.

Weirdly, I can’t reproduce this error, when I start Jenkins without docker. In that case, my custom config.xml is kept as is on the first start of Jenkins.

In Jenkins.java (<a href="https://github.com/jenkinsci/jenkins/blob/3e2e01717976a1f1221874bfd576429c5c48b8a6/core/src/main/java/jenkins/model/Jenkins.java#L3015" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fjenkins%2Fblob%2F3e2e01717976a1f1221874bfd576429c5c48b8a6%2Fcore%2Fsrc%2Fmain%2Fjava%2Fjenkins%2Fmodel%2FJenkins.java%23L3015\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEVhWcJLzMRPGhO7ZC08Q9_aEH7Ng&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fjenkins%2Fblob%2F3e2e01717976a1f1221874bfd576429c5c48b8a6%2Fcore%2Fsrc%2Fmain%2Fjava%2Fjenkins%2Fmodel%2FJenkins.java%23L3015\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEVhWcJLzMRPGhO7ZC08Q9_aEH7Ng&#39;;return true;">https://github.com/jenkinsci/jenkins/blob/3e2e01717976a1f1221874bfd576429c5c48b8a6/core/src/main/java/jenkins/model/Jenkins.java#L3015) I can’t find anything, that explains the overwriting of my config.xml.

Does anyone have an idea, why this happens?

Thanks and best regards
Stefan Rademacher

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/3CA43885-85DD-4530-9FC8-9F2465F949FD%40gmail.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/3CA43885-85DD-4530-9FC8-9F2465F949FD%40gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/3CA43885-85DD-4530-9FC8-9F2465F949FD%40gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/3CA43885-85DD-4530-9FC8-9F2465F949FD%40gmail.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="1JoGcycXAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/8027cc17-e759-498f-acf8-4bb512d92851%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/8027cc17-e759-498f-acf8-4bb512d92851%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/8027cc17-e759-498f-acf8-4bb512d92851%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/8027cc17-e759-498f-acf8-4bb512d92851%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/2ef8f3e3-63b5-443c-8a4e-c2db67388dba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.