-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: add support to build image from docker file #69
base: master
Are you sure you want to change the base?
feat: add support to build image from docker file #69
Conversation
1d1ff51
to
daa3b15
Compare
This commit introduces the ability to build images directly from a Dockerfile, enhancing the build process for containerized applications. Changelog: Added support for building images from Dockerfiles. Ticket: MEN-7539 Signed-off-by: dineshkumar-j-genea <[email protected]>
d0888cd
to
13993b2
Compare
@dineshkumar-j-genea thank you very much for this long-awaited feature. I find it very useful, and you have no idea how many times I wanted it.
|
3fd1f5e
to
d51cd04
Compare
@merlin-northern I have fixed the failing test cases. can you review the changes once |
d51cd04
to
1760100
Compare
thank you very much. I would like to have my colleague Lluís opinion here as well. |
This will modify the - pull images passed as args - image_not_present test case updated - ci config to install the yq package before testing - update the test script to use debian version instead of the alpine version due to the platform conflict. Signed-off-by: Dineshkumar J <[email protected]>
1760100
to
a9b3515
Compare
Merging these commits will result in the following changelog entries: Changelogsapp-update-module (feature/build-with-dockerfile)New changes in app-update-module since master: Features
|
@lluiscampos Did you get the chance to review this PR Request? |
@lluiscampos just following up on here. Can you take a look? |
there was a small re-assignment: I will take a look at it, this week for sure. sorry for the delay. |
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.
sorry for not being clear on this one: we need a separate and new test scenario for this. let me know if you want me to write one.
--application-name myapp0a # we expect a failure here now as we are using docker-compose to pull the images now | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "images_not_present: app-gen artifact generation failed which is expected" | ||
return 0 | ||
else | ||
echo "Unexpected success, we were expecting failure" | ||
return 1 | ||
fi | ||
# echo "images_not_present: checking install rc" | ||
# mender install "$artifact_file" && return 2 # we expect a failure | ||
# echo "images_not_present: checking for running containers" | ||
# docker ps -q | grep -q . && return 3 # and we expect nothing to be running | ||
# return 0 |
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.
we probably should not modify the existing tests, why do we need to do it?
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.
in this test case, if you closely observe the existing flow, you will that we used image tag to pull image and then mender install it uses the docker compose to validate the image and expected a failure, as the image argument and docker compose totally defined with different image name.
but right now, as per the requirement we are using the docker-compose also to pull an image, which means image argument is essentially becomes the optional one.
with that, during the artifact generation itself, the script will throw an error in the new logic.
# echo "images_not_present: checking install rc" | ||
# mender install "$artifact_file" && return 2 # we expect a failure | ||
# sleep $timeout_s | ||
# echo "images_not_present: checking for running containers" | ||
# docker ps | ||
# diff "${temp_dir}/before-rollback-$$" <(docker ps --format '{{.Image}}') | ||
# return 0 |
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.
there is a bit of commented out code in this pull request, could you clean that?
@merlin-northern I am right now occupied with something else. it will be better, if you can take care of test case. but in my opinion, there is no specific test case required, as all the existing test cases are actually verifying the new changes. |
Description
Currently app-gen script has a limitation that only supports pulling images specified in the Compose file using docker pull, but it does not support building images locally using the build option with a Dockerfile.
It would be highly beneficial to have a feature that allows building Docker images locally during Artifact creation with the app-gen script. This would enable the user to define build instructions in the docker-compose.yml file, build the image on their local system, and then include that image in the Artifact for deployment. This approach would enhance flexibility and accommodate scenarios where local image building is necessary, such as incorporating local changes or when access to external registries is restricted.
Example of the current docker-compose.yml structure:
This feature request comes from https://hub.mender.io/t/support-for-local-docker-image-builds-and-rollback-using-stored-images/7157
Mender Atlassian Ticket: