diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bce9351 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM public.ecr.aws/docker/library/golang:1.23.4-bookworm AS build + +# Set destination for COPY +WORKDIR /app + +# Download Go modules +COPY go.mod go.sum ./ +RUN --mount=type=cache,target="/go" go mod download -x + +COPY . . + +# Build +ENV GOCACHE=/root/.cache/go-build +RUN --mount=type=cache,target="/go" --mount=type=cache,target="/root/.cache/go-build" CGO_ENABLED=1 GOOS=linux go build -o /flink-kube-operator ./cmd/operator + + +FROM busybox:1.36.1 AS final + + +COPY --from=build /flink-kube-operator /flink-kube-operator + +EXPOSE 8083 + +# Run +CMD ["/flink-kube-operator"] \ No newline at end of file diff --git a/Dockerfile.flink b/Dockerfile.flink new file mode 100644 index 0000000..72626ca --- /dev/null +++ b/Dockerfile.flink @@ -0,0 +1,14 @@ +FROM public.ecr.aws/docker/library/flink:1.20.0-scala_2.12-java17 + +# Set working directory +WORKDIR /opt/flink + +# Set environment variables for Flink mini-cluster +ENV FLINK_HOME /opt/flink +ENV PATH=$FLINK_HOME/bin:$PATH + +# Expose necessary ports for the Flink UI (JobManager) and job manager +EXPOSE 8081 6123 + +# Command to start Flink JobManager and TaskManager in a mini-cluster setup +CMD ["bin/start-cluster.sh"] \ No newline at end of file