Skip to content

Commit

Permalink
fix: Buld templ in dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
qbart committed Nov 18, 2023
1 parent f88bba2 commit f1a627c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ LABEL org.opencontainers.image.source https://github.com/ohkrab/krab
WORKDIR /src
COPY go.* ./
RUN go mod download
RUN apk add --no-cache make

ENV CGO_ENABLED=0 \
GOOS=linux \
Expand All @@ -15,6 +16,8 @@ ARG BUILD_DATE=
ARG BUILD_COMMIT=

COPY . ./
RUN go install github.com/a-h/templ/cmd/templ@latest
RUN templ generate
RUN go build \
-ldflags="-s -w -X 'github.com/ohkrab/krab/krab.InfoVersion=$BUILD_VERSION' -X 'github.com/ohkrab/krab/krab.InfoCommit=$BUILD_COMMIT' -X 'github.com/ohkrab/krab/krab.InfoBuildDate=$BUILD_DATE'" \
-o /tmp/krab .
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: default build install test docker_test docker_build docker_push docker_nightly
.PHONY: default build test docker_test docker_build docker_push docker_nightly

.PHONY: web
web:
Expand Down

0 comments on commit f1a627c

Please sign in to comment.