2024-06-26 15:06:29 +03:00
FROM golang:1.22-alpine AS builder
2022-07-16 15:36:58 +03:00
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
2024-07-02 00:54:00 +03:00
FROM --platform=$BUILDPLATFORM node:17.7-alpine3.14@sha256:539e64749f7dc6c578d744d879fd0ec37f3afe552ae4aca9744cc85121728c4c AS client-builder
2022-06-15 13:42:44 +03:00
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
2024-04-26 12:03:52 +03:00
# avoid reusing cached layers from another build without secrets provided, cf https://docs.docker.com/build/cache/invalidation/#build-secrets
ARG VALID_SECRET_CACHE
2024-04-18 23:02:01 +03:00
RUN --mount= type = secret,id= BUGSNAG_API_KEY,target= /run/secrets/BUGSNAG_API_KEY \
--mount= type = secret,id= REACT_APP_MUI_LICENSE_KEY,target= /run/secrets/REACT_APP_MUI_LICENSE_KEY \
2022-09-06 19:05:34 +03:00
REACT_APP_BUGSNAG_API_KEY = $( cat /run/secrets/BUGSNAG_API_KEY) \
2022-09-20 17:53:17 +03:00
REACT_APP_MUI_LICENSE_KEY = $( cat /run/secrets/REACT_APP_MUI_LICENSE_KEY) \
2024-04-18 23:02:01 +03:00
npm run build
2022-09-06 19:05:34 +03:00
2024-07-01 19:35:49 +03:00
FROM alpine:3.20@sha256:b89d9c93e9ed3597455c90a0b88a8bbb5cb7188438f70953fede212a0c4394e0 AS base
2022-09-15 10:16:33 +03:00
ARG CLI_VERSION = 20 .10.17
SHELL [ "/bin/ash" , "-eo" , "pipefail" , "-c" ]
2022-09-07 13:03:40 +03:00
RUN apk update \
2022-09-15 10:16:33 +03:00
&& apk add --no-cache ca-certificates curl \
2022-09-07 13:03:40 +03:00
&& rm -rf /var/cache/apk/*
2022-09-15 10:16:33 +03:00
RUN curl -fL " https://download.docker.com/linux/static/stable/ $( uname -m) /docker- ${ CLI_VERSION } .tgz " | tar zxf - --strip-components 1 docker/docker \
&& chmod +x /docker
2022-08-12 11:16:31 +03:00
2024-06-26 15:06:29 +03:00
FROM --platform=$BUILDPLATFORM golang:1.22-alpine AS docker-credentials-client-builder
2022-08-12 11:16:31 +03:00
ENV CGO_ENABLED = 0
WORKDIR /output
RUN apk update \
&& apk add --no-cache build-base= 0.5-r3 \
&& rm -rf /var/cache/apk/*
COPY client .
RUN make cross
2022-06-15 13:42:44 +03:00
2024-06-26 15:06:29 +03:00
FROM busybox:1.36.1@sha256:9ae97d36d26566ff84e8893c64a6dc4fe8ca6d1144bf5b87b2b85a32def253c7
2022-09-07 09:49:04 +03:00
ARG BUGSNAG_RELEASE_STAGE = "local"
ARG BUGSNAG_APP_VERSION = "latest"
ENV BUGSNAG_RELEASE_STAGE = $BUGSNAG_RELEASE_STAGE
ENV BUGSNAG_APP_VERSION = $BUGSNAG_APP_VERSION
2022-08-23 17:02:54 +03:00
LABEL org.opencontainers.image.title= "Volumes Backup & Share" \
2024-09-10 10:04:33 +03:00
org.opencontainers.image.description= "Backup, clone, restore, and share Docker volumes effortlessly. Also available in the Volumes tab in Docker Desktop version 4.29.0 and later. This extension will be deprecated and removed from the marketplace effective September 30, 2024." \
2022-08-23 17:02:54 +03:00
org.opencontainers.image.vendor= "Docker Inc." \
2022-06-15 13:42:44 +03:00
com.docker.desktop.extension.api.version= ">= 0.2.3" \
2022-08-23 17:02:54 +03:00
com.docker.extension.screenshots= " [ \
2023-05-16 17:01:03 +03:00
{ \" alt\" : \" Home page - list of volumes\" , \" url\" : \" https://raw.githubusercontent.com/docker/volumes-backup-extension/main/docs/images/1-table.png\" } , \
{ \" alt\" : \" Import data into a new volume\" , \" url\" : \" https://raw.githubusercontent.com/docker/volumes-backup-extension/main/docs/images/2-import-new.png\" } , \
{ \" alt\" : \" Export volume dialog\" , \" url\" : \" https://raw.githubusercontent.com/docker/volumes-backup-extension/main/docs/images/3-export.png\" } , \
{ \" alt\" : \" Transfer volume to another host\" , \" url\" : \" https://raw.githubusercontent.com/docker/volumes-backup-extension/main/docs/images/4-transfer.png\" } , \
{ \" alt\" : \" Clone volume dialog\" , \" url\" : \" https://raw.githubusercontent.com/docker/volumes-backup-extension/main/docs/images/5-clone.png\" } , \
{ \" alt\" : \" Delete volume dialog\" , \" url\" : \" https://raw.githubusercontent.com/docker/volumes-backup-extension/main/docs/images/6-delete.png\" } \
2022-08-23 17:02:54 +03:00
] " \
2024-09-05 22:19:13 +03:00
com.docker.extension.detailed-description= " <p><strong>The functionality in this extension has been available in the Volumes tab of Docker Desktop in versions 4.29 and later. This extension will be deprecated and removed from the marketplace effective September 30, 2024.</strong> <a href='https://docs.docker.com/desktop/use-desktop/volumes/'>Learn more</a></p> \
2024-04-17 15:32:23 +03:00
<p>With Volumes Backup & Share you can easily create copies of your volumes and also share them with others through SSH or pushing them to a registry.</p> \
2022-08-23 17:02:54 +03:00
<h2 id = "-features" >✨ What can you do with this extension?</h2> \
<ul> \
<li>Export a volume:</li> \
<ul><li>To a compressed file in your local filesystem</li> \
<li>To an existing local image</li> \
<li>To a new local image</li> \
<li>To a new image in Docker Hub ( or another registry) </li></ul> \
<li>Import data into a new container or into an existing container:</li> \
<ul><li>From a compressed file in your local filesystem</li> \
<li>From an existing image</li> \
<li>From an existing image in Docker Hub ( or another registry) </li></ul> \
<li>Transfer a volume via SSH to another host that runs Docker Desktop or Docker engine.</li> \
<li>Clone, empty or delete a volume</li> \
</ul> \
2022-08-30 11:05:44 +03:00
<h2>Acknowledgements</h2> \
<ul> \
<li><a href = \" https://github.com/BretFisher/docker-vackup\" >Vackup project by Bret Fisher</a></li> \
<li><a href = \" https://www.youtube.com/watch?v= BHKp7Sc3VVc\" >Building Vackup - LiveStream on YouTube</a></li> \
<ul> \
2022-08-23 17:02:54 +03:00
" \
com.docker.extension.publisher-url= "https://www.docker.com/" \
com.docker.extension.additional-urls= " [ \
2023-05-16 17:01:03 +03:00
{ \" title\" :\" Support\" , \" url\" :\" https://github.com/docker/volumes-backup-extension/issues\" } \
2022-08-23 17:02:54 +03:00
] " \
com.docker.desktop.extension.icon= "https://raw.githubusercontent.com/docker/volumes-backup-extension/main/icon.svg" \
2022-09-15 15:15:59 +03:00
com.docker.extension.changelog= " <ul> \
2024-07-05 11:29:43 +03:00
<li>Fixed some security CVEs in JavaScript dependencies.</li> \
2024-09-09 14:10:01 +03:00
<li>Updated deprecation information.</li> \
2022-11-23 15:26:15 +03:00
</ul>" \
com.docker.extension.categories= "volumes"
2022-06-15 13:42:44 +03:00
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-09-15 10:16:33 +03:00
COPY --from= base /etc/ssl/certs /etc/ssl/certs
COPY --from= base /docker /usr/local/bin/docker
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-08-23 17:08:16 +03:00
COPY --from= docker-credentials-client-builder output/dist ./host
2022-06-15 16:51:22 +03:00
RUN mkdir -p /vackup
2022-07-16 15:36:58 +03:00
2024-04-26 12:03:52 +03:00
ARG VALID_SECRET_CACHE
2022-09-06 19:05:34 +03:00
RUN --mount= type = secret,id= BUGSNAG_API_KEY \
BUGSNAG_API_KEY = $( cat /run/secrets/BUGSNAG_API_KEY) ; \
echo " $BUGSNAG_API_KEY " > /tmp/bugsnag-api-key.txt
2022-09-07 09:49:04 +03:00
ENTRYPOINT [ "/bin/sh" , "-c" , "BUGSNAG_API_KEY=$(cat /tmp/bugsnag-api-key.txt); rm -rf /tmp/bugsnag-api-key.txt; BUGSNAG_API_KEY=$BUGSNAG_API_KEY /service -socket /run/guest-services/ext.sock" ]