1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-25 14:59:26 +01:00
Files
dozzle/Dockerfile
Amir Raminfar 3a24c6e665 Adds support for multi-arch (#306)
* Uses experimental docker multi-arch

* Fixes dockerfile to build node and golang images

* Adds ldflags

* Adds buildx to push.yml

* Adds docker login

* Adds login in again

* Login using run

* Login using run

* Adds Makefile

* Updates actions

* Fixes push
2020-03-18 14:13:35 -07:00

57 lines
964 B
Docker

# Build assets
FROM node:13-alpine as node
RUN apk add --no-cache git openssh python make g++ util-linux
WORKDIR /build
# Install dependencies
COPY package*.json ./
RUN npm install
# Copy assets to build
COPY assets ./assets
# Do the build
RUN npm run build
FROM golang:alpine AS builder
RUN apk add --no-cache git ca-certificates
RUN mkdir /dozzle
WORKDIR /dozzle
# Needed for assets
RUN go get -u github.com/gobuffalo/packr/packr
# Copy go mod files
COPY go.* ./
RUN go mod download
# Copy assets built with node
COPY --from=node /build/static ./static
# Copy all other files
COPY . .
# Compile static files
RUN packr -z
# Args
ARG TAG=dev
# Build binary
RUN CGO_ENABLED=0 go build -ldflags "-s -w -X main.version=$TAG" -o dozzle
FROM scratch
ENV PATH=/bin
ENV DOCKER_API_VERSION 1.38
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /dozzle/dozzle /dozzle
ENTRYPOINT ["/dozzle"]