Skip to content

Commit

Permalink
Dockerfile (#7)
Browse files Browse the repository at this point in the history
Signed-off-by: Bojan Jovanovic <[email protected]>
Co-authored-by: Bojan Jovanovic <[email protected]>
  • Loading branch information
virogenesis and Bojan Jovanovic authored Apr 6, 2023
1 parent d466378 commit dc996b5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM golang:1.20 AS builder


WORKDIR /src
COPY . .

RUN CGO_ENABLED=1 GOOS=linux go build -o /app


FROM ubuntu

RUN apt-get update && apt-get -y install openssh-client

COPY --from=builder /app /app
COPY ./entrypoint.sh ./entrypoint.sh

EXPOSE 2223

ENTRYPOINT [ "./entrypoint.sh"]
CMD [ "/app", "2223" ]
6 changes: 6 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

mkdir -p /keys
[[ ! -f /keys/ssh_host_ed25519_key ]] && ssh-keygen -t ed25519 -f /keys/ssh_host_ed25519_key -N ""

exec "$@"

0 comments on commit dc996b5

Please sign in to comment.