Skip to content

Commit

Permalink
Finalize docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Aug 26, 2023
1 parent 490af63 commit 2fdf4ae
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 26 deletions.
12 changes: 0 additions & 12 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,3 @@ changelog:
filters:
exclude:
- '^docs:'

kos:
- repository: danog/gojekyll
tags:
- '{{.Version}}'
- latest
bare: true
preserve_import_paths: false
base_image: ko.local/gojekyll_base
platforms:
- linux/amd64
- linux/arm64
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM golang:latest AS gojekyll

ADD . /gojekyll

WORKDIR /gojekyll

RUN go build main.go

FROM bufbuild/buf AS buf
FROM dart:stable AS sass

COPY --from=buf /usr/local/bin/buf /usr/local/bin/

RUN git clone https://github.com/sass/dart-sass.git /dart-sass && \
cd /dart-sass && \
dart pub get && \
dart run grinder protobuf && \
dart compile exe bin/sass.dart

FROM cgr.dev/chainguard/glibc-dynamic:latest

COPY --from=gojekyll /gojekyll/main /usr/bin/gojekyll
COPY --from=sass /dart-sass/bin/sass.exe /usr/bin/sass

ENTRYPOINT [ "/usr/bin/gojekyll" ]

CMD [ "--help" ]
4 changes: 0 additions & 4 deletions Dockerfile.base

This file was deleted.

14 changes: 4 additions & 10 deletions release.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
#!/bin/bash -e

for arch in amd64 arm64; do
docker buildx build --platform linux/$arch . \
-f Dockerfile.base \
-t gojekyll_base:next-$arch \
--load &
done

wait

docker buildx imagetools create -t gojekyll_base:latest gojekyll_base:next-{arm64,amd64}
docker buildx build --platform linux/arm64,linux/amd64 . \
-f Dockerfile \
-t danog/gojekyll:latest \
--push

goreleaser release

0 comments on commit 2fdf4ae

Please sign in to comment.