Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Dockerfile #560

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git/
Dockerfile
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM golang:1.21-alpine as builder

WORKDIR /usr/src/app

COPY . ./
RUN go mod download && go mod verify

COPY . .
RUN go build -v -o /usr/local/bin/mkcert ./...

FROM golang:1.21-alpine
COPY --from=builder /usr/local/bin/mkcert /usr/local/bin/mkcert

RUN mkdir /.local && chmod 777 /.local

WORKDIR /tmp/certs

ENTRYPOINT ["/usr/local/bin/mkcert"]
CMD ["--help"]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ For Arch Linux users, [`mkcert`](https://www.archlinux.org/packages/community/x8
sudo pacman -Syu mkcert
```

If you prefer building an running mkcert in a docker container

```
docker build . -t mkcert
docker run -it --rm --user $UID -v $PWD:/tmp/certs mkcert localhost 127.0.0.1 ::1
```

### Windows

On Windows, use [Chocolatey](https://chocolatey.org)
Expand Down