mirror of
https://github.com/glanceapp/glance.git
synced 2025-06-22 02:41:23 +02:00
Build app in Dockerfile
This change makes it simpler and more convenient to build the app.
This commit is contained in:
parent
21d491843f
commit
53a661861a
@ -1,7 +1,14 @@
|
|||||||
|
FROM golang:1.22.3-alpine3.19 AS builder
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . /app
|
||||||
|
RUN CGO_ENABLED=0 go build .
|
||||||
|
|
||||||
|
|
||||||
FROM alpine:3.19
|
FROM alpine:3.19
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY build/glance /app/glance
|
COPY --from=builder /app/glance .
|
||||||
|
|
||||||
EXPOSE 8080/tcp
|
EXPOSE 8080/tcp
|
||||||
ENTRYPOINT ["/app/glance"]
|
ENTRYPOINT ["/app/glance"]
|
||||||
|
@ -92,12 +92,6 @@ go run .
|
|||||||
|
|
||||||
### Building Docker image
|
### Building Docker image
|
||||||
|
|
||||||
Build Glance with CGO disabled:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
CGO_ENABLED=0 go build -o build/glance .
|
|
||||||
```
|
|
||||||
|
|
||||||
Build the image:
|
Build the image:
|
||||||
|
|
||||||
**Make sure to replace "owner" with your name or organization.**
|
**Make sure to replace "owner" with your name or organization.**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user