diff --git a/Dockerfile b/Dockerfile index 74507dbfc28e9d7a648e63dcc1ac4e074a040c8d..a67a33fe192a2186e4f7127cb207ea150f9996f3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,30 @@ +# Use an official lightweight Go runtime as a base image +FROM golang:1.22.4-alpine AS build + +# Set the working directory inside the container +WORKDIR /app + +# Copy the Go modules files and download dependencies +COPY go.mod go.sum ./ +RUN go mod download + +# Copy the rest of your application's source code +COPY . . + +# Build the Go binary by specifying the correct package that contains the main function +RUN GOOS=linux go build -v -o /usr/local/bin/see-interface ./cmd/see-interface + +# Use a minimal base image FROM alpine:latest -COPY --link ./dist/see-interface /usr/local/bin/see-interface + +# Set the working directory +WORKDIR /root/ + +# Copy the built binary from the previous stage +COPY --from=build /usr/local/bin/see-interface /usr/local/bin/see-interface + +# Ensure the binary has executable permissions +RUN chmod +x /usr/local/bin/see-interface + +# Set the entry point CMD ["see-interface"] diff --git a/pod.yaml b/pod.yaml new file mode 100644 index 0000000000000000000000000000000000000000..131e4a16732ab7892c238f7e20ae15bc7b7dc317 --- /dev/null +++ b/pod.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Pod +metadata: + name: nginx +spec: + containers: + - name: nginx + image: nginx:latest + ports: + - containerPort: 80