Skip to content

Commit

Permalink
Add optional ALPINE_VERSION arg to docker_build_version_cmd func
Browse files Browse the repository at this point in the history
Use this function and argument to force Alpine 3.10 for python 2.7
builds due to python2 deprecation in Alpine 3.11.
  • Loading branch information
smlx committed Apr 8, 2020
1 parent e74937b commit e083c8f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ docker_build_cmd = docker build $(DOCKER_BUILD_PARAMS) --build-arg LAGOON_VERSIO
# $3: image tag
# $4: Dockerfile path
# $5: docker build context directory
docker_build_version_cmd = docker build $(DOCKER_BUILD_PARAMS) --build-arg LAGOON_VERSION=$(LAGOON_VERSION) --build-arg IMAGE_REPO=$(CI_BUILD_TAG) --build-arg ALPINE_VERSION=$(DEFAULT_ALPINE_VERSION) --build-arg BASE_VERSION=$(2) -t $(CI_BUILD_TAG)/$(1):$(3) -f $(4) $(5)
docker_build_version_cmd = docker build $(DOCKER_BUILD_PARAMS) --build-arg LAGOON_VERSION=$(LAGOON_VERSION) --build-arg IMAGE_REPO=$(CI_BUILD_TAG) --build-arg ALPINE_VERSION=$(or $(6),$(DEFAULT_ALPINE_VERSION)) --build-arg BASE_VERSION=$(2) -t $(CI_BUILD_TAG)/$(1):$(3) -f $(4) $(5)

# Tag an image with the `amazeeio` repository and push it.
# $1: source image name:tag
Expand Down
10 changes: 8 additions & 2 deletions docker-build.awk
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,14 @@ function genBuildRules(fullTarget, dockerfile) {
tag = "python:" versions[i] type
appendToLists(rule, class, tag)
# append the recipe to the rules
rules = rules rule "\n\t$(call docker_build_version_cmd,python," \
versions[i] "," versions[i] type "," dockerfile "," context")\n";
if (versions[i] ~ /2.7/) {
rules = rules rule "\n\t$(call docker_build_version_cmd,python," \
versions[i] "," versions[i] type "," dockerfile "," \
context",3.10)\n";
} else {
rules = rules rule "\n\t$(call docker_build_version_cmd,python," \
versions[i] "," versions[i] type "," dockerfile "," context")\n";
}
}
} else if (fullTarget ~ /^build\\:solr/) {
# extract the image type
Expand Down

0 comments on commit e083c8f

Please sign in to comment.