Skip to content

Commit

Permalink
Added docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
jsimnz committed Apr 4, 2024
1 parent 6bf6953 commit 23880c9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM golang:1.21-bookworm as builder

# Setup env and dev tools
RUN apt update &&\
apt-get install --yes git make

WORKDIR /app

# Cache deps
COPY go.* /app/
RUN go mod download

# Build
COPY . /app
#ENV GOFLAGS='-buildvcs=false'
RUN --mount=type=cache,target=/root/.cache make build


# Deployment entrypoint
FROM debian:bookworm-slim

RUN useradd -ms /bin/bash node
USER node

COPY --from=builder /app/build/orbisd /usr/local/bin/orbisd

ENTRYPOINT ["orbisd"]
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
docker:
ko:
KO_DOCKER_REPO=ko.local ko build -B --platform=linux/$$(go env GOARCH) ./cmd/orbisd

docker:
docker build -t orbisd .

.PHONY: build
build:
go build -o build/orbisd ./cmd/orbisd
Expand Down

0 comments on commit 23880c9

Please sign in to comment.