2022-07-16 15:36:58 +03:00
|
|
|
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
|
|
|
|
|
2022-07-16 16:41:26 +03:00
|
|
|
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 /
|
2022-07-16 15:36:58 +03:00
|
|
|
COPY docker-compose.yaml .
|
2022-06-15 13:42:44 +03:00
|
|
|
COPY metadata.json .
|
2022-08-08 13:12:18 +03:00
|
|
|
COPY icon.svg .
|
2022-07-16 15:36:58 +03:00
|
|
|
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
|
2022-07-16 15:36:58 +03:00
|
|
|
|
|
|
|
CMD /service -socket /run/guest-services/extension-vackup.sock
|