Merge pull request #399 from thockin/master
Downgrade libcurl to work around HTTP bug (v4)
This commit is contained in:
commit
5918570aac
|
|
@ -44,19 +44,30 @@
|
||||||
# => either add the git-sync GID or else set --root, mount a volume,
|
# => either add the git-sync GID or else set --root, mount a volume,
|
||||||
# and manage volume permissions to access that volume
|
# and manage volume permissions to access that volume
|
||||||
|
|
||||||
FROM {ARG_FROM}
|
#############################################################################
|
||||||
|
# First we prepare the image that we want, regardless of build layers.
|
||||||
|
#############################################################################
|
||||||
|
FROM {ARG_FROM} as prep
|
||||||
|
|
||||||
RUN echo "deb http://deb.debian.org/debian/ buster-backports main contrib" > \
|
RUN echo "deb http://deb.debian.org/debian/ buster-backports main contrib" > \
|
||||||
/etc/apt/sources.list.d/backports.list \
|
/etc/apt/sources.list.d/backports.list
|
||||||
&& apt update \
|
RUN apt-get update
|
||||||
&& apt -y upgrade \
|
RUN apt-get -y upgrade
|
||||||
&& apt -y install \
|
RUN apt-get -y install --no-install-recommends \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
coreutils \
|
coreutils \
|
||||||
socat \
|
socat \
|
||||||
openssh-client \
|
openssh-client
|
||||||
&& apt -y -t buster-backports install git \
|
# We want a newer git than the norm.
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
RUN apt-get -y -t buster-backports install --no-install-recommends \
|
||||||
|
git
|
||||||
|
# libcurl3-gnutls=7.74.0-1.2~bpo10+1 is broken. We can downgrade for now until
|
||||||
|
# the fix reaches upstream.
|
||||||
|
# https://github.com/kubernetes/git-sync/issues/395
|
||||||
|
RUN apt-get -y install --no-install-recommends --allow-downgrades \
|
||||||
|
libcurl3-gnutls:amd64=7.64.0-4+deb10u2
|
||||||
|
RUN apt-get -y autoremove
|
||||||
|
RUN rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Add the default UID to /etc/passwd so SSH is satisfied.
|
# Add the default UID to /etc/passwd so SSH is satisfied.
|
||||||
RUN echo "git-sync:x:65533:65533::/tmp:/sbin/nologin" >> /etc/passwd
|
RUN echo "git-sync:x:65533:65533::/tmp:/sbin/nologin" >> /etc/passwd
|
||||||
|
|
@ -74,9 +85,20 @@ RUN echo "git-sync:x:65533:git-sync" >> /etc/group
|
||||||
# they use our git-sync group. If the user needs a different group or sets
|
# they use our git-sync group. If the user needs a different group or sets
|
||||||
# $GIT_SYNC_ROOT or --root, their values will override this, and we assume they
|
# $GIT_SYNC_ROOT or --root, their values will override this, and we assume they
|
||||||
# are handling permissions themselves.
|
# are handling permissions themselves.
|
||||||
ENV GIT_SYNC_ROOT=/git
|
|
||||||
RUN mkdir -m 02775 /git && chown 65533:65533 /git
|
RUN mkdir -m 02775 /git && chown 65533:65533 /git
|
||||||
|
|
||||||
|
# Add the platform-specific binary.
|
||||||
|
COPY bin/{ARG_OS}_{ARG_ARCH}/{ARG_BIN} /{ARG_BIN}
|
||||||
|
|
||||||
|
# Add third-party licenses.
|
||||||
|
COPY .licenses/ /LICENSES/
|
||||||
|
|
||||||
|
#############################################################################
|
||||||
|
# Now we make a "clean" final image.
|
||||||
|
#############################################################################
|
||||||
|
FROM scratch
|
||||||
|
COPY --from=prep / /
|
||||||
|
|
||||||
# Run as non-root by default. There's simply no reason to run as root.
|
# Run as non-root by default. There's simply no reason to run as root.
|
||||||
USER 65533:65533
|
USER 65533:65533
|
||||||
|
|
||||||
|
|
@ -85,10 +107,7 @@ USER 65533:65533
|
||||||
ENV HOME=/tmp
|
ENV HOME=/tmp
|
||||||
WORKDIR /tmp
|
WORKDIR /tmp
|
||||||
|
|
||||||
# Add the platform-specific binary.
|
# Default values for flags.
|
||||||
COPY bin/{ARG_OS}_{ARG_ARCH}/{ARG_BIN} /{ARG_BIN}
|
ENV GIT_SYNC_ROOT=/tmp/git
|
||||||
|
|
||||||
# Add third-party licenses.
|
|
||||||
COPY .licenses/ /LICENSES/
|
|
||||||
|
|
||||||
ENTRYPOINT ["/{ARG_BIN}"]
|
ENTRYPOINT ["/{ARG_BIN}"]
|
||||||
|
|
|
||||||
1
Makefile
1
Makefile
|
|
@ -138,6 +138,7 @@ container: .container-$(DOTFILE_IMAGE) container-name
|
||||||
Dockerfile.in > .dockerfile-$(OS)_$(ARCH)
|
Dockerfile.in > .dockerfile-$(OS)_$(ARCH)
|
||||||
@docker buildx build \
|
@docker buildx build \
|
||||||
--no-cache \
|
--no-cache \
|
||||||
|
--progress=plain \
|
||||||
--load \
|
--load \
|
||||||
--platform "$(OS)/$(ARCH)" \
|
--platform "$(OS)/$(ARCH)" \
|
||||||
--build-arg HTTP_PROXY=$(HTTP_PROXY) \
|
--build-arg HTTP_PROXY=$(HTTP_PROXY) \
|
||||||
|
|
|
||||||
17
test_e2e.sh
17
test_e2e.sh
|
|
@ -1432,6 +1432,23 @@ assert_file_eq "$ROOT"/link/file2 "$TESTCASE"
|
||||||
# Wrap up
|
# Wrap up
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
##############################################
|
||||||
|
# Test github HTTPS
|
||||||
|
# TODO: it would be better if we set up a local HTTPS server
|
||||||
|
##############################################
|
||||||
|
testcase "github-https"
|
||||||
|
GIT_SYNC \
|
||||||
|
--one-time \
|
||||||
|
--repo="https://github.com/kubernetes/git-sync" \
|
||||||
|
--branch=e2e-branch \
|
||||||
|
--rev=HEAD \
|
||||||
|
--root="$ROOT" \
|
||||||
|
--dest="link" \
|
||||||
|
> "$DIR"/log."$TESTCASE" 2>&1
|
||||||
|
assert_file_exists "$ROOT"/link/LICENSE
|
||||||
|
# Wrap up
|
||||||
|
pass
|
||||||
|
|
||||||
# Finally...
|
# Finally...
|
||||||
echo
|
echo
|
||||||
echo "all tests passed: cleaning up $DIR"
|
echo "all tests passed: cleaning up $DIR"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue