diff --git a/HadesAPI/Dockerfile b/HadesAPI/Dockerfile index 934ec20..4016f4d 100644 --- a/HadesAPI/Dockerfile +++ b/HadesAPI/Dockerfile @@ -1,8 +1,6 @@ # Use an official Go runtime as a parent image FROM golang:1.21-alpine AS builder -ENV BINARY=hadesCI-API - # Set the working directory inside the container WORKDIR /app @@ -10,7 +8,7 @@ WORKDIR /app COPY . . # Build the Go application -RUN go build -o ${BINARY} . +RUN go build -o hadesCI-api . # Start a new stage for the minimal runtime container FROM alpine:latest @@ -21,10 +19,10 @@ RUN apk update && apk add ca-certificates libc6-compat WORKDIR /app # Copy the built binary from the builder container into the minimal runtime container -COPY --from=builder /app/${BINARY} . +COPY --from=builder /app/hadesCI-api . # Ensure the binary is executable -RUN chmod +x /app/${BINARY} +RUN chmod +x /app/hadesCI-api # Run your Go application -CMD ["/app/${BINARY}"] +CMD ["/app/hadesCI-api"] diff --git a/HadesScheduler/Dockerfile b/HadesScheduler/Dockerfile index 876df3b..39faf36 100644 --- a/HadesScheduler/Dockerfile +++ b/HadesScheduler/Dockerfile @@ -1,8 +1,6 @@ # Use an official Go runtime as a parent image FROM golang:1.21-alpine AS builder -ENV BINARY=hadesCI-scheduler-k8s - # Set the working directory inside the container WORKDIR /app @@ -10,7 +8,7 @@ WORKDIR /app COPY . . # Build the Go application -RUN go build -o ${BINARY} . +RUN go build -o hadesCI-scheduler-k8s . # Start a new stage for the minimal runtime container FROM alpine:latest @@ -21,10 +19,10 @@ RUN apk update && apk add ca-certificates libc6-compat WORKDIR /app # Copy the built binary from the builder container into the minimal runtime container -COPY --from=builder /app/${BINARY} . +COPY --from=builder /app/hadesCI-scheduler-k8s . # Ensure the binary is executable -RUN chmod +x /app/${BINARY} +RUN chmod +x /app/hadesCI-scheduler-k8s # Run your Go application -CMD ["/app/${BINARY}"] +CMD ["/app/hadesCI-scheduler-k8s"]