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

Issue with conditional in Makefile #1678

Closed
tghosth opened this issue Jul 6, 2023 · 6 comments
Closed

Issue with conditional in Makefile #1678

tghosth opened this issue Jul 6, 2023 · 6 comments
Assignees
Labels
MAKEFILE _5.0 - Not blocker This issue does not block 5.0 so if it gets addressed then great, if not then fine.

Comments

@tghosth
Copy link
Collaborator

tghosth commented Jul 6, 2023

Hi @ike,

I was experimenting with running make docker and then make all separately.

My understanding is that make docker will just create the docker image and load it into the local docker image.

Looking at the following code...

.PHONY: docker
docker:
	if ! docker image inspect asvs/documentbuilder:latest --format="checking docker image" &> /dev/null; then \
		docker build --build-arg CERT_FILE=docker/cert --tag asvs/documentbuilder:latest --network host docker; \
	fi;

...my understanding is that if I have already run make docker and then I run make all, then this if statement will get run again but since the image now exists, the docker build command should not get run.

However, it looks to me like the docker build command does in fact get run regardless of the output of docker image inspect.

Are you able to fix this?

@tghosth tghosth added MAKEFILE _5.0 - Not blocker This issue does not block 5.0 so if it gets addressed then great, if not then fine. labels Jul 6, 2023
@tghosth
Copy link
Collaborator Author

tghosth commented Jul 6, 2023

This should be fixed before #1638

@ike
Copy link
Collaborator

ike commented Jul 6, 2023

@tghosth yes, I believe the appropriate solution is to put the image on a repository and only pull in the action, instead of building in the action at all.

We could potentially have an action that built and pushed the image if the docker dir changes.

@tghosth
Copy link
Collaborator Author

tghosth commented Jul 6, 2023

happy for however you want to address it but it would be good to get it sorted

@ike
Copy link
Collaborator

ike commented Jul 7, 2023

#1680 removes the docker target from any of the other targets, so this issue should be resolved now. You can still build the docker image using make docker.

@tghosth
Copy link
Collaborator Author

tghosth commented Jul 9, 2023

Ok so this should be resolved as part of issue #1638

@ike
Copy link
Collaborator

ike commented Jul 21, 2023

Fixed with #1680

@tghosth tghosth closed this as completed Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MAKEFILE _5.0 - Not blocker This issue does not block 5.0 so if it gets addressed then great, if not then fine.
Projects
None yet
Development

No branches or pull requests

2 participants