dockerd: remove patching while building hack

This commit is contained in:
Frederico F. de Oliveira 2021-01-20 22:02:45 +00:00 committed by Yaksh Bariya
parent ff9c666bf7
commit 4f64162a99
No known key found for this signature in database
GPG Key ID: F7486BA7D3D27581
1 changed files with 90 additions and 2 deletions

View File

@ -12,18 +12,106 @@ TERMUX_PKG_CONFFILES="etc/docker/daemon.json"
TERMUX_PKG_BLACKLISTED_ARCHES="x86_64"
termux_step_make() {
files="api/server/middleware/version.go
api/server/router/build/build_routes.go
builder/builder-next/adapters/containerimage/pull.go
builder/builder-next/worker/worker.go
builder/dockerfile/copy.go
builder/dockerfile/dispatchers.go
builder/dockerfile/evaluator.go
builder/dockerfile/imagecontext.go
builder/dockerfile/internals.go
builder/remotecontext/detect.go
cmd/dockerd/config.go
cmd/dockerd/daemon.go
container/container.go
daemon/cluster/cluster.go
daemon/commit.go
daemon/container.go
daemon/create.go
daemon/daemon_unix.go
daemon/exec.go
daemon/exec/exec.go
daemon/health.go
daemon/images/image_builder.go
daemon/images/image_unix.go
daemon/images/service.go
daemon/kill.go
daemon/logger/awslogs/cloudwatchlogs.go
daemon/logger/loggerutils/logfile.go
daemon/start.go
daemon/stats.go
daemon/stats_collector.go
distribution/config.go
distribution/push_v2.go
distribution/xfer/download.go
image/rootfs.go
image/tarexport/load.go
image/tarexport/save.go
layer/filestore_unix.go
libcontainerd/remote/client.go
oci/defaults.go
pkg/archive/archive.go
pkg/archive/diff.go
pkg/platform/platform.go
pkg/system/lcow_unsupported.go
pkg/system/path.go
pkg/tarsum/fileinfosums.go
plugin/v2/plugin_linux.go
runconfig/hostconfig_unix.go
vendor/archive/tar/stat_unix.go
vendor/cloud.google.com/go/compute/metadata/metadata.go
vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go
vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config.go
vendor/github.com/containerd/containerd/archive/tar.go
vendor/github.com/containerd/containerd/client.go
vendor/github.com/containerd/containerd/content/local/writer.go
vendor/github.com/containerd/containerd/install.go
vendor/github.com/containerd/containerd/oci/spec.go
vendor/github.com/containerd/containerd/platforms/database.go
vendor/github.com/containerd/go-runc/io_unix.go
vendor/github.com/docker/go-connections/tlsconfig/certpool_go17.go
vendor/github.com/docker/libnetwork/controller.go
vendor/github.com/docker/swarmkit/manager/manager.go
vendor/github.com/google/certificate-transparency-go/x509/cert_pool.go
vendor/github.com/google/certificate-transparency-go/x509/verify.go
vendor/github.com/mistifyio/go-zfs/utils.go
vendor/github.com/moby/buildkit/solver/llbsolver/ops/file.go
vendor/github.com/moby/buildkit/util/resolver/resolver.go
vendor/github.com/moby/buildkit/util/winlayers/applier.go
vendor/github.com/tonistiigi/fsutil/copy/copy.go
vendor/github.com/tonistiigi/fsutil/followlinks.go
vendor/github.com/tonistiigi/fsutil/stat.go
vendor/github.com/tonistiigi/fsutil/validator.go
vendor/github.com/vbatts/tar-split/archive/tar/stat_unix.go
vendor/go.etcd.io/bbolt/db.go
vendor/golang.org/x/net/internal/socket/sys_posix.go
vendor/golang.org/x/net/ipv4/batch.go
vendor/golang.org/x/net/ipv4/header.go
vendor/golang.org/x/net/ipv6/batch.go
vendor/golang.org/x/net/ipv6/sockopt_posix.go
vendor/golang.org/x/oauth2/google/default.go
vendor/golang.org/x/oauth2/google/sdk.go
vendor/google.golang.org/grpc/credentials/alts/utils.go
vendor/gotest.tools/v3/fs/file.go
vendor/gotest.tools/v3/fs/report.go
volume/mounts/parser.go
volume/mounts/windows_parser.go
volume/service/store.go"
# setup go build environment
termux_setup_golang
# apply some patches in a batch
xargs sed -i "s_\(/etc/docker\)_$PREFIX\1_g" < <(grep -R /etc/docker | cut -d':' -f1 | sort | uniq)
xargs sed -i 's/[a-zA-Z0-9]*\.GOOS/"linux"/g' < <(grep -R '[a-zA-Z0-9]*\.GOOS' | cut -d':' -f1 | sort | uniq)
for file in $files; do
sed -i 's/\("runtime"\)/_ \1/' $file
done
# issue the build command
export DOCKER_GITCOMMIT=8891c58a43
export DOCKER_BUILDTAGS='exclude_graphdriver_btrfs exclude_graphdriver_devicemapper exclude_graphdriver_quota selinux exclude_graphdriver_aufs'
# horrible but effective way to apply patches on the fly while compiling
(while ! IFS='' files=$(AUTO_GOPATH=1 PREFIX='' hack/make.sh dynbinary 2>&1); do echo "error 1: $files"; echo "error 2: $files" 1>&2; if ! xargs sed -i 's/\("runtime"\)/_ \1/' < <(echo $files | grep runtime | cut -d':' -f1 | cut -c38-); then exit 1; fi; done)
AUTO_GOPATH=1 PREFIX='' hack/make.sh dynbinary
}