Skip to content

Commit

Permalink
Moved from manifest to buildx
Browse files Browse the repository at this point in the history
Also, this needed to rollback node image to 18 due to nodejs/docker-node#1829
This may have implications on #3.

The image still install latest available eleventy from NPM, so each beta
build is just another latest stable. This issue is due to process
between github-release-notifier and eleventy team making a tag on github
on each beta build. This should be handled by github-release-notifier
  • Loading branch information
jaymoulin committed May 1, 2024
1 parent 7085897 commit 7ed56c3
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 52 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Installing dependencies
run: |
sudo apt update
sudo apt install make -y
git clone https://github.com/estesp/manifest-tool && cd manifest-tool && git checkout v0.9.0 && sudo make && sudo make install && cd .. && rm -Rf manifest-tool
docker run --rm --privileged multiarch/qemu-user-static:register
sudo apt install -y qemu qemu-user-static qemu-user binfmt-support
echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_HUB_LOGIN }}" --password-stdin
- name: install buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
- name: Build image
run: make build
- name: Publish image
run: make publish latest
run: make publish
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
.build
site
manifest.yaml
.Dockerfile
11 changes: 4 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
FROM node:alpine as builder

COPY qemu-*-static /usr/bin/

FROM builder
FROM node:18-alpine

ARG VERSION=v3.0.0-alpha.10
LABEL maintainer="Jay MOULIN <https://jaymoulin.me/femtopixel/docker-eleventy> <https://twitter.com/MoulinJay>"
LABEL version="${VERSION}"
ARG TARGETPLATFORM
LABEL maintainer="Jay MOULIN <https://jaymoulin.me/femtopixel/docker-eleventy>"
LABEL version="${VERSION}-${TARGETPLATFORM}"

RUN npm add -g npm @11ty/eleventy
WORKDIR /app
Expand Down
27 changes: 6 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
VERSION ?= v3.0.0-alpha.10
FULLVERSION ?= v3.0.0-alpha.10
CACHE ?= --no-cache=1
.PHONY: all build publish latest
archs ?= amd64 arm64v8 arm32v6
all: build publish latest
qemu-arm-static:
cp /usr/bin/qemu-arm-static .
qemu-aarch64-static:
cp /usr/bin/qemu-aarch64-static .
build: qemu-aarch64-static qemu-arm-static
$(foreach arch,$(archs), \
cat Dockerfile | sed "s/FROM node/FROM ${arch}\/node/g" > .Dockerfile; \
docker build -t femtopixel/eleventy:${VERSION}-$(arch) --build-arg VERSION=${VERSION}-$(arch) ${CACHE} -f .Dockerfile .;\
)
publish:
docker push femtopixel/eleventy -a
cat manifest.yml | sed "s/\$$VERSION/${VERSION}/g" > manifest.yaml
cat manifest.yaml | sed "s/\$$FULLVERSION/${FULLVERSION}/g" > manifest2.yaml
mv manifest2.yaml manifest.yaml
manifest-tool push from-spec manifest.yaml
latest:
FULLVERSION=latest VERSION=${VERSION} make publish

.PHONY: all build publish
all: build publish
build:
docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 ${PUSH} --tag femtopixel/eleventy --tag femtopixel/eleventy:${VERSION} ${CACHE} .
publish:
PUSH=--push CACHE= make build
15 changes: 0 additions & 15 deletions manifest.yml

This file was deleted.

Binary file removed qemu-aarch64-static
Binary file not shown.
Binary file removed qemu-arm-static
Binary file not shown.

0 comments on commit 7ed56c3

Please sign in to comment.