backup-utils/Dockerfile

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

2023-05-30 22:15:26 +03:00
# Multi stage build for backup-utils
# Build layer is for compiling rsync from source
# Runtime layer is for running backup-utils
# https://docs.docker.com/develop/develop-images/multistage-build/
# https://docs.docker.com/engine/userguide/eng-image/multistage-build/
2017-10-24 23:59:25 +03:00
2023-05-30 22:15:26 +03:00
# Build layer
FROM ubuntu:focal AS build
# Install build dependencies
RUN apt-get update && apt-get install --no-install-recommends -y \
gcc \
g++ \
gawk \
autoconf \
make \
automake \
python3-cmarkgfm \
acl \
libacl1-dev \
attr \
libattr1-dev \
libxxhash-dev \
libzstd-dev \
liblz4-dev \
libssl-dev \
git \
jq \
curl \
2017-10-24 23:59:25 +03:00
tar \
2023-05-30 22:15:26 +03:00
gzip \
2017-10-24 23:59:25 +03:00
ca-certificates \
2023-05-30 22:15:26 +03:00
&& rm -rf /var/lib/apt/lists/*
# Download rsync source from https://github.com/WayneD/rsync/archive/refs/tags/[TAG].tar.gz pinned to specified tag
ARG RSYNC_TAG=v3.2.7
RUN curl https://github.com/WayneD/rsync/archive/refs/tags/${RSYNC_TAG}.tar.gz -L -o ${RSYNC_TAG}.tar.gz
RUN mkdir -p /rsync-${RSYNC_TAG}&& tar -xzf ${RSYNC_TAG}.tar.gz -C /rsync-${RSYNC_TAG} --strip-components=1 && ls -la
# Change to the working directory of the rsync source
WORKDIR /rsync-${RSYNC_TAG}
RUN ls -la && ./configure
RUN make
RUN make install
# Reset working directory
WORKDIR /
# Runtime layer
FROM ubuntu:focal AS runtime
# Install runtime dependencies - bash, git, OpenSSH 5.6 or newer, and jq v1.5 or newer.
RUN apt-get update && apt-get install --no-install-recommends -y \
bash \
2017-10-24 23:59:25 +03:00
git \
2023-05-30 22:15:26 +03:00
openssh-client \
jq \
2020-04-01 00:02:33 +03:00
moreutils \
2023-05-30 22:15:26 +03:00
gawk \
ca-certificates \
xxhash \
2017-10-24 23:59:25 +03:00
&& rm -rf /var/lib/apt/lists/*
2023-05-30 22:15:26 +03:00
# Copy rsync from build layer
COPY --from=build /usr/local/bin/rsync /usr/local/bin/rsync
# Copy backup-utils from repository into /backup-utils
2020-09-28 11:58:37 +03:00
COPY ./ /backup-utils/
2023-05-30 22:15:26 +03:00
2017-10-25 03:40:18 +03:00
WORKDIR /backup-utils
2017-10-24 23:59:25 +03:00
2017-10-25 03:40:18 +03:00
RUN chmod +x /backup-utils/share/github-backup-utils/ghe-docker-init
2017-10-24 23:59:25 +03:00
2017-10-25 03:40:18 +03:00
ENTRYPOINT ["/backup-utils/share/github-backup-utils/ghe-docker-init"]
2017-10-17 10:09:41 +03:00
CMD ["ghe-host-check"]