Skip to content

Commit

Permalink
Add Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
doganulus committed Sep 8, 2024
1 parent ea1851c commit 0261cc0
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
IMAGE_NAME ?= localhost/autoware
AUTOWARE_VERSION ?= $(shell date +'%Y%m%d')
CONTEXT ?= .

info:
echo "Autoware version: ${AUTOWARE_VERSION}"

base:
buildah build \
-f containers/autoware-devel/Dockerfile \
--build-arg IMAGE_NAME=${IMAGE_NAME} \
--build-arg AUTOWARE_VERSION=${AUTOWARE_VERSION} \
--layers=true \
--target autoware-base \
--tag autoware:latest-base \
--tag autoware:${AUTOWARE_VERSION}-base \
${CONTEXT}

builder: base
buildah build \
-f containers/autoware-devel/Dockerfile \
--build-arg IMAGE_NAME=${IMAGE_NAME} \
--build-arg AUTOWARE_VERSION=${AUTOWARE_VERSION} \
--layers=true \
--target autoware-builder \
--tag autoware:latest-builder \
--tag autoware:${AUTOWARE_VERSION}-builder \
${CONTEXT}

builder-with-cache: builder
buildah build \
-f containers/autoware-devel/Dockerfile \
--build-arg IMAGE_NAME=${IMAGE_NAME} \
--build-arg AUTOWARE_VERSION=${AUTOWARE_VERSION} \
--layers=true \
--target autoware-builder-with-cache \
--tag autoware:latest-builder-with-cache \
--tag autoware:${AUTOWARE_VERSION}-builder-with-cache \
${CONTEXT}

devel: builder-with-cache
buildah build \
-f containers/autoware-devel/Dockerfile \
--build-arg IMAGE_NAME=${IMAGE_NAME} \
--build-arg AUTOWARE_VERSION=${AUTOWARE_VERSION} \
--format oci \
--layers=true \
--target autoware-devel \
--tag autoware:latest-devel \
--tag autoware:${AUTOWARE_VERSION}-devel \
${CONTEXT}

runtime: builder-with-cache
buildah build \
-f containers/autoware-runtime/Dockerfile \
--build-arg IMAGE_NAME=${IMAGE_NAME} \
--build-arg AUTOWARE_VERSION=${AUTOWARE_VERSION} \
--format oci \
--layers=true \
--target autoware-runtime \
--tag autoware:latest-runtime \
--tag autoware:${AUTOWARE_VERSION}-runtime \
${CONTEXT}

0 comments on commit 0261cc0

Please sign in to comment.