Skip to content
This repository was archived by the owner on Nov 20, 2020. It is now read-only.

Add 'Dockerfile' #43

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Add 'Dockerfile' #43

wants to merge 13 commits into from

Conversation

ribeaud
Copy link

@ribeaud ribeaud commented Feb 12, 2018

This pull request makes the following changes:

  • Add a Dockerfile to the project to be able to build an image out of it.
  • Adapt the README file.

It relates to the following issue:

  • Nexus failing to start after nexus-blobstore-s3 installation (#34 - see my comments)

@ataylor284
Copy link
Contributor

@ribeaud can you sign the Sonatype contributor license agreement so we can get this in? There's some information here: https://help.sonatype.com/display/NXRM3/Contributing+Bundles and @DarthHater can answer any questions.

Dockerfile Outdated

# RUN yum -y update && yum install -y python-setuptools && easy_install pip && pip install awscli

USER nexus
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TRIVIAL: Newline at end of file

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

Dockerfile Outdated
${NEXUS_HOME}/system/org/sonatype/nexus/assemblies/nexus-base-feature/*/nexus-base-feature-*-features.xml \
${NEXUS_HOME}/system/org/sonatype/nexus/assemblies/nexus-core-feature/*/nexus-core-feature-*-features.xml

# RUN yum -y update && yum install -y python-setuptools && easy_install pip && pip install awscli
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QUESTION: Why is this commented out?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I more or less copied it from here. I will remove it.

README.md Outdated
Building the Docker image
-------------------------
```
docker build --rm=true --tag=sonatype/nexus-blobstore-s3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: docker build --rm=true -t nexus-blobstore-s3:1.2.1-SNAPSHOT . or something akin. Not sure if you need the sonatype namespace, and it might be good to append a tag of the version or something akin to the end. Also I believe you need the . to indicate use the current context.

Another thing you can do, and I really enjoyed this from @mpoindexter 's apt project, is use Docker to build the project as well, see here.

Copy link
Author

@ribeaud ribeaud Feb 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Docker to build the project makes a lot of sense. By doing so, its removes the implicit dependency to COPY target/nexus-blobstore-s3-${S3_BLOBSTORE_VERSION}.jar.

However, it makes the Docker image building a lot longer, especially if you're editing the Dockerfile. Maven dependencies are re-fetched everytime. In my opinion, this is suboptimal.

Dockerfile Outdated
ARG PROJECT_NAME=nexus-blobstore-s3

COPY . /${PROJECT_NAME}/
RUN cd /${PROJECT_NAME}/; mvn package -DskipTests=true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QUESTION: Why skip tests? I'd assume you would want this to fail if tests fail?

Copy link
Author

@ribeaud ribeaud Feb 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My first idea was trying to gain some building time. In this case, it does not make that much sense considering the number of tests.

As I said, I think we are mixing different concerns here: library building should NOT happen in Docker image building. They should be separate and dependent processes: first tests and library building, then Docker image building. Is that possible to invoke docker from Maven build? Gradle has such a plugin. I do NOT know about Maven.

I did NOT understand the reasons why you appreciate such a scenario but you must have yours.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally it allows someone who doesn't have Maven installed to build the project fairly easily. I think that most people coming to these plugins have some amount of Java experience, but having watched the consumers of our R plugin for example, we get just a fair amount of people who want something that does X. Allowing it to be built in Docker makes it a lil more language agnostic, and uses a fairly popular tool in the DevOps toolchain.

If you don't want to make the change that's fine, twas only a suggestion :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I've removed it... :) Cheers and have a nice evening.

@ribeaud
Copy link
Author

ribeaud commented Feb 15, 2018

@ataylor284 Andrew, I've just failed to send the license agreement to community@sonatype.com. Seems like the email does NOT exist. Any hint? Thanks and cheers, christian.

@DarthHater
Copy link
Member

@ribeaud odd! Send it to jhesse at sonatype dot com, I'll get it forwarded to the right people. Great work PS!

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

Successfully merging this pull request may close these issues.

None yet

7 participants