Skip to content

Commit

Permalink
generator: update docker template
Browse files Browse the repository at this point in the history
  • Loading branch information
agungdwiprasetyo committed Jan 3, 2024
1 parent bf130c2 commit 7e48e83
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/candi/template_etc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

const (
dockerfileTemplate = `# Stage 1
FROM golang:1.18.4-alpine3.16 AS dependency_builder
FROM golang:1.21.5-alpine3.19 AS dependency_builder
WORKDIR /go/src
ENV GO111MODULE=on
Expand All @@ -24,7 +24,7 @@ COPY . .
RUN go build -o bin
# Stage 3
FROM alpine:latest
FROM alpine:3.19
ARG BUILD_NUMBER
RUN apk --no-cache add ca-certificates tzdata
Expand Down Expand Up @@ -61,7 +61,7 @@ docker:
docker build -t {{.ServiceName}}:latest .
run-container:
docker run --name={{.ServiceName}} --network="host" -d {{.ServiceName}}
docker run --rm --name={{.ServiceName}} --network="host" -d {{.ServiceName}}
clear-docker:
docker rm -f {{.ServiceName}}
Expand Down Expand Up @@ -348,7 +348,7 @@ $ make migration service={{service_name}} down
"```\n"

dockerfileMonorepoTemplate = `# Stage 1
FROM golang:1.18.4-alpine3.16 AS dependency_builder
FROM golang:1.21.5-alpine3.19 AS dependency_builder
WORKDIR /go/src
ENV GO111MODULE=on
Expand All @@ -374,7 +374,7 @@ COPY go.sum .
RUN go build -o bin services/$SERVICE_NAME/*.go
# Stage 3
FROM alpine:latest
FROM alpine:3.19
ARG BUILD_NUMBER
ARG SERVICE_NAME
Expand Down Expand Up @@ -430,7 +430,7 @@ docker: check
docker build --build-arg SERVICE_NAME=$(service) -t $(service):latest .
run-container: check
docker run --name=$(service) --network="host" -d $(service)
docker run --rm --name=$(service) --network="host" -d $(service)
clear-docker: check
docker rm -f $(service)
Expand Down

0 comments on commit 7e48e83

Please sign in to comment.