-
Notifications
You must be signed in to change notification settings - Fork 17
Add 'Dockerfile' #43
base: master
Are you sure you want to change the base?
Add 'Dockerfile' #43
Conversation
Match version being built in pom.xml.
Update install.sh
@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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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.
@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. |
@ribeaud odd! Send it to jhesse at sonatype dot com, I'll get it forwarded to the right people. Great work PS! |
This pull request makes the following changes:
README
file.It relates to the following issue: