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

p2 support #9

Closed
flefevre opened this issue Jun 1, 2015 · 2 comments
Closed

p2 support #9

flefevre opened this issue Jun 1, 2015 · 2 comments
Labels

Comments

@flefevre
Copy link

flefevre commented Jun 1, 2015

Dear team
at first thanks a lot to share this work!
it is really great.

I would like to know if you could help me to modify your code to add p2 support to your nexus docker instance?
They are two plugins to install

https://books.sonatype.com/nexus-book/reference/p2-sect-intro.html
Nexus P2 Repository Plugin
Nexus P2 Bridge Plugin

Thanks

Francois from France

@jswank
Copy link
Contributor

jswank commented Jun 17, 2015

Hi Francois,

Thanks for the question- and apologies for the delayed response.

There are two primary options to install these plugins (aside from using Nexus Pro, which includes them):

  1. Install the plugins to the data volume used by the container. This approach uses only the runtime environment, i.e. would have to repeated if / when creating a new container from the image. One could use a data container or runtime volume mapping for this.
  2. Create your own Docker image, with these plugins, using sonatype/nexus:oss as the base.

I would suggest option 2 as the most portable, Something like the following would allow you to create your own Nexus OSS image with these two plugins.

$ cat Dockerfile
FROM sonatype/nexus:oss

USER root

RUN yum install -y unzip \
 yum clean all

# install nexus-p2-repository-plugin
RUN curl --fail --silent --location --retry 3 \
    -o /tmp/nexus-p2-repository-plugin-${NEXUS_VERSION}-bundle.zip \
    https://repo1.maven.org/maven2/org/sonatype/nexus/plugins/nexus-p2-repository-plugin/${NEXUS_VERSION}/nexus-p2-repository-plugin-${NEXUS_VERSION}-bundle.zip \
  && unzip -d /opt/sonatype/nexus/nexus/WEB-INF/plugin-repository \
    /tmp/nexus-p2-repository-plugin-${NEXUS_VERSION}-bundle.zip \
  && find /opt/sonatype/nexus/nexus/WEB-INF/plugin-repository/nexus-p2-repository-plugin-${NEXUS_VERSION} \
    -type d -exec chmod 755 {} \; \
  && find /opt/sonatype/nexus/nexus/WEB-INF/plugin-repository/nexus-p2-repository-plugin-${NEXUS_VERSION} \
    -type f -exec chmod 644 {} \; \
  && rm /tmp/nexus-p2-repository-plugin-${NEXUS_VERSION}-bundle.zip

# install nexus-p2-bridge-plugin
RUN curl --fail --silent --location --retry 3 \
    -o /tmp/nexus-p2-bridge-plugin-${NEXUS_VERSION}-bundle.zip \
    https://repo1.maven.org/maven2/org/sonatype/nexus/plugins/nexus-p2-bridge-plugin/${NEXUS_VERSION}/nexus-p2-bridge-plugin-${NEXUS_VERSION}-bundle.zip \
  && unzip -d /opt/sonatype/nexus/nexus/WEB-INF/plugin-repository \
    /tmp/nexus-p2-bridge-plugin-${NEXUS_VERSION}-bundle.zip \
  && find /opt/sonatype/nexus/nexus/WEB-INF/plugin-repository/nexus-p2-bridge-plugin-${NEXUS_VERSION} \
    -type d -exec chmod 755 {} \; \
  && find /opt/sonatype/nexus/nexus/WEB-INF/plugin-repository/nexus-p2-bridge-plugin-${NEXUS_VERSION} \
    -type f -exec chmod 644 {} \; \
  && rm /tmp/nexus-p2-bridge-plugin-${NEXUS_VERSION}-bundle.zip

USER nexus

$ docker build --tag flefevre/nexus .

$ docker run -d -p 8081:8081 --name nexus flefevre/nexus

@gbatalski
Copy link

Since ARG NEXUS_VERSION introduced, it is not being propagated to the extending Dockerfile. One should define ARG NEXUS_VERSION=2.14.2-01 to get the solution working. Is there a better way to propagate the ARG from parent?

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

No branches or pull requests

3 participants