Skip to content

Commit

Permalink
section61 도커파일 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
myeunee committed Nov 3, 2024
1 parent a59d31e commit d80f60a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions chapter16/section61/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ RUN go build -trimpath -ldflags "-w -s" -o app

#--------------------------------
# Deployment stage
# 최신 GLIBC 버전을 사용하기 위해 우분투로 교체

FROM debian:bullseye-slim as deploy
FROM ubuntu:latest as deploy

RUN apt-get update
RUN apt-get update && apt-get install -y libgcc-s1

# 빌드된 바이너리를 복사
COPY --from=deploy-builder /app/app .
Expand Down
8 changes: 4 additions & 4 deletions chapter16/section61/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ func main() {
}

func run(ctx context.Context) error {
ctx, stop := signal.NotifyContext(ctx, os.Interrupt, syscall.SIGTERM)
defer stop()
ctx, stop := signal.NotifyContext(ctx, os.Interrupt, syscall.SIGTERM) // 추가
defer stop() // 추가
cfg, err := config.New()
if err != nil {
return err
Expand All @@ -40,8 +40,8 @@ func run(ctx context.Context) error {
// 인수로 받은 net.Listener를 이용 -> Addr 필드 지정 X
Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// 명령줄에서 테스트하기 위한 로직
time.Sleep(5 * time.Second)
fmt.Fprintf(w, "Hello, %s!", r.URL.Path[1:])
time.Sleep(5 * time.Second) // 추가
fmt.Fprintf(w, "Hello, %s!", r.URL.Path[1:]) // 추가
}),
}
eg, ctx := errgroup.WithContext(ctx)
Expand Down

0 comments on commit d80f60a

Please sign in to comment.