Skip to content

Commit

Permalink
Ensure folders have appropriate executable bit set
Browse files Browse the repository at this point in the history
Noticed when I did a fresh build on a new computer

We require that all folders that we copy into
containers have the executable bit set, so that
they are accessible to users we create like
"tomcat".

There is no good way to do this, so its become a
part of Makefile build process.
  • Loading branch information
nigelgbanks committed Sep 12, 2024
1 parent b7d358b commit f6193b3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ build:
%:
$(call executable-exists,$@)

# Prior to building all folder which might be copied into Docker images must
# have the executable bit set for all users. So that they can be read by the
# users we create like 'tomcat'. We can not insure this via Git as it does
# not track permissions for folders, so we rely on this hack.
.PHONY: folder-permissions
folder-permissions:
find . -type d -exec chmod +x {} \;

# Checks for docker compose plugin.
.PHONY: docker-compose
docker-compose: MISSING_DOCKER_PLUGIN_MESSAGE = ${RED}docker compose plugin is not installed${RESET}\n${README_MESSAGE}
Expand Down Expand Up @@ -165,7 +173,7 @@ docker-compose.override.yml:
# Despite being a real target we make it PHONY so it is run everytime as $(TARGET) can change.
.PHONY: build/bake.json
.SILENT: build/bake.json
build/bake.json: | docker-buildx jq build
build/bake.json: | docker-buildx jq build folder-permissions
# Generate build plan for the given target and update the contexts if provided by the CI.
BRANCH=$(BRANCH) \
CACHE_FROM_REPOSITORY=$(CACHE_FROM_REPOSITORY) \
Expand Down

0 comments on commit f6193b3

Please sign in to comment.