-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add windows container support, simplify binary generation #6
Add windows container support, simplify binary generation #6
Conversation
Always some little issue. Looks like there is an issue for windows machines (possibly due to antivirus?) that causes an |
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 am trying to figure out how all this fits together. I ran mvn package
on this PR but it did not work:
$ jar tf target/lib-durable-task.jar
META-INF/MANIFEST.MF
META-INF/
META-INF/maven/
META-INF/maven/io.jenkins.plugins/
META-INF/maven/io.jenkins.plugins/lib-durable-task/
META-INF/maven/io.jenkins.plugins/lib-durable-task/pom.xml
META-INF/maven/io.jenkins.plugins/lib-durable-task/pom.properties
I suppose you forgot to package target/src/bin/
? (Which is a really weird name BTW. src
and target
are mutually exclusive in Maven.)
f8ed5c4
to
9194a82
Compare
Windows build claims it passes, but it actually fails do to the same
|
looks like the culprit was golang/go#31481 |
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.
Still producing empty JARs.
@@ -0,0 +1,30 @@ | |||
ARG BASE_DIR=/durabletask |
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.
To get syntax coloring, suggest moving this to e.g. src/docker/linux/Dockerfile
. github-linguist/linguist#4566
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.
So I gave it a whirl and came across the issue of ADD/COPY
requiring the source files to reside in the build context. Don't think this will work for this repo as I am adding the go source files into the image
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.
Yeah, can be worked around by copying the desired Dockerfile
along with other inputs into a temp directory and running docker build -t xxx target/xxx
, but it is more hassle.
VER=$1 | ||
# output directory of binaries | ||
DEST=$2 | ||
docker build --build-arg VERSION=$VER -o $DEST -f Dockerfile.linux . |
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.
docker build --build-arg VERSION=$VER -o $DEST -f Dockerfile.linux . | |
export DOCKER_BUILDKIT=1 | |
docker build --build-arg VERSION=$VER -o $DEST -f Dockerfile.linux . |
?
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.
ahh, was this why you were producing empty jars? Or is this a separate issue?
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.
Set docker buildkit flag in edf248c
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.
https://repo.jenkins-ci.org/incrementals/io/jenkins/plugins/lib-durable-task/1.0-rc34.edf248cdcad1/lib-durable-task-1.0-rc34.edf248cdcad1.jar indeed seems to contain four binaries as expected.
VER=$1 | ||
# output directory of binaries | ||
DEST=$2 | ||
docker build --build-arg VERSION=$VER -o $DEST -f Dockerfile.linux . |
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.
https://repo.jenkins-ci.org/incrementals/io/jenkins/plugins/lib-durable-task/1.0-rc34.edf248cdcad1/lib-durable-task-1.0-rc34.edf248cdcad1.jar indeed seems to contain four binaries as expected.
The goal is to simplify the build (i.e. binary generation) process.
There are now two
Dockerfiles
to represent a build using linux or windows environment. EachDockerfile
has a corresponding build script to exercise their ownDockerfile
properly.The linux container is straightforward, using
docker build --output
(i.e.BuildKit
) and a multistageDockerfile
, we can generate the needed binaries and output them directly totarget/classes
.Unfortunately for windows, there is no
BuildKit
support, yet (see microsoft/Windows-Containers#34). In place, there is a traditional single stageDockerfile
that generates the binaries. We then usedocker create
to add a writeable container layer to extract the binaries totarget/classes
.