Skip to content

Instantly share code, notes, and snippets.

@hsteinshiromoto
Created August 28, 2019 12:38
Show Gist options
  • Save hsteinshiromoto/0742673c13c0d2726b0e141d2f38e742 to your computer and use it in GitHub Desktop.
Save hsteinshiromoto/0742673c13c0d2726b0e141d2f38e742 to your computer and use it in GitHub Desktop.
Wordpress: Makefile
# ---
# Global Variables
# ---
SHELL:=/bin/bash
docker_user = docker_username
registry = docker_registry
project_name = $(shell basename $(shell pwd))
tag = latest
build_date=$(shell date +%Y%m%d-%H:%M:%S)
docker_image=${registry}/${docker_user}/${project_name}:${tag}
# ---
# Targets
# ---
default: build
# Build Container
build:
@echo "Building Container ${docker_image}"
docker build \
--build-arg BUILD_DATE=${build_date} \
--build-arg PROJECT_NAME=${project_name} -t ${docker_image} .
.PHONY: build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment