-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
traffic-a22-data-quality: move build to container
- Loading branch information
Showing
2 changed files
with
13 additions
and
15 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
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 |
---|---|---|
@@ -1,10 +1,17 @@ | ||
FROM golang:1.23-bookworm | ||
# SPDX-FileCopyrightText: 2024 NOI Techpark <digital@noi.bz.it> | ||
# | ||
# SPDX-License-Identifier: CC0-1.0 | ||
|
||
# install if docker host doesn't has libc6 installed | ||
RUN apt-get update && apt-get install -y libc6 | ||
FROM golang:1.23-bookworm AS base | ||
|
||
FROM base AS build-env | ||
WORKDIR /app | ||
COPY src/. . | ||
RUN go mod download | ||
RUN CGO_ENABLED=0 GOOS=linux go build -o main | ||
|
||
COPY src/main main | ||
|
||
CMD [ "./main"] | ||
# BUILD published image | ||
FROM alpine:latest AS build | ||
WORKDIR /app | ||
COPY --from=build-env /app/main . | ||
ENTRYPOINT [ "./main"] |