volumes-backup-extension/Dockerfile

45 строки
1.5 KiB
Docker
Исходник Обычный вид История

FROM golang:1.17-alpine AS builder
ENV CGO_ENABLED=0
WORKDIR /backend
COPY vm/go.* .
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go mod download
COPY vm/. .
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build -trimpath -ldflags="-s -w" -o bin/service
2022-06-15 13:42:44 +03:00
FROM --platform=$BUILDPLATFORM node:17.7-alpine3.14 AS client-builder
WORKDIR /ui
# cache packages in layer
COPY ui/package.json /ui/package.json
COPY ui/package-lock.json /ui/package-lock.json
RUN --mount=type=cache,target=/usr/src/app/.npm \
npm set cache /usr/src/app/.npm && \
npm ci
# install
COPY ui /ui
RUN npm run build
FROM busybox:1.35.0
2022-06-15 13:42:44 +03:00
LABEL org.opencontainers.image.title="vackup-docker-extension" \
2022-06-16 10:19:56 +03:00
org.opencontainers.image.description="Easily backup and restore docker volumes." \
2022-06-15 13:42:44 +03:00
org.opencontainers.image.vendor="Felipe" \
com.docker.desktop.extension.api.version=">= 0.2.3" \
com.docker.extension.screenshots="" \
com.docker.extension.detailed-description="" \
2022-06-16 10:19:56 +03:00
com.docker.extension.publisher-url="https://github.com/felipecruz91/vackup-docker-extension" \
com.docker.extension.additional-urls="[{\"title\":\"Author\", \"url\":\"https://twitter.com/felipecruz\"}]" \
2022-06-15 13:42:44 +03:00
com.docker.extension.changelog=""
2022-06-17 12:20:30 +03:00
WORKDIR /
COPY docker-compose.yaml .
2022-06-15 13:42:44 +03:00
COPY metadata.json .
COPY icon.svg .
COPY --from=builder /backend/bin/service /
2022-06-15 13:42:44 +03:00
COPY --from=client-builder /ui/build ui
2022-06-15 16:51:22 +03:00
RUN mkdir -p /vackup
CMD /service -socket /run/guest-services/extension-vackup.sock