Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin is not getting installed using Docker file #315

Closed
rajendrasnagar opened this issue Jun 30, 2022 · 12 comments
Closed

Plugin is not getting installed using Docker file #315

rajendrasnagar opened this issue Jun 30, 2022 · 12 comments
Assignees
Labels
dependencies Pull requests that update a dependency file

Comments

@rajendrasnagar
Copy link

What is the problem?


We are trying to create a Jenkins Image with SGD using Docker file. There is no error in the terminal, however the plugin is not getting installed.

What is the parameter and the value you used with it?

Below is the Docker file used:

FROM jenkins/jenkins:2.263.3
USER root

RUN mkdir /.cache /.sf
RUN chown jenkins.jenkins /.cache -R
RUN chown jenkins.jenkins /.sf -R
RUN chmod 757 /.cache /.sf -R

#WORKDIR /

RUN apt-get update && apt-get install -y git ant xmlstarlet xz-utils

RUN apt-get install -y curl
&& curl -sL https://deb.nodesource.com/setup_14.x | bash -
&& apt-get install -y nodejs
&& curl -L https://www.npmjs.com/install.sh | sh

RUN npm i sfdx-cli --global

RUN echo y | sfdx plugins:install sfdx-git-delta

USER jenkins


What is the expected result?

Plugin should get installed.

What is the actual result?

Plugin is not installed, though there is no error on the terminal.
image

image

Execution context

We are using this docker file on OpenShift platform.

Any help or feedback is appreciated as we are trying to resolve this from past week with no success.

@rajendrasnagar rajendrasnagar added the bug Something isn't working label Jun 30, 2022
@scolladon
Copy link
Owner

Hi @rajendrasnagar !

Thanks for raising this issue.

Do you have the same issue whith other plugins ?

@rajendrasnagar
Copy link
Author

Yes, It seems other plugins are also behaving similarly. There is no error on terminal, but when I run $sfdx plugins command, it says no plugins are there.

@rajendrasnagar
Copy link
Author

This is a section of output while building image. It says that plugin is installed, but lists none.
image

@scolladon
Copy link
Owner

Hum... then it does not seems to be an issue with our plugin...
You should investigate in the docket side, why the plugins are not available after installation there

@scolladon scolladon added dependencies Pull requests that update a dependency file sfdx and removed bug Something isn't working labels Jun 30, 2022
@rajendrasnagar
Copy link
Author

Yes, it seems it is not sgd plugin issues. I think, I should raise it on other platform.

However, before closing, if possible... do you have any working docker image for Jenkins with plugins installation. We have to check if it is OpenShift specific permission issue or not.

@scolladon
Copy link
Owner

I think you can try this one. It is 4 month old, so it does not run the latest version but it may help identify your issue

@rajendrasnagar
Copy link
Author

Thanks @scolladon, it is working as expected. However, it is still not working with Jenkins plugins. I think we need to explore more.

@scolladon
Copy link
Owner

Hi @rajendrasnagar, thanks for the update!

Before closing this issue, could you give more information about what is not working with Jenkins plug-in ?

@rajendrasnagar
Copy link
Author

@scolladon When I tried with the earlier one you mentioned (this one.), i.e. with nodejs base image. It is working as expected.
However, with Jenkins image, we don't see plugins getting installed. Though in the terminal out, while building app from docker, it is mentioned that the plugins are installed. But indeed they are not.

@scolladon
Copy link
Owner

Ok, thanks for the explanations.
I close this issue as it is not relevant to the plug-in itself and a workaround has been found.

If you find the root cause of this issue with Jenkins please explain it here, it will probably be useful to someone else

@gambe94
Copy link

gambe94 commented Aug 8, 2022

@rajendrasnagar
In jenkins I managed it the following way:
I think these sfdx plugins deployed under the current user. In Jenkins has their own jenkins user.

RUN groupadd --gid 1000 jenkins \
   && useradd --uid 1000 --gid jenkins --shell /bin/bash --create-home jenkins
RUN echo 'jenkins ALL=(ALL) NOPASSWD: ALL' | sudo EDITOR='tee -a' visudo

#Switch to jenkins user
USER jenkins
#sfdx plugin goigng to be installed .local directory under the current user
#sfdx plugin need to be installed under the running user!!
#Add sfpowerkit

RUN echo "y" | sfdx plugins:install sfpowerkit
#Add sfdx essentials
RUN echo 'y' | sfdx plugins:install sfdx-essentials
#ADD sfdx-git-delta
RUN echo "y" | sfdx plugins:install sfdx-git-delta

@scolladon
Copy link
Owner

Hi @gambe94

That is very nice finding, thanks for sharing !

I think it would be even more helpful in a Discussion !
Could you create it ? Or would you prefer me to do it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

3 participants