mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2026-01-28 09:47:10 +01:00
Adjusted makefile and workflow to build alpine and debian image
This commit is contained in:
committed by
Samuel Laulhau
parent
39bc2f0d89
commit
11869a23a1
11
.github/workflows/build_push.yml
vendored
11
.github/workflows/build_push.yml
vendored
@@ -20,8 +20,17 @@ jobs:
|
|||||||
id: vars
|
id: vars
|
||||||
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
|
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
|
||||||
|
|
||||||
- name: Build the tagged Docker image
|
- name: Build image from alpine
|
||||||
run: make build-alpine TAG="${{steps.vars.outputs.tag}}"
|
run: make build-alpine TAG="${{steps.vars.outputs.tag}}"
|
||||||
|
|
||||||
|
- name: Push alpine-based image
|
||||||
|
run: make push-alpine TAG="${{steps.vars.outputs.tag}}"
|
||||||
|
|
||||||
|
- name: Build image from debian
|
||||||
|
run: make build-debian TAG="${{steps.vars.outputs.tag}}"
|
||||||
|
|
||||||
|
- name: Push debian-based image
|
||||||
|
run: make push-debian TAG="${{steps.vars.outputs.tag}}"
|
||||||
|
|
||||||
- name: Logout from DockerHub
|
- name: Logout from DockerHub
|
||||||
run: docker logout
|
run: docker logout
|
||||||
46
Makefile
Normal file
46
Makefile
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
ifndef TAG
|
||||||
|
$(error The TAG variable is missing.)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Docker Hub namespace
|
||||||
|
HUB_NAMESPACE="invoiceninja"
|
||||||
|
|
||||||
|
# Image name
|
||||||
|
IMAGE="invoiceninja"
|
||||||
|
|
||||||
|
|
||||||
|
# Building docker images based on alpine.
|
||||||
|
# Assigned tags:
|
||||||
|
# - :alpine
|
||||||
|
# - :alpine-<RELEASE VERSION>
|
||||||
|
.PHONY: build-alpine
|
||||||
|
build-alpine:
|
||||||
|
$(info Make: Building "$(TAG)" tagged images from alpine.)
|
||||||
|
@docker build -t ${HUB_NAMESPACE}/${IMAGE}:alpine-${TAG} --build-arg INVOICENINJA_VERSION=${TAG} --file ./alpine/Dockerfile .
|
||||||
|
@docker tag ${HUB_NAMESPACE}/${IMAGE}:alpine-${TAG} ${HUB_NAMESPACE}/${IMAGE}:alpine
|
||||||
|
$(info Make: Done.)
|
||||||
|
|
||||||
|
.PHONY: push-alpine
|
||||||
|
push-alpine:
|
||||||
|
$(info Make: Pushing tagged images from alpine.)
|
||||||
|
@docker push ${HUB_NAMESPACE}/${IMAGE}:alpine-${TAG}
|
||||||
|
@docker push ${HUB_NAMESPACE}/${IMAGE}:alpine
|
||||||
|
$(info Make: Done.)
|
||||||
|
|
||||||
|
# Building docker images based on debian.
|
||||||
|
# Assigned tags:
|
||||||
|
# - :latest
|
||||||
|
# - :<RELEASE VERSION>
|
||||||
|
.PHONY: build-debian
|
||||||
|
build-debian:
|
||||||
|
$(info Make: Building "$(TAG)" tagged images from debian.)
|
||||||
|
@docker build -t ${HUB_NAMESPACE}/${IMAGE}:${TAG} --build-arg INVOICENINJA_VERSION=${TAG} --file ./debian/Dockerfile .
|
||||||
|
@docker tag ${HUB_NAMESPACE}/${IMAGE}:${TAG} ${HUB_NAMESPACE}/${IMAGE}:latest
|
||||||
|
$(info Make: Done.)
|
||||||
|
|
||||||
|
.PHONY: push-debian
|
||||||
|
push-debian:
|
||||||
|
$(info Make: Pushing tagged images from debian.)
|
||||||
|
@docker push ${HUB_NAMESPACE}/${IMAGE}:${TAG}
|
||||||
|
@docker push ${HUB_NAMESPACE}/${IMAGE}:latest
|
||||||
|
$(info Make: Done.)
|
||||||
Reference in New Issue
Block a user