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

Fix #34 - Windows based docker images for maven (jdk8 and jdk11 supported) #119

Closed
wants to merge 16 commits into from

Conversation

slide
Copy link
Contributor

@slide slide commented Aug 7, 2019

Add Windows images for everything but slim and IBM JDK

Add Windows images for everything but slim and IBM JDK
@carlossg
Copy link
Owner

carlossg commented Aug 7, 2019

awesome! waiting for some feedback

@slide
Copy link
Contributor Author

slide commented Aug 8, 2019

Let the know if there is anything I need to address

@slide
Copy link
Contributor Author

slide commented Aug 15, 2019

Is there some specific feedback you are looking for that I might be able to speed up? :-D

@jglick
Copy link
Contributor

jglick commented Aug 23, 2019

Should give this a more descriptive title.

@jglick
Copy link
Contributor

jglick commented Aug 23, 2019

Also see INFRA-1400.

@slide slide changed the title Fix #34 Fix #34 - Windows based docker images for maven (jdk8 and jdk11 supported) Aug 23, 2019
@@ -0,0 +1,46 @@
# escape=`
Copy link
Contributor

Choose a reason for hiding this comment

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

For lack of highlighting, see github-linguist/linguist#4566 (comment).

slide and others added 3 commits August 23, 2019 12:58
Co-Authored-By: Jesse Glick <[email protected]>
Co-Authored-By: Jesse Glick <[email protected]>
Add powershell to syntax highlighting
Copy link
Contributor

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Mostly over my head, but if it works, we should do it!

How do releases of this normally get pushed to Hub? Is there some deployment environment that needs to be modified to support Windows?

@@ -0,0 +1,46 @@
# escape=`
ARG WINDOWS_DOCKER_TAG=ltsc2019
Copy link
Contributor

Choose a reason for hiding this comment

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

TIL

Expand-Archive -Path ${env:TEMP}/apache-maven.zip -Destination C:/ProgramData ; `
Move-Item C:/ProgramData/apache-maven-${env:MAVEN_VERSION} C:/ProgramData/Maven ; `
New-Item -ItemType Directory -Path C:/ProgramData/Maven/Reference | Out-Null ; `
Remove-Item ${env:TEMP}/apache-maven.zip
Copy link
Contributor

Choose a reason for hiding this comment

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

Yow, a lot of duplicated content between images. Is there a straightforward way to share some of these steps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I agree. I am not a super user with docker, so I am not aware of any tricks for sharing content. I based my implementation on the existing image setup.

# So the initial ~/.m2 is set with expected content.
# Don't override, as this is just a reference setup

function Copy-ReferenceFiles() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, we should not have a dozen copies of the same script.

Perhaps it would be better to refactor the repository layout to use a flat structure, so that any Dockerfile.* could freely COPY any resource file (perhaps just a temporary script to RUN and delete).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the mvn-entrypoint.sh is copied across the various image directories as well, this is because Docker doesn't support COPY from outside the current directory (and children) into the image. I'm sure there could be some refactoring to take that into account, but I didn't want to make that part of this changset.

Copy link
Contributor

@jglick jglick Aug 23, 2019

Choose a reason for hiding this comment

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

Cleaning up an existing situation is indeed something that should be deferred to a separate PR. I mentioned this here because this PR introduces a lot of duplication.

Perhaps we could start by introducing a single directory with all the Windows images, and leave the Linux images untouched for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm definitely open to that method if that is desired. I'd also like to know if that would work for @carlossg to have that method.

@slide
Copy link
Contributor Author

slide commented Aug 23, 2019

I have put a refactor of the structure into a branch so that folks can look at it. If it looks ok, I will open a new PR with those changes to reduce the commit history for the PR.

https://github.com/slide/docker-maven/tree/structure-refactor

This moves all the windows builds into a windows directory with Dockerfile.windows-. It also moves the settings-docker.xml and mvn-entrypoint.ps1 into that directory so only one copy of each of those files is in the repo.

@carlossg
Copy link
Owner

It used to be that the official build could not build a file other than Dockerfile but looking at adoptopenjdk looks like that has changed

https://github.com/docker-library/official-images/blob/master/library/adoptopenjdk#L19

The generate-stackbrew-library.sh needs to be modified to output the windows entries and I guess the Constraints too
The file generated goes in https://github.com/docker-library/official-images/blob/master/library/maven

@slide
Copy link
Contributor Author

slide commented Aug 26, 2019

Is this repo using builds on docker hub for releases? This will be something to overcome since docker hub builds don't support Windows.

@carlossg
Copy link
Owner

Yes this is the official dockerhub image built by docker inc

@slide
Copy link
Contributor Author

slide commented Oct 24, 2019

I'm going to close this out for now until I can determine a way to build and publish the Windows images since Dockerhub builds does not support Windows.

@slide slide closed this Oct 24, 2019
@slide slide mentioned this pull request Oct 24, 2019
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

Successfully merging this pull request may close these issues.

3 participants