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

nexus docker container in ecs #41

Open
karthigab opened this issue Jan 14, 2025 · 3 comments
Open

nexus docker container in ecs #41

karthigab opened this issue Jan 14, 2025 · 3 comments

Comments

@karthigab
Copy link

Hi,
I'm new to configuring nexus. I have a nexus server (docker container) hosted in ecs AWS. I tried to use the above patch by copying it to my docker container and creating a seperate docker image. I'm not sure if im doing it right. could you pls correct me?

@a-langer
Copy link
Owner

Hi, see #35 (comment).

@karthigab
Copy link
Author

karthigab commented Jan 22, 2025

Hi, I followed the #35 and did the following changes,

  • Modified the docker file as mentioned. since i needed only sso. (Added nexus-pac4j-plugin.jar and edit startup.properties -> copied all of nexus-pac4j-plugin dir built it in local and moved to my working directory where the docker file is)
  • Added sso configs and followed the documentation in saml and tokens.
  • Added metadata.xml, modified shirio.ini and the rest of the files mentioned in SAML.MD
  • created my own docker file

FROM sonatype/nexus3:3.70.1-java11-ubi
USER root

RUN rm -rf /opt/sonatype/nexus/system/com/github/alanger/nexus/plugin/nexus-pac4j-plugin/
COPY nexus-pac4j-plugin/target/nexus-pac4j-plugin-*.jar /opt/sonatype/nexus/system/com/github/alanger/nexus/plugin/nexus-pac4j-plugin/3.70.1-02/nexus-pac4j-plugin-3.70.1-02.jar
RUN chmod -R 644 /opt/sonatype/nexus/system/com/github/alanger/nexus/plugin/nexus-pac4j-plugin/3.70.1-02/nexus-pac4j-plugin-3.70.1-02.jar &&
echo "reference:file:com/github/alanger/nexus/plugin/nexus-pac4j-plugin/3.70.1-02/nexus-pac4j-plugin-3.70.1-02.jar = 200" >> /opt/sonatype/nexus/etc/karaf/startup.properties

RUN rm -rf /opt/sonatype/nexus/system/org/sonatype/nexus/nexus-repository-services/
COPY nexus-repository-services/target/nexus-repository-services-*.jar /opt/sonatype/nexus/system/org/sonatype/nexus/nexus-repository-services/3.70.1-02/nexus-repository-services-3.70.1-02.jar
RUN chmod -R 644 /opt/sonatype/nexus/system/org/sonatype/nexus/nexus-repository-services/3.70.1-02/nexus-repository-services-3.70.1-02.jar

COPY etc/nexus-default.properties /opt/sonatype/nexus/etc/nexus-default.properties
COPY etc/jetty/nexus-web.xml /opt/sonatype/nexus/etc/jetty/nexus-web.xml
COPY etc/jetty/jetty-sso.xml /opt/sonatype/nexus/etc/jetty/jetty-sso.xml
COPY etc/h2db/.h2.server.properties /opt/sonatype/nexus/etc/h2db/.h2.server.properties
COPY nexus-pac4j-plugin/src/main/config/ /opt/sonatype/nexus/etc/sso/config/
COPY nexus-pac4j-plugin/src/main/groovy/ /opt/sonatype/nexus/etc/sso/script/
RUN chown nexus:nexus -R /opt/sonatype/nexus/etc/sso/

ENV INSTALL4J_ADD_VM_PARAMS="-Xms512m -Xmx2048m -Djava.util.prefs.userRoot=/nexus-data/javaprefs"

RUN chown nexus:nexus -R /opt/sonatype/nexus
USER nexus

  • Also added the .env and dockercompose.yaml as suggested. but im still not able to view the sso/saml realm i dont know where i am making an error.? is that the docker file?

@a-langer
Copy link
Owner

Why are you not satisfied with the finished Docker image ghcr.io/a-langer/nexus-sso:3.70.1-java11-ubi (see Packages) ? I can't diagnose your build, so I only support my Docker image. You can download this image and upload it to your ecs AWS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants