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

Need for new dockerfile - fullstack embedded app agent #5

Closed
autumnfound opened this issue May 31, 2021 · 7 comments
Closed

Need for new dockerfile - fullstack embedded app agent #5

autumnfound opened this issue May 31, 2021 · 7 comments

Comments

@autumnfound
Copy link
Contributor

We need to create a new Dockerfile that allows for builds with the following packages installed:

  • mvn
  • JDK 11
  • Hugo (configurable?)
  • Node (configurable?)
  • Yarn

The configurable parts aren't necessary, just nice to haves as we evolve our build process. We could always create a patch to create a new version of the image to get specific versions in the future.

@autumnfound
Copy link
Contributor Author

Should I take a crack at this? I can base it off of the hugo-node image and add the extra bits that we need to make this run. I don't forsee us compiling native images in the near future so we shouldn't need GraalVM as the Java package.

autumnfound added a commit to autumnfound/dockerfiles that referenced this issue May 31, 2021
autumnfound added a commit to autumnfound/dockerfiles that referenced this issue May 31, 2021
autumnfound added a commit that referenced this issue Jun 4, 2021
Need for new dockerfile - fullstack embedded app agent #5
@autumnfound
Copy link
Contributor Author

Agent mostly works, needs to have the Java home set though, I'll look into it and make a patch

@autumnfound
Copy link
Contributor Author

+ make compile
mvn clean
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
make: *** [Makefile:8: clean] Error 1

I get this message when running my make compile command. Could it be that the Jenkins provided tool Java points to a JRE, and is overriding my local JAVA_HOME? Pretty sure everything was set correctly 🤔

@mbarbero
Copy link
Member

mbarbero commented Jun 4, 2021

which Jenkinsfile? did you try on your laptop with docker run -it --rm .... -- make compile?

@autumnfound
Copy link
Contributor Author

I'm trying this with the react-eclipsefdn-membership jenkinsfile. I tried it just now, as I didn't think of doing that before...ugh.

❯ docker run -it --rm eclipsefdn/stack-agent-test:latest /bin/sh `make compile`
mariadb uses an image, skipping
postgres uses an image, skipping
keycloak uses an image, skipping
nginx-proxy uses an image, skipping
Building www
Building api
/bin/sh: can't open 'mvn': No such file or directory

Getting a different error though.

@mbarbero
Copy link
Member

mbarbero commented Jun 7, 2021

I manage to reproduce locally. Current folder is a fresh clone of https://github.com/EclipseFdn/react-eclipsefdn-members/:

docker run -it --rm  -v "$(pwd):/home/jenkins" -e HOME=/home/jenkins -w /home/jenkins  eclipsefdn/stack-build-agent:latest /bin/sh -c "make compile"
mvn clean
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------< org.eclipsefoundation:react-container >----------------
[INFO] Building react-container 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
....

2 things:

  • in Need for new dockerfile - fullstack embedded app agent #5 (comment), you seem to use eclipsefdn/stack-agent-test rather than eclipsefdn/stack-build-agent. I guess that eclipsefdn/stack-agent-test is a stale image you built locally for testing and that it does not contain maven.
  • Also, for better compatibility with running on the build cluster, it is advised to change the FROM alpine:3.13 of your Dockerfile to FROM eclipsecbi/alpine:3.13 (though it does not change anything in this case).

@autumnfound
Copy link
Contributor Author

We've done a successful build now, so I think we can close this! Thanks for your assistance in getting this going, its much appreciated!!

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

No branches or pull requests

2 participants