Skip to content

Commit cf792f8

Browse files
add dockerfile (#42)
1 parent 5279677 commit cf792f8

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Build stage
2+
FROM golang:1.22-alpine AS builder
3+
4+
WORKDIR /go/src/goignore
5+
6+
# Install git
7+
RUN apk add --no-cache git
8+
9+
# Clone the repository and build the goignore executable
10+
RUN git clone https://github.com/hacktivist123/goignore . && \
11+
go build -o /go/bin/goignore ./cmd/goignore
12+
13+
# goignore Container Image
14+
FROM alpine:latest
15+
16+
# Maintainer info
17+
LABEL org.opencontainers.image.authors="Shedrack Akintayo" \
18+
org.opencontainers.image.description="Container image for https://github.com/hacktivist123/goignore"
19+
20+
# Set the working directory
21+
WORKDIR /goignore
22+
23+
# Copy the goignore executable from the builder stage
24+
COPY --from=builder /go/bin/goignore /usr/local/bin/goignore
25+
26+
# Set the entrypoint
27+
ENTRYPOINT [ "goignore" ]

0 commit comments

Comments
 (0)