-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build and run inside docker containers
- Loading branch information
Showing
6 changed files
with
54 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
* | ||
!package.json | ||
!bun.lockb | ||
!*.cjs | ||
!*.js | ||
!amt-setupbin-img/*.go | ||
!amt-setupbin-img/go.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# syntax=docker/dockerfile:1.6 | ||
|
||
FROM oven/bun:1.0 as build | ||
WORKDIR /app | ||
COPY package.json bun.lockb ./ | ||
RUN bun install --frozen-lockfile | ||
COPY *.cjs *.js ./ | ||
# NB this is not using --minify --sourcemap=inline beause it makes stack traces | ||
# hard to read, as they show the minified version source code. | ||
RUN bun \ | ||
build \ | ||
. \ | ||
--production \ | ||
--compile \ | ||
--target=bun \ | ||
--outfile=amt-setupbin | ||
|
||
FROM golang:1.21-bookworm as img-build | ||
WORKDIR /app | ||
COPY amt-setupbin-img/go.* ./ | ||
RUN go mod download | ||
COPY amt-setupbin-img/*.go ./ | ||
RUN CGO_ENABLED=0 go build -ldflags="-s" | ||
|
||
# NB we use the bookworm-slim (instead of scratch) image so we can enter the container to execute bash etc. | ||
FROM debian:12-slim | ||
COPY --from=build /app/amt-setupbin /usr/local/bin/ | ||
COPY --from=img-build /app/amt-setupbin-img /usr/local/bin/ | ||
ENTRYPOINT ["amt-setupbin"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters