mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
ce668d6c1e
go1.17.3 (released 2021-11-04) includes security fixes to the archive/zip and debug/macho packages, as well as bug fixes to the compiler, linker, runtime, the go command, the misc/wasm directory, and to the net/http and syscall packages. See the Go 1.17.3 milestone on our issue tracker for details. From the announcement e-mail: [security] Go 1.17.3 and Go 1.16.10 are released We have just released Go versions 1.17.3 and 1.16.10, minor point releases. These minor releases include two security fixes following the security policy: - archive/zip: don't panic on (*Reader).Open Reader.Open (the API implementing io/fs.FS introduced in Go 1.16) can be made to panic by an attacker providing either a crafted ZIP archive containing completely invalid names or an empty filename argument. Thank you to Colin Arnott, SiteHost and Noah Santschi-Cooney, Sourcegraph Code Intelligence Team for reporting this issue. This is CVE-2021-41772 and Go issue golang.org/issue/48085. - debug/macho: invalid dynamic symbol table command can cause panic Malformed binaries parsed using Open or OpenFat can cause a panic when calling ImportedSymbols, due to an out-of-bounds slice operation. Thanks to Burak Çarıkçı - Yunus Yıldırım (CT-Zer0 Crypttech) for reporting this issue. This is CVE-2021-41771 and Go issue golang.org/issue/48990. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
86 lines
3.1 KiB
Text
86 lines
3.1 KiB
Text
ARG GO_VERSION=1.17.3
|
|
|
|
FROM golang:${GO_VERSION}-alpine AS base
|
|
ENV GO111MODULE=off
|
|
RUN apk --no-cache add \
|
|
bash \
|
|
btrfs-progs-dev \
|
|
build-base \
|
|
curl \
|
|
lvm2-dev \
|
|
jq
|
|
|
|
RUN mkdir -p /build/
|
|
RUN mkdir -p /go/src/github.com/docker/docker/
|
|
WORKDIR /go/src/github.com/docker/docker/
|
|
|
|
FROM base AS frozen-images
|
|
# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
|
|
COPY contrib/download-frozen-image-v2.sh /
|
|
RUN /download-frozen-image-v2.sh /build \
|
|
busybox:latest@sha256:95cf004f559831017cdf4628aaf1bb30133677be8702a8c5f2994629f637a209 \
|
|
busybox:latest@sha256:95cf004f559831017cdf4628aaf1bb30133677be8702a8c5f2994629f637a209 \
|
|
debian:bullseye-slim@sha256:dacf278785a4daa9de07596ec739dbc07131e189942772210709c5c0777e8437 \
|
|
hello-world:latest@sha256:d58e752213a51785838f9eed2b7a498ffa1cb3aa7f946dda11af39286c3db9a9 \
|
|
arm32v7/hello-world:latest@sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1
|
|
# See also frozenImages in "testutil/environment/protect.go" (which needs to be updated when adding images to this list)
|
|
|
|
FROM base AS dockercli
|
|
ENV INSTALL_BINARY_NAME=dockercli
|
|
COPY hack/dockerfile/install/install.sh ./install.sh
|
|
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
|
|
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME
|
|
|
|
# Build DockerSuite.TestBuild* dependency
|
|
FROM base AS contrib
|
|
COPY contrib/syscall-test /build/syscall-test
|
|
COPY contrib/httpserver/Dockerfile /build/httpserver/Dockerfile
|
|
COPY contrib/httpserver contrib/httpserver
|
|
RUN CGO_ENABLED=0 go build -buildmode=pie -o /build/httpserver/httpserver github.com/docker/docker/contrib/httpserver
|
|
|
|
# Build the integration tests and copy the resulting binaries to /build/tests
|
|
FROM base AS builder
|
|
|
|
# Set tag and add sources
|
|
COPY . .
|
|
# Copy test sources tests that use assert can print errors
|
|
RUN mkdir -p /build${PWD} && find integration integration-cli -name \*_test.go -exec cp --parents '{}' /build${PWD} \;
|
|
# Build and install test binaries
|
|
ARG DOCKER_GITCOMMIT=undefined
|
|
RUN hack/make.sh build-integration-test-binary
|
|
RUN mkdir -p /build/tests && find . -name test.main -exec cp --parents '{}' /build/tests \;
|
|
|
|
## Generate testing image
|
|
FROM alpine:3.10 as runner
|
|
|
|
ENV DOCKER_REMOTE_DAEMON=1
|
|
ENV DOCKER_INTEGRATION_DAEMON_DEST=/
|
|
ENTRYPOINT ["/scripts/run.sh"]
|
|
|
|
# Add an unprivileged user to be used for tests which need it
|
|
RUN addgroup docker && adduser -D -G docker unprivilegeduser -s /bin/ash
|
|
|
|
# GNU tar is used for generating the emptyfs image
|
|
RUN apk --no-cache add \
|
|
bash \
|
|
ca-certificates \
|
|
g++ \
|
|
git \
|
|
inetutils-ping \
|
|
iptables \
|
|
libcap2-bin \
|
|
pigz \
|
|
tar \
|
|
xz
|
|
|
|
COPY hack/test/e2e-run.sh /scripts/run.sh
|
|
COPY hack/make/.ensure-emptyfs /scripts/ensure-emptyfs.sh
|
|
|
|
COPY integration/testdata /tests/integration/testdata
|
|
COPY integration/build/testdata /tests/integration/build/testdata
|
|
COPY integration-cli/fixtures /tests/integration-cli/fixtures
|
|
|
|
COPY --from=frozen-images /build/ /docker-frozen-images
|
|
COPY --from=dockercli /build/ /usr/bin/
|
|
COPY --from=contrib /build/ /tests/contrib/
|
|
COPY --from=builder /build/ /
|