Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ARG FROM_IMAGE
FROM ${FROM_IMAGE}
FROM base

# Libuv 1.45.0 is affected by a kernel bug on certain kernels.
# This leads to errors where Garden tool downloading errors with ETXTBSY
Expand Down
35 changes: 6 additions & 29 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,34 +1,11 @@
#!/usr/bin/make -f

REGISTRY=skpr/node
ALPINE_VERSION=3.21
NODE_VERSION=20
ARCH=amd64
VERSION_TAG=v3-latest
NODE_VERSION=22
STREAM=latest

IMAGE=${REGISTRY}:${NODE_VERSION}-${VERSION_TAG}
IMAGE_DEV=${REGISTRY}:dev-${NODE_VERSION}-${VERSION_TAG}

build:
# Building production image.
docker build --build-arg FROM_IMAGE=node:${NODE_VERSION}-alpine${ALPINE_VERSION} -t ${IMAGE}-${ARCH} .
# Building development image.
docker build --build-arg FROM_IMAGE=${IMAGE}-${ARCH} -t ${IMAGE_DEV}-${ARCH} dev
# Testing development image.
container-structure-test test --image ${IMAGE_DEV}-${ARCH} --config tests.yml

push:
# Pushing production image.
docker push ${IMAGE}-${ARCH}
# Pushing development image.
docker push ${IMAGE_DEV}-${ARCH}

manifest:
# Creating manifest for production image.
docker manifest create ${IMAGE} --amend ${IMAGE}-arm64 --amend ${IMAGE}-amd64
docker manifest push ${IMAGE}
# Creating manifest for development image.
docker manifest create ${IMAGE_DEV} --amend ${IMAGE_DEV}-arm64 --amend ${IMAGE_DEV}-amd64
docker manifest push ${IMAGE_DEV}
# Example build command for local development.
# See Github Action for multi-arch and multi-stream building.
nbake:
NODE_VERSION=${NODE_VERSION} STREAM=${STREAM} docker buildx bake

.PHONY: *
3 changes: 1 addition & 2 deletions dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ARG FROM_IMAGE
FROM ${FROM_IMAGE}
FROM base

USER root
RUN apk add --no-cache \
Expand Down
51 changes: 51 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
variable "NODE_VERSION" {
default = "22"
}

variable "STREAM" {
default = "latest"
}

variable "VERSION" {
default = "v3"
}

group "default" {
targets = ["prod", "dev"]
}

target "prod" {
context = "."

contexts = {
base = "docker-image://node:${NODE_VERSION}-alpine3.21"
}

platforms = [
"linux/amd64",
"linux/arm64",
]

tags = [
"docker.io/skpr/node:${NODE_VERSION}-${VERSION}-${STREAM}",
"ghrc.io/skpr/node:${NODE_VERSION}-${VERSION}-${STREAM}",
]
}

target "dev" {
context = "dev"

contexts = {
base = "target:prod"
}

platforms = [
"linux/amd64",
"linux/arm64",
]

tags = [
"docker.io/skpr/node:dev-${NODE_VERSION}-${VERSION}-${STREAM}",
"ghrc.io/skpr/node:dev-${NODE_VERSION}-${VERSION}-${STREAM}",
]
}