Skip to content

Commit

Permalink
Remove buggy env configuration from dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Mtze committed Sep 22, 2023
1 parent eec3131 commit aa242a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 4 additions & 6 deletions HadesAPI/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# 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

# Copy the Go application source code into the container
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
Expand All @@ -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"]
10 changes: 4 additions & 6 deletions HadesScheduler/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# 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

# Copy the Go application source code into the container
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
Expand All @@ -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"]

0 comments on commit aa242a2

Please sign in to comment.