From afd6487b2e1e8be17856e7fe1eac09ac08c3d2f1 Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Mon, 21 Jul 2025 09:30:05 -0700 Subject: [PATCH] Create github.com/moby/moby/api module Signed-off-by: Derek McGowan --- api/go.mod | 16 + api/go.sum | 47 + api/types/backend/backend.go | 4 +- api/types/backend/build.go | 4 +- api/types/build/build.go | 4 +- api/types/build/cache.go | 2 +- api/types/container/commit.go | 2 +- api/types/container/config.go | 2 +- api/types/container/container.go | 4 +- api/types/container/create_request.go | 2 +- api/types/container/exec.go | 2 +- api/types/container/hostconfig.go | 8 +- api/types/container/hostconfig_unix.go | 2 +- api/types/container/hostconfig_windows.go | 2 +- api/types/container/network_settings.go | 2 +- api/types/container/options.go | 2 +- api/types/events/events.go | 2 +- api/types/filters/parse.go | 2 +- api/types/image/image_inspect.go | 4 +- api/types/image/opts.go | 2 +- api/types/network/network.go | 2 +- api/types/registry/search.go | 2 +- api/types/swarm/config.go | 2 +- api/types/swarm/container.go | 4 +- api/types/swarm/network.go | 2 +- api/types/swarm/node.go | 2 +- api/types/swarm/secret.go | 2 +- api/types/swarm/service.go | 2 +- api/types/swarm/task.go | 4 +- api/types/system/disk_usage.go | 8 +- api/types/system/info.go | 6 +- api/types/types.go | 10 +- api/types/volume/cluster_volume.go | 2 +- api/types/volume/options.go | 2 +- client/auth.go | 2 +- client/build_prune.go | 4 +- client/checkpoint.go | 2 +- client/checkpoint_create.go | 2 +- client/checkpoint_create_test.go | 2 +- client/checkpoint_delete.go | 2 +- client/checkpoint_delete_test.go | 2 +- client/checkpoint_list.go | 2 +- client/checkpoint_list_test.go | 2 +- client/client.go | 6 +- client/client_interfaces.go | 22 +- client/client_mock_test.go | 2 +- client/client_test.go | 2 +- client/config_create.go | 2 +- client/config_create_test.go | 2 +- client/config_inspect.go | 2 +- client/config_inspect_test.go | 2 +- client/config_list.go | 4 +- client/config_list_test.go | 4 +- client/config_update.go | 2 +- client/config_update_test.go | 2 +- client/container_attach.go | 4 +- client/container_commit.go | 2 +- client/container_commit_test.go | 2 +- client/container_copy.go | 2 +- client/container_copy_test.go | 2 +- client/container_create.go | 6 +- client/container_create_test.go | 2 +- client/container_diff.go | 2 +- client/container_diff_test.go | 2 +- client/container_exec.go | 6 +- client/container_exec_test.go | 2 +- client/container_inspect.go | 2 +- client/container_inspect_test.go | 2 +- client/container_list.go | 4 +- client/container_list_test.go | 4 +- client/container_logs.go | 4 +- client/container_logs_test.go | 2 +- client/container_prune.go | 4 +- client/container_prune_test.go | 4 +- client/container_remove.go | 2 +- client/container_remove_test.go | 2 +- client/container_resize.go | 2 +- client/container_resize_test.go | 2 +- client/container_restart.go | 4 +- client/container_restart_test.go | 2 +- client/container_start.go | 2 +- client/container_start_test.go | 2 +- client/container_stats.go | 2 +- client/container_stop.go | 4 +- client/container_stop_test.go | 2 +- client/container_top.go | 2 +- client/container_top_test.go | 2 +- client/container_update.go | 2 +- client/container_update_test.go | 2 +- client/container_wait.go | 4 +- client/container_wait_test.go | 2 +- client/disk_usage.go | 2 +- client/disk_usage_test.go | 2 +- client/distribution_inspect.go | 2 +- client/errors.go | 2 +- client/events.go | 6 +- client/events_test.go | 4 +- client/hijack.go | 4 +- client/hijack_test.go | 2 +- client/image_build.go | 6 +- client/image_build_test.go | 6 +- client/image_create.go | 4 +- client/image_create_test.go | 4 +- client/image_history.go | 2 +- client/image_history_opts.go | 2 +- client/image_history_test.go | 2 +- client/image_import.go | 2 +- client/image_import_test.go | 2 +- client/image_inspect.go | 2 +- client/image_inspect_opts.go | 2 +- client/image_inspect_test.go | 2 +- client/image_list.go | 6 +- client/image_list_test.go | 4 +- client/image_load.go | 2 +- client/image_load_opts.go | 2 +- client/image_prune.go | 4 +- client/image_prune_test.go | 4 +- client/image_pull.go | 2 +- client/image_pull_test.go | 4 +- client/image_push.go | 4 +- client/image_push_test.go | 4 +- client/image_remove.go | 2 +- client/image_remove_test.go | 2 +- client/image_save_opts.go | 2 +- client/image_search.go | 4 +- client/image_search_test.go | 4 +- client/info.go | 2 +- client/info_test.go | 2 +- client/login.go | 2 +- client/network_connect.go | 2 +- client/network_connect_test.go | 2 +- client/network_create.go | 4 +- client/network_create_test.go | 2 +- client/network_disconnect.go | 2 +- client/network_disconnect_test.go | 2 +- client/network_inspect.go | 2 +- client/network_inspect_test.go | 2 +- client/network_list.go | 4 +- client/network_list_test.go | 4 +- client/network_prune.go | 4 +- client/network_prune_test.go | 4 +- client/node_inspect.go | 2 +- client/node_inspect_test.go | 2 +- client/node_list.go | 4 +- client/node_list_test.go | 4 +- client/node_remove.go | 2 +- client/node_remove_test.go | 2 +- client/node_update.go | 2 +- client/node_update_test.go | 2 +- client/ping.go | 6 +- client/ping_test.go | 2 +- client/plugin_create.go | 2 +- client/plugin_disable.go | 2 +- client/plugin_disable_test.go | 2 +- client/plugin_enable.go | 2 +- client/plugin_enable_test.go | 2 +- client/plugin_inspect.go | 2 +- client/plugin_inspect_test.go | 2 +- client/plugin_install.go | 4 +- client/plugin_list.go | 4 +- client/plugin_list_test.go | 4 +- client/plugin_push.go | 2 +- client/plugin_push_test.go | 2 +- client/plugin_remove.go | 2 +- client/plugin_remove_test.go | 2 +- client/plugin_upgrade.go | 4 +- client/request.go | 2 +- client/request_test.go | 4 +- client/secret_create.go | 2 +- client/secret_create_test.go | 2 +- client/secret_inspect.go | 2 +- client/secret_inspect_test.go | 2 +- client/secret_list.go | 4 +- client/secret_list_test.go | 4 +- client/secret_update.go | 2 +- client/secret_update_test.go | 2 +- client/service_create.go | 6 +- client/service_create_test.go | 4 +- client/service_inspect.go | 2 +- client/service_inspect_test.go | 2 +- client/service_list.go | 4 +- client/service_list_test.go | 4 +- client/service_logs.go | 4 +- client/service_logs_test.go | 2 +- client/service_update.go | 6 +- client/service_update_test.go | 2 +- client/swarm_get_unlock_key.go | 2 +- client/swarm_get_unlock_key_test.go | 2 +- client/swarm_init.go | 2 +- client/swarm_init_test.go | 2 +- client/swarm_inspect.go | 2 +- client/swarm_inspect_test.go | 2 +- client/swarm_join.go | 2 +- client/swarm_join_test.go | 2 +- client/swarm_unlock.go | 2 +- client/swarm_unlock_test.go | 2 +- client/swarm_update.go | 2 +- client/swarm_update_test.go | 2 +- client/task_inspect.go | 2 +- client/task_inspect_test.go | 2 +- client/task_list.go | 4 +- client/task_list_test.go | 4 +- client/task_logs.go | 4 +- client/utils.go | 2 +- client/version.go | 2 +- client/volume_create.go | 2 +- client/volume_create_test.go | 2 +- client/volume_inspect.go | 2 +- client/volume_inspect_test.go | 2 +- client/volume_list.go | 4 +- client/volume_list_test.go | 4 +- client/volume_prune.go | 4 +- client/volume_remove.go | 2 +- client/volume_update.go | 4 +- client/volume_update_test.go | 4 +- daemon/archive.go | 2 +- daemon/archive_unix.go | 4 +- daemon/archive_windows.go | 4 +- daemon/attach.go | 6 +- daemon/auth.go | 2 +- daemon/build.go | 2 +- daemon/builder/backend/backend.go | 6 +- daemon/builder/builder.go | 4 +- daemon/builder/dockerfile/builder.go | 6 +- daemon/builder/dockerfile/containerbackend.go | 4 +- daemon/builder/dockerfile/dispatchers_test.go | 6 +- daemon/builder/dockerfile/dispatchers_unix.go | 2 +- .../builder/dockerfile/dispatchers_windows.go | 2 +- daemon/builder/dockerfile/evaluator.go | 2 +- daemon/builder/dockerfile/imagecontext.go | 2 +- daemon/builder/dockerfile/imageprobe.go | 2 +- daemon/builder/dockerfile/internals.go | 8 +- .../dockerfile/internals_linux_test.go | 2 +- daemon/builder/dockerfile/internals_test.go | 6 +- .../builder/dockerfile/internals_windows.go | 4 +- daemon/builder/dockerfile/mockbackend_test.go | 4 +- daemon/builder/remotecontext/detect.go | 2 +- daemon/cdi.go | 2 +- daemon/checkpoint.go | 4 +- daemon/cluster.go | 4 +- daemon/cluster/cluster.go | 4 +- daemon/cluster/configs.go | 2 +- .../cluster/controllers/plugin/controller.go | 8 +- .../controllers/plugin/controller_test.go | 8 +- daemon/cluster/convert/config.go | 2 +- daemon/cluster/convert/container.go | 6 +- daemon/cluster/convert/network.go | 4 +- daemon/cluster/convert/node.go | 2 +- daemon/cluster/convert/node_test.go | 2 +- daemon/cluster/convert/secret.go | 2 +- daemon/cluster/convert/service.go | 4 +- daemon/cluster/convert/service_test.go | 8 +- daemon/cluster/convert/swarm.go | 2 +- daemon/cluster/convert/task.go | 2 +- daemon/cluster/convert/volume.go | 2 +- daemon/cluster/convert/volume_test.go | 2 +- daemon/cluster/executor/backend.go | 18 +- daemon/cluster/executor/container/adapter.go | 10 +- .../cluster/executor/container/container.go | 12 +- .../executor/container/container_test.go | 4 +- .../cluster/executor/container/controller.go | 4 +- daemon/cluster/executor/container/executor.go | 6 +- .../cluster/executor/container/health_test.go | 4 +- daemon/cluster/filters.go | 2 +- daemon/cluster/filters_test.go | 2 +- daemon/cluster/networks.go | 6 +- daemon/cluster/noderunner.go | 2 +- daemon/cluster/nodes.go | 2 +- daemon/cluster/provider/network.go | 2 +- daemon/cluster/secrets.go | 2 +- daemon/cluster/services.go | 10 +- daemon/cluster/swarm.go | 8 +- daemon/cluster/tasks.go | 4 +- daemon/cluster/volumes.go | 2 +- daemon/commit.go | 6 +- daemon/config/builder.go | 2 +- daemon/config/builder_test.go | 2 +- daemon/config/config.go | 4 +- daemon/config/config_linux.go | 4 +- daemon/config/config_linux_test.go | 2 +- daemon/config/opts.go | 2 +- daemon/configs.go | 2 +- daemon/container.go | 6 +- daemon/container/archive_windows.go | 2 +- daemon/container/container.go | 8 +- daemon/container/container_test.go | 4 +- daemon/container/container_unix.go | 8 +- daemon/container/container_windows.go | 6 +- daemon/container/health.go | 2 +- daemon/container/state.go | 2 +- daemon/container/state_test.go | 2 +- daemon/container/view.go | 4 +- daemon/container/view_test.go | 2 +- daemon/container_operations.go | 6 +- daemon/container_operations_test.go | 4 +- daemon/container_unix_test.go | 2 +- daemon/containerd/cache.go | 4 +- daemon/containerd/image.go | 2 +- daemon/containerd/image_builder.go | 8 +- daemon/containerd/image_commit.go | 2 +- daemon/containerd/image_delete.go | 4 +- daemon/containerd/image_delete_test.go | 2 +- daemon/containerd/image_events.go | 4 +- daemon/containerd/image_exporter.go | 2 +- daemon/containerd/image_history.go | 2 +- daemon/containerd/image_import.go | 4 +- daemon/containerd/image_import_test.go | 2 +- daemon/containerd/image_inspect.go | 6 +- daemon/containerd/image_inspect_test.go | 2 +- daemon/containerd/image_list.go | 8 +- daemon/containerd/image_list_test.go | 2 +- daemon/containerd/image_prune.go | 4 +- daemon/containerd/image_pull.go | 4 +- daemon/containerd/image_push.go | 6 +- daemon/containerd/image_tag.go | 2 +- daemon/containerd/imagespec.go | 2 +- daemon/containerd/resolver.go | 2 +- daemon/containerfs_linux.go | 2 +- daemon/create.go | 8 +- daemon/create_unix.go | 4 +- daemon/create_windows.go | 2 +- daemon/daemon.go | 14 +- daemon/daemon_linux_test.go | 2 +- daemon/daemon_test.go | 2 +- daemon/daemon_unix.go | 6 +- daemon/daemon_unix_test.go | 4 +- daemon/daemon_windows.go | 4 +- daemon/delete.go | 6 +- daemon/delete_test.go | 4 +- daemon/devices.go | 4 +- daemon/disk_usage.go | 10 +- daemon/events.go | 4 +- daemon/events/events.go | 2 +- daemon/events/events_test.go | 4 +- daemon/events/filter.go | 4 +- daemon/events/testutils/testutils.go | 4 +- daemon/events_test.go | 4 +- daemon/exec.go | 6 +- daemon/exec_linux_test.go | 2 +- daemon/export.go | 2 +- daemon/health.go | 6 +- daemon/health_test.go | 4 +- daemon/image_service.go | 10 +- daemon/images/cache.go | 2 +- daemon/images/image.go | 2 +- daemon/images/image_builder.go | 4 +- daemon/images/image_commit.go | 4 +- daemon/images/image_delete.go | 6 +- daemon/images/image_events.go | 4 +- daemon/images/image_history.go | 4 +- daemon/images/image_import.go | 4 +- daemon/images/image_inspect.go | 6 +- daemon/images/image_list.go | 6 +- daemon/images/image_prune.go | 8 +- daemon/images/image_pull.go | 4 +- daemon/images/image_push.go | 4 +- daemon/images/image_tag.go | 2 +- daemon/images/imagespec.go | 2 +- daemon/info.go | 4 +- daemon/info_unix.go | 6 +- daemon/info_windows.go | 4 +- daemon/inspect.go | 6 +- daemon/inspect_linux.go | 4 +- daemon/inspect_test.go | 2 +- daemon/inspect_windows.go | 4 +- daemon/internal/builder-next/builder.go | 10 +- daemon/internal/builder-next/controller.go | 4 +- .../internal/restartmanager/restartmanager.go | 2 +- .../restartmanager/restartmanager_test.go | 2 +- daemon/kill.go | 4 +- daemon/libnetwork/cluster/provider.go | 2 +- daemon/libnetwork/controller_linux.go | 2 +- daemon/libnetwork/controller_others.go | 2 +- daemon/licensing.go | 2 +- daemon/licensing_test.go | 2 +- daemon/list.go | 6 +- daemon/list_test.go | 4 +- daemon/logger/adapter.go | 2 +- daemon/logger/adapter_test.go | 2 +- daemon/logger/copier.go | 2 +- daemon/logger/factory.go | 2 +- daemon/logger/journald/read.go | 2 +- daemon/logger/jsonfilelog/read.go | 2 +- daemon/logger/local/local.go | 4 +- daemon/logger/local/local_test.go | 4 +- daemon/logger/local/read.go | 2 +- daemon/logger/logger.go | 2 +- daemon/logger/logger_test.go | 2 +- daemon/logger/loggertest/logreader.go | 2 +- .../logger/loggerutils/cache/local_cache.go | 2 +- .../logger/loggerutils/logfile_race_test.go | 2 +- daemon/logger/plugin.go | 2 +- daemon/logs.go | 6 +- daemon/logs_test.go | 2 +- daemon/migration.go | 2 +- daemon/monitor.go | 4 +- daemon/mounts.go | 2 +- daemon/network.go | 10 +- daemon/network/filter.go | 4 +- daemon/network/filter_test.go | 4 +- daemon/network/network_mode_unix.go | 4 +- daemon/network/network_mode_windows.go | 4 +- daemon/network/settings.go | 2 +- daemon/oci_linux.go | 2 +- daemon/oci_linux_test.go | 2 +- daemon/oci_windows.go | 4 +- daemon/oci_windows_test.go | 2 +- daemon/pause.go | 2 +- daemon/pkg/opts/runtime.go | 2 +- daemon/pkg/opts/ulimit.go | 2 +- daemon/pkg/opts/ulimit_test.go | 2 +- daemon/pkg/plugin/backend_linux.go | 10 +- daemon/pkg/plugin/backend_unsupported.go | 8 +- daemon/pkg/plugin/events.go | 2 +- daemon/pkg/plugin/fetch_linux.go | 2 +- daemon/pkg/plugin/manager.go | 4 +- daemon/pkg/plugin/manager_linux.go | 2 +- daemon/pkg/plugin/manager_linux_test.go | 6 +- daemon/pkg/plugin/manager_test.go | 2 +- daemon/pkg/plugin/registry.go | 2 +- daemon/pkg/plugin/store_test.go | 2 +- daemon/pkg/plugin/v2/plugin.go | 2 +- daemon/pkg/plugin/v2/plugin_linux.go | 2 +- daemon/prune.go | 12 +- daemon/reload.go | 2 +- daemon/rename.go | 2 +- daemon/resize.go | 2 +- daemon/restart.go | 4 +- daemon/runtime_unix_test.go | 2 +- daemon/seccomp_linux_test.go | 2 +- daemon/secrets.go | 2 +- daemon/server/httputils/decoder.go | 4 +- daemon/server/httputils/write_log_stream.go | 4 +- daemon/server/middleware/version.go | 4 +- daemon/server/middleware/version_test.go | 2 +- daemon/server/router/build/backend.go | 4 +- daemon/server/router/build/build.go | 2 +- daemon/server/router/build/build_routes.go | 12 +- daemon/server/router/checkpoint/backend.go | 2 +- .../router/checkpoint/checkpoint_routes.go | 2 +- daemon/server/router/container/backend.go | 6 +- .../router/container/container_routes.go | 14 +- .../router/container/container_routes_test.go | 4 +- daemon/server/router/container/copy.go | 2 +- daemon/server/router/container/exec.go | 8 +- daemon/server/router/container/inspect.go | 6 +- daemon/server/router/distribution/backend.go | 2 +- .../distribution/distribution_routes.go | 2 +- daemon/server/router/image/backend.go | 8 +- daemon/server/router/image/image_routes.go | 10 +- .../server/router/image/inspect_response.go | 2 +- .../router/image/inspect_response_test.go | 2 +- daemon/server/router/network/backend.go | 6 +- .../server/router/network/network_routes.go | 8 +- daemon/server/router/plugin/backend.go | 8 +- daemon/server/router/plugin/plugin_routes.go | 8 +- daemon/server/router/swarm/backend.go | 6 +- daemon/server/router/swarm/cluster_routes.go | 10 +- daemon/server/router/swarm/helpers.go | 10 +- daemon/server/router/swarm/helpers_test.go | 6 +- daemon/server/router/system/backend.go | 14 +- daemon/server/router/system/info_response.go | 2 +- .../router/system/info_response_test.go | 2 +- daemon/server/router/system/system_routes.go | 18 +- daemon/server/router/volume/backend.go | 4 +- daemon/server/router/volume/volume_routes.go | 6 +- .../router/volume/volume_routes_test.go | 4 +- daemon/server/server.go | 4 +- daemon/server/server_test.go | 2 +- daemon/start.go | 4 +- daemon/stats.go | 4 +- daemon/stats/collector.go | 2 +- daemon/stats_unix.go | 2 +- daemon/stats_windows.go | 2 +- daemon/stop.go | 4 +- daemon/top_unix.go | 4 +- daemon/top_windows.go | 2 +- daemon/unpause.go | 2 +- daemon/update.go | 4 +- daemon/update_linux.go | 2 +- daemon/update_linux_test.go | 2 +- daemon/update_windows.go | 2 +- daemon/volume/mounts/lcow_parser.go | 2 +- daemon/volume/mounts/lcow_parser_test.go | 2 +- daemon/volume/mounts/linux_parser.go | 2 +- daemon/volume/mounts/linux_parser_test.go | 2 +- daemon/volume/mounts/mounts.go | 2 +- daemon/volume/mounts/parser.go | 2 +- daemon/volume/mounts/parser_test.go | 2 +- daemon/volume/mounts/validate.go | 2 +- daemon/volume/mounts/validate_test.go | 2 +- daemon/volume/mounts/windows_parser.go | 2 +- daemon/volume/mounts/windows_parser_test.go | 2 +- daemon/volume/service/by.go | 2 +- daemon/volume/service/convert.go | 4 +- daemon/volume/service/convert_test.go | 2 +- daemon/volume/service/service.go | 6 +- daemon/volume/service/service_test.go | 4 +- daemon/volume/service/store.go | 2 +- daemon/volumes.go | 8 +- daemon/volumes_linux.go | 2 +- daemon/volumes_linux_test.go | 2 +- daemon/volumes_unix.go | 4 +- daemon/volumes_windows.go | 2 +- daemon/wait.go | 2 +- distribution/config.go | 4 +- distribution/metadata/v2_metadata_service.go | 2 +- distribution/pull.go | 2 +- distribution/pull_v2_test.go | 2 +- distribution/push.go | 2 +- distribution/push_v2.go | 2 +- distribution/push_v2_test.go | 2 +- distribution/registry.go | 2 +- distribution/registry_unit_test.go | 2 +- image/cache/cache.go | 2 +- image/cache/compare.go | 2 +- image/cache/compare_test.go | 2 +- image/image.go | 2 +- image/image_test.go | 2 +- image/tarexport/load.go | 2 +- image/tarexport/save.go | 2 +- image/tarexport/tarexport.go | 2 +- integration-cli/daemon/daemon_swarm.go | 4 +- integration-cli/docker_api_attach_test.go | 4 +- integration-cli/docker_api_build_test.go | 2 +- integration-cli/docker_api_containers_test.go | 6 +- .../docker_api_containers_windows_test.go | 4 +- integration-cli/docker_api_exec_test.go | 2 +- integration-cli/docker_api_images_test.go | 2 +- integration-cli/docker_api_inspect_test.go | 2 +- integration-cli/docker_api_logs_test.go | 2 +- integration-cli/docker_api_network_test.go | 4 +- integration-cli/docker_api_stats_test.go | 4 +- integration-cli/docker_api_swarm_node_test.go | 2 +- .../docker_api_swarm_service_test.go | 2 +- integration-cli/docker_api_swarm_test.go | 6 +- integration-cli/docker_api_test.go | 2 +- integration-cli/docker_cli_build_test.go | 2 +- integration-cli/docker_cli_build_unix_test.go | 2 +- integration-cli/docker_cli_by_digest_test.go | 2 +- integration-cli/docker_cli_daemon_test.go | 2 +- integration-cli/docker_cli_events_test.go | 4 +- .../docker_cli_external_volume_driver_test.go | 4 +- integration-cli/docker_cli_health_test.go | 2 +- integration-cli/docker_cli_inspect_test.go | 4 +- .../docker_cli_network_unix_test.go | 4 +- integration-cli/docker_cli_plugins_test.go | 2 +- integration-cli/docker_cli_push_test.go | 2 +- integration-cli/docker_cli_save_load_test.go | 2 +- .../docker_cli_service_create_test.go | 6 +- .../docker_cli_service_health_test.go | 2 +- integration-cli/docker_cli_swarm_test.go | 4 +- integration-cli/docker_cli_swarm_unix_test.go | 2 +- .../docker_cli_update_unix_test.go | 2 +- integration-cli/docker_cli_volume_test.go | 6 +- integration-cli/docker_utils_test.go | 4 +- integration-cli/requirements_test.go | 4 +- .../build/build_cgroupns_linux_test.go | 2 +- integration/build/build_squash_test.go | 4 +- integration/build/build_test.go | 10 +- integration/build/build_userns_linux_test.go | 4 +- .../capabilities/capabilities_linux_test.go | 4 +- integration/config/config_test.go | 6 +- integration/container/attach_test.go | 6 +- integration/container/cdi_test.go | 4 +- integration/container/checkpoint_test.go | 6 +- integration/container/copy_test.go | 4 +- integration/container/create_test.go | 6 +- integration/container/daemon_linux_test.go | 4 +- integration/container/daemon_test.go | 2 +- integration/container/devices_windows_test.go | 2 +- integration/container/diff_test.go | 2 +- integration/container/exec_linux_test.go | 4 +- integration/container/exec_test.go | 4 +- integration/container/export_test.go | 4 +- integration/container/health_test.go | 2 +- integration/container/inspect_test.go | 2 +- integration/container/ipcmode_linux_test.go | 4 +- integration/container/kill_test.go | 2 +- integration/container/links_linux_test.go | 4 +- integration/container/list_test.go | 4 +- integration/container/logs_test.go | 2 +- integration/container/mounts_linux_test.go | 10 +- integration/container/nat_test.go | 2 +- integration/container/overlayfs_linux_test.go | 2 +- integration/container/pause_test.go | 6 +- integration/container/pidmode_linux_test.go | 2 +- integration/container/remove_test.go | 2 +- integration/container/rename_test.go | 4 +- integration/container/resize_test.go | 4 +- integration/container/restart_test.go | 6 +- integration/container/run_linux_test.go | 4 +- integration/container/stats_test.go | 2 +- integration/container/stop_linux_test.go | 2 +- integration/container/stop_test.go | 2 +- integration/container/update_linux_test.go | 2 +- integration/container/update_test.go | 2 +- integration/container/wait_test.go | 2 +- integration/daemon/daemon_linux_test.go | 2 +- integration/daemon/daemon_test.go | 8 +- integration/image/commit_test.go | 2 +- integration/image/import_test.go | 2 +- integration/image/inspect_test.go | 2 +- integration/image/list_test.go | 10 +- integration/image/load_test.go | 2 +- integration/image/prune_test.go | 6 +- integration/image/pull_test.go | 2 +- integration/image/remove_test.go | 4 +- integration/image/save_test.go | 4 +- integration/internal/build/build.go | 4 +- integration/internal/container/container.go | 6 +- integration/internal/container/exec.go | 2 +- integration/internal/container/ops.go | 6 +- integration/internal/container/states.go | 2 +- integration/internal/network/network.go | 2 +- integration/internal/network/ops.go | 2 +- integration/internal/network/states.go | 2 +- integration/internal/swarm/service.go | 8 +- integration/internal/swarm/states.go | 4 +- .../network/bridge/bridge_linux_test.go | 6 +- .../iptablesdoc/iptablesdoc_linux_test.go | 6 +- .../nftablesdoc/nftablesdoc_linux_test.go | 6 +- integration/network/delete_test.go | 2 +- integration/network/dns_test.go | 2 +- integration/network/helpers.go | 2 +- integration/network/helpers_windows.go | 2 +- integration/network/inspect_test.go | 2 +- integration/network/ipvlan/ipvlan_test.go | 4 +- integration/network/macvlan/macvlan_test.go | 4 +- integration/network/network_linux_test.go | 6 +- integration/network/network_test.go | 2 +- integration/network/overlay/overlay_test.go | 6 +- integration/network/service_test.go | 6 +- integration/networking/bridge_linux_test.go | 4 +- integration/networking/etchosts_test.go | 2 +- integration/networking/mac_addr_test.go | 2 +- integration/networking/nat_windows_test.go | 2 +- .../networking/port_mapping_linux_test.go | 4 +- integration/networking/resolvconf_test.go | 4 +- integration/plugin/authz/authz_plugin_test.go | 6 +- .../plugin/authz/authz_plugin_v2_test.go | 6 +- integration/plugin/common/plugin_test.go | 6 +- integration/plugin/logging/helpers_test.go | 2 +- .../plugin/logging/logging_linux_test.go | 4 +- integration/plugin/logging/read_test.go | 4 +- integration/plugin/logging/validation_test.go | 2 +- integration/plugin/volumes/helpers_test.go | 2 +- integration/plugin/volumes/mounts_test.go | 2 +- integration/secret/secret_test.go | 6 +- integration/service/create_test.go | 6 +- integration/service/inspect_test.go | 4 +- integration/service/jobs_test.go | 2 +- integration/service/list_test.go | 4 +- integration/service/network_linux_test.go | 6 +- integration/service/plugin_test.go | 8 +- integration/service/update_test.go | 8 +- .../system/cgroupdriver_systemd_test.go | 2 +- integration/system/disk_usage_test.go | 10 +- integration/system/event_test.go | 10 +- integration/system/info_test.go | 2 +- integration/system/login_test.go | 2 +- integration/system/ping_test.go | 4 +- integration/volume/mount_test.go | 14 +- integration/volume/volume_test.go | 6 +- registry/auth.go | 2 +- registry/auth_test.go | 2 +- registry/config.go | 2 +- registry/registry_mock_test.go | 2 +- registry/registry_test.go | 2 +- registry/search.go | 4 +- registry/search_endpoint_v1.go | 2 +- registry/search_endpoint_v1_test.go | 2 +- registry/search_session.go | 2 +- registry/search_test.go | 4 +- registry/service.go | 2 +- registry/types.go | 2 +- runconfig/config.go | 4 +- runconfig/config_test.go | 2 +- runconfig/hostconfig.go | 2 +- runconfig/hostconfig_test.go | 2 +- runconfig/hostconfig_unix.go | 2 +- runconfig/hostconfig_windows.go | 2 +- testutil/daemon/config.go | 2 +- testutil/daemon/container.go | 2 +- testutil/daemon/daemon.go | 4 +- testutil/daemon/node.go | 2 +- testutil/daemon/plugin.go | 2 +- testutil/daemon/secret.go | 2 +- testutil/daemon/service.go | 4 +- testutil/daemon/swarm.go | 2 +- testutil/environment/clean.go | 12 +- testutil/environment/environment.go | 8 +- testutil/environment/protect.go | 10 +- testutil/fakestorage/fixtures.go | 2 +- testutil/fakestorage/storage.go | 6 +- testutil/fixtures/load/frozen.go | 2 +- testutil/fixtures/plugin/plugin.go | 6 +- vendor.mod | 3 + vendor/github.com/moby/moby/api/README.md | 42 + vendor/github.com/moby/moby/api/common.go | 22 + .../github.com/moby/moby/api/swagger-gen.yaml | 12 + vendor/github.com/moby/moby/api/swagger.yaml | 13431 ++++++++++++++++ .../moby/moby/api/types/auxprogress/push.go | 26 + .../moby/moby/api/types/backend/backend.go | 191 + .../moby/moby/api/types/backend/build.go | 50 + .../moby/moby/api/types/blkiodev/blkio.go | 23 + .../moby/moby/api/types/build/build.go | 91 + .../moby/moby/api/types/build/cache.go | 52 + .../moby/moby/api/types/build/disk_usage.go | 8 + .../moby/moby/api/types/checkpoint/list.go | 7 + .../moby/moby/api/types/checkpoint/options.go | 19 + .../github.com/moby/moby/api/types/client.go | 85 + .../moby/moby/api/types/common/id_response.go | 13 + .../moby/api/types/container/change_type.go | 15 + .../moby/api/types/container/change_types.go | 23 + .../moby/moby/api/types/container/commit.go | 7 + .../moby/moby/api/types/container/config.go | 73 + .../moby/api/types/container/container.go | 178 + .../api/types/container/create_request.go | 13 + .../api/types/container/create_response.go | 19 + .../moby/api/types/container/disk_usage.go | 8 + .../moby/moby/api/types/container/errors.go | 9 + .../moby/moby/api/types/container/exec.go | 53 + .../api/types/container/filesystem_change.go | 19 + .../moby/moby/api/types/container/health.go | 50 + .../moby/api/types/container/hostconfig.go | 501 + .../api/types/container/hostconfig_unix.go | 45 + .../api/types/container/hostconfig_windows.go | 47 + .../api/types/container/network_settings.go | 56 + .../moby/moby/api/types/container/options.go | 67 + .../moby/moby/api/types/container/port.go | 23 + .../moby/moby/api/types/container/state.go | 64 + .../moby/moby/api/types/container/stats.go | 177 + .../moby/api/types/container/top_response.go | 18 + .../api/types/container/update_response.go | 14 + .../api/types/container/wait_exit_error.go | 12 + .../moby/api/types/container/wait_response.go | 18 + .../moby/api/types/container/waitcondition.go | 22 + .../moby/moby/api/types/error_response.go | 13 + .../moby/moby/api/types/error_response_ext.go | 6 + .../moby/moby/api/types/events/events.go | 139 + .../moby/moby/api/types/filters/errors.go | 24 + .../moby/moby/api/types/filters/parse.go | 336 + .../moby/api/types/image/delete_response.go | 15 + .../moby/moby/api/types/image/disk_usage.go | 8 + .../moby/moby/api/types/image/image.go | 47 + .../moby/api/types/image/image_history.go | 36 + .../moby/api/types/image/image_inspect.go | 142 + .../moby/moby/api/types/image/manifest.go | 99 + .../moby/moby/api/types/image/opts.go | 124 + .../moby/moby/api/types/image/summary.go | 101 + .../moby/moby/api/types/mount/mount.go | 157 + .../moby/api/types/network/create_response.go | 19 + .../moby/moby/api/types/network/endpoint.go | 151 + .../moby/moby/api/types/network/ipam.go | 173 + .../moby/moby/api/types/network/network.go | 168 + .../github.com/moby/moby/api/types/plugin.go | 203 + .../moby/moby/api/types/plugin_device.go | 25 + .../moby/moby/api/types/plugin_env.go | 25 + .../moby/api/types/plugin_interface_type.go | 21 + .../moby/moby/api/types/plugin_mount.go | 37 + .../moby/moby/api/types/plugin_responses.go | 71 + .../api/types/plugins/logdriver/entry.pb.go | 755 + .../api/types/plugins/logdriver/entry.proto | 16 + .../moby/api/types/plugins/logdriver/gen.go | 3 + .../moby/api/types/plugins/logdriver/io.go | 87 + .../moby/api/types/registry/authconfig.go | 128 + .../moby/api/types/registry/authenticate.go | 21 + .../moby/moby/api/types/registry/registry.go | 119 + .../moby/moby/api/types/registry/search.go | 48 + .../moby/api/types/storage/driver_data.go | 23 + .../moby/moby/api/types/strslice/strslice.go | 30 + .../moby/moby/api/types/swarm/common.go | 48 + .../moby/moby/api/types/swarm/config.go | 62 + .../moby/moby/api/types/swarm/container.go | 119 + .../moby/moby/api/types/swarm/network.go | 121 + .../moby/moby/api/types/swarm/node.go | 151 + .../moby/moby/api/types/swarm/runtime.go | 27 + .../moby/moby/api/types/swarm/runtime/gen.go | 3 + .../moby/api/types/swarm/runtime/plugin.pb.go | 808 + .../moby/api/types/swarm/runtime/plugin.proto | 19 + .../moby/moby/api/types/swarm/secret.go | 66 + .../moby/moby/api/types/swarm/service.go | 272 + .../types/swarm/service_create_response.go | 20 + .../types/swarm/service_update_response.go | 12 + .../moby/moby/api/types/swarm/swarm.go | 244 + .../moby/moby/api/types/swarm/task.go | 231 + .../moby/moby/api/types/system/disk_usage.go | 17 + .../moby/moby/api/types/system/info.go | 170 + .../moby/moby/api/types/system/runtime.go | 20 + .../moby/api/types/system/security_opts.go | 48 + .../moby/moby/api/types/time/timestamp.go | 131 + .../github.com/moby/moby/api/types/types.go | 103 + .../moby/moby/api/types/versions/compare.go | 65 + .../moby/api/types/volume/cluster_volume.go | 420 + .../moby/api/types/volume/create_options.go | 29 + .../moby/moby/api/types/volume/disk_usage.go | 8 + .../moby/api/types/volume/list_response.go | 18 + .../moby/moby/api/types/volume/options.go | 15 + .../moby/moby/api/types/volume/volume.go | 75 + .../moby/api/types/volume/volume_update.go | 7 + vendor/golang.org/x/mod/modfile/print.go | 184 - vendor/golang.org/x/mod/modfile/read.go | 964 -- vendor/golang.org/x/mod/modfile/rule.go | 1836 --- vendor/golang.org/x/mod/modfile/work.go | 335 - vendor/modules.txt | 28 +- 806 files changed, 23628 insertions(+), 4553 deletions(-) create mode 100644 api/go.mod create mode 100644 api/go.sum create mode 100644 vendor/github.com/moby/moby/api/README.md create mode 100644 vendor/github.com/moby/moby/api/common.go create mode 100644 vendor/github.com/moby/moby/api/swagger-gen.yaml create mode 100644 vendor/github.com/moby/moby/api/swagger.yaml create mode 100644 vendor/github.com/moby/moby/api/types/auxprogress/push.go create mode 100644 vendor/github.com/moby/moby/api/types/backend/backend.go create mode 100644 vendor/github.com/moby/moby/api/types/backend/build.go create mode 100644 vendor/github.com/moby/moby/api/types/blkiodev/blkio.go create mode 100644 vendor/github.com/moby/moby/api/types/build/build.go create mode 100644 vendor/github.com/moby/moby/api/types/build/cache.go create mode 100644 vendor/github.com/moby/moby/api/types/build/disk_usage.go create mode 100644 vendor/github.com/moby/moby/api/types/checkpoint/list.go create mode 100644 vendor/github.com/moby/moby/api/types/checkpoint/options.go create mode 100644 vendor/github.com/moby/moby/api/types/client.go create mode 100644 vendor/github.com/moby/moby/api/types/common/id_response.go create mode 100644 vendor/github.com/moby/moby/api/types/container/change_type.go create mode 100644 vendor/github.com/moby/moby/api/types/container/change_types.go create mode 100644 vendor/github.com/moby/moby/api/types/container/commit.go create mode 100644 vendor/github.com/moby/moby/api/types/container/config.go create mode 100644 vendor/github.com/moby/moby/api/types/container/container.go create mode 100644 vendor/github.com/moby/moby/api/types/container/create_request.go create mode 100644 vendor/github.com/moby/moby/api/types/container/create_response.go create mode 100644 vendor/github.com/moby/moby/api/types/container/disk_usage.go create mode 100644 vendor/github.com/moby/moby/api/types/container/errors.go create mode 100644 vendor/github.com/moby/moby/api/types/container/exec.go create mode 100644 vendor/github.com/moby/moby/api/types/container/filesystem_change.go create mode 100644 vendor/github.com/moby/moby/api/types/container/health.go create mode 100644 vendor/github.com/moby/moby/api/types/container/hostconfig.go create mode 100644 vendor/github.com/moby/moby/api/types/container/hostconfig_unix.go create mode 100644 vendor/github.com/moby/moby/api/types/container/hostconfig_windows.go create mode 100644 vendor/github.com/moby/moby/api/types/container/network_settings.go create mode 100644 vendor/github.com/moby/moby/api/types/container/options.go create mode 100644 vendor/github.com/moby/moby/api/types/container/port.go create mode 100644 vendor/github.com/moby/moby/api/types/container/state.go create mode 100644 vendor/github.com/moby/moby/api/types/container/stats.go create mode 100644 vendor/github.com/moby/moby/api/types/container/top_response.go create mode 100644 vendor/github.com/moby/moby/api/types/container/update_response.go create mode 100644 vendor/github.com/moby/moby/api/types/container/wait_exit_error.go create mode 100644 vendor/github.com/moby/moby/api/types/container/wait_response.go create mode 100644 vendor/github.com/moby/moby/api/types/container/waitcondition.go create mode 100644 vendor/github.com/moby/moby/api/types/error_response.go create mode 100644 vendor/github.com/moby/moby/api/types/error_response_ext.go create mode 100644 vendor/github.com/moby/moby/api/types/events/events.go create mode 100644 vendor/github.com/moby/moby/api/types/filters/errors.go create mode 100644 vendor/github.com/moby/moby/api/types/filters/parse.go create mode 100644 vendor/github.com/moby/moby/api/types/image/delete_response.go create mode 100644 vendor/github.com/moby/moby/api/types/image/disk_usage.go create mode 100644 vendor/github.com/moby/moby/api/types/image/image.go create mode 100644 vendor/github.com/moby/moby/api/types/image/image_history.go create mode 100644 vendor/github.com/moby/moby/api/types/image/image_inspect.go create mode 100644 vendor/github.com/moby/moby/api/types/image/manifest.go create mode 100644 vendor/github.com/moby/moby/api/types/image/opts.go create mode 100644 vendor/github.com/moby/moby/api/types/image/summary.go create mode 100644 vendor/github.com/moby/moby/api/types/mount/mount.go create mode 100644 vendor/github.com/moby/moby/api/types/network/create_response.go create mode 100644 vendor/github.com/moby/moby/api/types/network/endpoint.go create mode 100644 vendor/github.com/moby/moby/api/types/network/ipam.go create mode 100644 vendor/github.com/moby/moby/api/types/network/network.go create mode 100644 vendor/github.com/moby/moby/api/types/plugin.go create mode 100644 vendor/github.com/moby/moby/api/types/plugin_device.go create mode 100644 vendor/github.com/moby/moby/api/types/plugin_env.go create mode 100644 vendor/github.com/moby/moby/api/types/plugin_interface_type.go create mode 100644 vendor/github.com/moby/moby/api/types/plugin_mount.go create mode 100644 vendor/github.com/moby/moby/api/types/plugin_responses.go create mode 100644 vendor/github.com/moby/moby/api/types/plugins/logdriver/entry.pb.go create mode 100644 vendor/github.com/moby/moby/api/types/plugins/logdriver/entry.proto create mode 100644 vendor/github.com/moby/moby/api/types/plugins/logdriver/gen.go create mode 100644 vendor/github.com/moby/moby/api/types/plugins/logdriver/io.go create mode 100644 vendor/github.com/moby/moby/api/types/registry/authconfig.go create mode 100644 vendor/github.com/moby/moby/api/types/registry/authenticate.go create mode 100644 vendor/github.com/moby/moby/api/types/registry/registry.go create mode 100644 vendor/github.com/moby/moby/api/types/registry/search.go create mode 100644 vendor/github.com/moby/moby/api/types/storage/driver_data.go create mode 100644 vendor/github.com/moby/moby/api/types/strslice/strslice.go create mode 100644 vendor/github.com/moby/moby/api/types/swarm/common.go create mode 100644 vendor/github.com/moby/moby/api/types/swarm/config.go create mode 100644 vendor/github.com/moby/moby/api/types/swarm/container.go create mode 100644 vendor/github.com/moby/moby/api/types/swarm/network.go create mode 100644 vendor/github.com/moby/moby/api/types/swarm/node.go create mode 100644 vendor/github.com/moby/moby/api/types/swarm/runtime.go create mode 100644 vendor/github.com/moby/moby/api/types/swarm/runtime/gen.go create mode 100644 vendor/github.com/moby/moby/api/types/swarm/runtime/plugin.pb.go create mode 100644 vendor/github.com/moby/moby/api/types/swarm/runtime/plugin.proto create mode 100644 vendor/github.com/moby/moby/api/types/swarm/secret.go create mode 100644 vendor/github.com/moby/moby/api/types/swarm/service.go create mode 100644 vendor/github.com/moby/moby/api/types/swarm/service_create_response.go create mode 100644 vendor/github.com/moby/moby/api/types/swarm/service_update_response.go create mode 100644 vendor/github.com/moby/moby/api/types/swarm/swarm.go create mode 100644 vendor/github.com/moby/moby/api/types/swarm/task.go create mode 100644 vendor/github.com/moby/moby/api/types/system/disk_usage.go create mode 100644 vendor/github.com/moby/moby/api/types/system/info.go create mode 100644 vendor/github.com/moby/moby/api/types/system/runtime.go create mode 100644 vendor/github.com/moby/moby/api/types/system/security_opts.go create mode 100644 vendor/github.com/moby/moby/api/types/time/timestamp.go create mode 100644 vendor/github.com/moby/moby/api/types/types.go create mode 100644 vendor/github.com/moby/moby/api/types/versions/compare.go create mode 100644 vendor/github.com/moby/moby/api/types/volume/cluster_volume.go create mode 100644 vendor/github.com/moby/moby/api/types/volume/create_options.go create mode 100644 vendor/github.com/moby/moby/api/types/volume/disk_usage.go create mode 100644 vendor/github.com/moby/moby/api/types/volume/list_response.go create mode 100644 vendor/github.com/moby/moby/api/types/volume/options.go create mode 100644 vendor/github.com/moby/moby/api/types/volume/volume.go create mode 100644 vendor/github.com/moby/moby/api/types/volume/volume_update.go delete mode 100644 vendor/golang.org/x/mod/modfile/print.go delete mode 100644 vendor/golang.org/x/mod/modfile/read.go delete mode 100644 vendor/golang.org/x/mod/modfile/rule.go delete mode 100644 vendor/golang.org/x/mod/modfile/work.go diff --git a/api/go.mod b/api/go.mod new file mode 100644 index 0000000000..ac1d98678b --- /dev/null +++ b/api/go.mod @@ -0,0 +1,16 @@ +module github.com/moby/moby/api + +go 1.23.0 + +require ( + github.com/distribution/reference v0.6.0 + github.com/docker/go-connections v0.5.0 + github.com/docker/go-units v0.5.0 + github.com/gogo/protobuf v1.3.2 + github.com/moby/docker-image-spec v1.3.1 + github.com/opencontainers/go-digest v1.0.0 + github.com/opencontainers/image-spec v1.1.1 + gotest.tools/v3 v3.5.2 +) + +require github.com/google/go-cmp v0.5.9 // indirect diff --git a/api/go.sum b/api/go.sum new file mode 100644 index 0000000000..9d4f6b07b2 --- /dev/null +++ b/api/go.sum @@ -0,0 +1,47 @@ +github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= +github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= +github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= +github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= +github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= +github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= +gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= diff --git a/api/types/backend/backend.go b/api/types/backend/backend.go index 98fe019e8f..0f981b3ac5 100644 --- a/api/types/backend/backend.go +++ b/api/types/backend/backend.go @@ -6,8 +6,8 @@ import ( "time" "github.com/distribution/reference" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/api/types/backend/build.go b/api/types/backend/build.go index 64867154db..3176b0ec50 100644 --- a/api/types/backend/build.go +++ b/api/types/backend/build.go @@ -3,8 +3,8 @@ package backend import ( "io" - "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/registry" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/api/types/build/build.go b/api/types/build/build.go index c43a0e21ea..a798802357 100644 --- a/api/types/build/build.go +++ b/api/types/build/build.go @@ -3,8 +3,8 @@ package build import ( "io" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/registry" ) // BuilderVersion sets the version of underlying builder to use diff --git a/api/types/build/cache.go b/api/types/build/cache.go index 42c8404573..442bd903d9 100644 --- a/api/types/build/cache.go +++ b/api/types/build/cache.go @@ -3,7 +3,7 @@ package build import ( "time" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types/filters" ) // CacheRecord contains information about a build cache record. diff --git a/api/types/container/commit.go b/api/types/container/commit.go index 6fd1b0ead1..c5aab26ff4 100644 --- a/api/types/container/commit.go +++ b/api/types/container/commit.go @@ -1,6 +1,6 @@ package container -import "github.com/docker/docker/api/types/common" +import "github.com/moby/moby/api/types/common" // CommitResponse response for the commit API call, containing the ID of the // image that was produced. diff --git a/api/types/container/config.go b/api/types/container/config.go index 0555416540..0eba9f6841 100644 --- a/api/types/container/config.go +++ b/api/types/container/config.go @@ -3,9 +3,9 @@ package container import ( "time" - "github.com/docker/docker/api/types/strslice" "github.com/docker/go-connections/nat" dockerspec "github.com/moby/docker-image-spec/specs-go/v1" + "github.com/moby/moby/api/types/strslice" ) // MinimumDuration puts a minimum on user configured duration. diff --git a/api/types/container/container.go b/api/types/container/container.go index 6018c9ea2c..8e9d53d58e 100644 --- a/api/types/container/container.go +++ b/api/types/container/container.go @@ -5,8 +5,8 @@ import ( "os" "time" - "github.com/docker/docker/api/types/mount" - "github.com/docker/docker/api/types/storage" + "github.com/moby/moby/api/types/mount" + "github.com/moby/moby/api/types/storage" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/api/types/container/create_request.go b/api/types/container/create_request.go index e98dd6ad44..decb208af0 100644 --- a/api/types/container/create_request.go +++ b/api/types/container/create_request.go @@ -1,6 +1,6 @@ package container -import "github.com/docker/docker/api/types/network" +import "github.com/moby/moby/api/types/network" // CreateRequest is the request message sent to the server for container // create calls. It is a config wrapper that holds the container [Config] diff --git a/api/types/container/exec.go b/api/types/container/exec.go index e455cd27b2..749a2a4452 100644 --- a/api/types/container/exec.go +++ b/api/types/container/exec.go @@ -1,6 +1,6 @@ package container -import "github.com/docker/docker/api/types/common" +import "github.com/moby/moby/api/types/common" // ExecCreateResponse is the response for a successful exec-create request. // It holds the ID of the exec that was created. diff --git a/api/types/container/hostconfig.go b/api/types/container/hostconfig.go index f63f049c7c..cf27f63fce 100644 --- a/api/types/container/hostconfig.go +++ b/api/types/container/hostconfig.go @@ -5,12 +5,12 @@ import ( "fmt" "strings" - "github.com/docker/docker/api/types/blkiodev" - "github.com/docker/docker/api/types/mount" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/strslice" "github.com/docker/go-connections/nat" "github.com/docker/go-units" + "github.com/moby/moby/api/types/blkiodev" + "github.com/moby/moby/api/types/mount" + "github.com/moby/moby/api/types/network" + "github.com/moby/moby/api/types/strslice" ) // CgroupnsMode represents the cgroup namespace mode of the container diff --git a/api/types/container/hostconfig_unix.go b/api/types/container/hostconfig_unix.go index cd6a7a9be2..326a5da7eb 100644 --- a/api/types/container/hostconfig_unix.go +++ b/api/types/container/hostconfig_unix.go @@ -2,7 +2,7 @@ package container -import "github.com/docker/docker/api/types/network" +import "github.com/moby/moby/api/types/network" // IsValid indicates if an isolation technology is valid func (i Isolation) IsValid() bool { diff --git a/api/types/container/hostconfig_windows.go b/api/types/container/hostconfig_windows.go index db63e190d1..977a376023 100644 --- a/api/types/container/hostconfig_windows.go +++ b/api/types/container/hostconfig_windows.go @@ -1,6 +1,6 @@ package container -import "github.com/docker/docker/api/types/network" +import "github.com/moby/moby/api/types/network" // IsValid indicates if an isolation technology is valid func (i Isolation) IsValid() bool { diff --git a/api/types/container/network_settings.go b/api/types/container/network_settings.go index afec0e5432..d7dee99e72 100644 --- a/api/types/container/network_settings.go +++ b/api/types/container/network_settings.go @@ -1,8 +1,8 @@ package container import ( - "github.com/docker/docker/api/types/network" "github.com/docker/go-connections/nat" + "github.com/moby/moby/api/types/network" ) // NetworkSettings exposes the network settings in the api diff --git a/api/types/container/options.go b/api/types/container/options.go index 7a23005769..b94152cb47 100644 --- a/api/types/container/options.go +++ b/api/types/container/options.go @@ -1,6 +1,6 @@ package container -import "github.com/docker/docker/api/types/filters" +import "github.com/moby/moby/api/types/filters" // ResizeOptions holds parameters to resize a TTY. // It can be used to resize container TTYs and diff --git a/api/types/events/events.go b/api/types/events/events.go index 952c0ff242..d5bf3059d6 100644 --- a/api/types/events/events.go +++ b/api/types/events/events.go @@ -1,6 +1,6 @@ package events -import "github.com/docker/docker/api/types/filters" +import "github.com/moby/moby/api/types/filters" // Type is used for event-types. type Type string diff --git a/api/types/filters/parse.go b/api/types/filters/parse.go index 86f4bdb28e..097a8a35f1 100644 --- a/api/types/filters/parse.go +++ b/api/types/filters/parse.go @@ -9,7 +9,7 @@ import ( "regexp" "strings" - "github.com/docker/docker/api/types/versions" + "github.com/moby/moby/api/types/versions" ) // Args stores a mapping of keys to a set of multiple values. diff --git a/api/types/image/image_inspect.go b/api/types/image/image_inspect.go index 3bdb474287..4335f733d5 100644 --- a/api/types/image/image_inspect.go +++ b/api/types/image/image_inspect.go @@ -1,9 +1,9 @@ package image import ( - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/storage" dockerspec "github.com/moby/docker-image-spec/specs-go/v1" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/storage" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/api/types/image/opts.go b/api/types/image/opts.go index 9e33a42fa6..fb397d492b 100644 --- a/api/types/image/opts.go +++ b/api/types/image/opts.go @@ -4,7 +4,7 @@ import ( "context" "io" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types/filters" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/api/types/network/network.go b/api/types/network/network.go index 4a0cb47984..f9a206f189 100644 --- a/api/types/network/network.go +++ b/api/types/network/network.go @@ -3,7 +3,7 @@ package network import ( "time" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types/filters" ) const ( diff --git a/api/types/registry/search.go b/api/types/registry/search.go index 994ca4c6f9..0bcb6abe29 100644 --- a/api/types/registry/search.go +++ b/api/types/registry/search.go @@ -3,7 +3,7 @@ package registry import ( "context" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types/filters" ) // SearchOptions holds parameters to search images with. diff --git a/api/types/swarm/config.go b/api/types/swarm/config.go index 80a6ffdb9a..f8e7f4a6f9 100644 --- a/api/types/swarm/config.go +++ b/api/types/swarm/config.go @@ -3,7 +3,7 @@ package swarm import ( "os" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types/filters" ) // Config represents a config. diff --git a/api/types/swarm/container.go b/api/types/swarm/container.go index f9416bacca..bc8690d8cb 100644 --- a/api/types/swarm/container.go +++ b/api/types/swarm/container.go @@ -3,8 +3,8 @@ package swarm import ( "time" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/mount" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/mount" ) // DNSConfig specifies DNS related configurations in resolver configuration file (resolv.conf) diff --git a/api/types/swarm/network.go b/api/types/swarm/network.go index 4b88072339..95a5fb385a 100644 --- a/api/types/swarm/network.go +++ b/api/types/swarm/network.go @@ -1,7 +1,7 @@ package swarm import ( - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/network" ) // Endpoint represents an endpoint. diff --git a/api/types/swarm/node.go b/api/types/swarm/node.go index 2018a031bb..f0638f13cb 100644 --- a/api/types/swarm/node.go +++ b/api/types/swarm/node.go @@ -1,6 +1,6 @@ package swarm -import "github.com/docker/docker/api/types/filters" +import "github.com/moby/moby/api/types/filters" // Node represents a node. type Node struct { diff --git a/api/types/swarm/secret.go b/api/types/swarm/secret.go index d9482ab56d..3cf1cdba51 100644 --- a/api/types/swarm/secret.go +++ b/api/types/swarm/secret.go @@ -3,7 +3,7 @@ package swarm import ( "os" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types/filters" ) // Secret represents a secret. diff --git a/api/types/swarm/service.go b/api/types/swarm/service.go index 56c660c1f0..58749aa355 100644 --- a/api/types/swarm/service.go +++ b/api/types/swarm/service.go @@ -3,7 +3,7 @@ package swarm import ( "time" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types/filters" ) // Service represents a service. diff --git a/api/types/swarm/task.go b/api/types/swarm/task.go index 4dc95e8b1d..aedf010551 100644 --- a/api/types/swarm/task.go +++ b/api/types/swarm/task.go @@ -3,8 +3,8 @@ package swarm import ( "time" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/swarm/runtime" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/swarm/runtime" ) // TaskState represents the state of a task. diff --git a/api/types/system/disk_usage.go b/api/types/system/disk_usage.go index 99078cf196..333a7c7fc4 100644 --- a/api/types/system/disk_usage.go +++ b/api/types/system/disk_usage.go @@ -1,10 +1,10 @@ package system import ( - "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/volume" + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/volume" ) // DiskUsage contains response of Engine API for API 1.49 and greater: diff --git a/api/types/system/info.go b/api/types/system/info.go index 047639ed91..e9a4aa7c7f 100644 --- a/api/types/system/info.go +++ b/api/types/system/info.go @@ -1,9 +1,9 @@ package system import ( - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/registry" + "github.com/moby/moby/api/types/swarm" ) // Info contains response of Engine API: diff --git a/api/types/types.go b/api/types/types.go index 8bbadeb208..83676e42e5 100644 --- a/api/types/types.go +++ b/api/types/types.go @@ -1,11 +1,11 @@ package types import ( - "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/api/types/volume" + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/swarm" + "github.com/moby/moby/api/types/volume" ) const ( diff --git a/api/types/volume/cluster_volume.go b/api/types/volume/cluster_volume.go index 618a481620..07b75d12a0 100644 --- a/api/types/volume/cluster_volume.go +++ b/api/types/volume/cluster_volume.go @@ -1,7 +1,7 @@ package volume import ( - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" ) // ClusterVolume contains options and information specific to, and only present diff --git a/api/types/volume/options.go b/api/types/volume/options.go index 875524fbc2..7237f2db8d 100644 --- a/api/types/volume/options.go +++ b/api/types/volume/options.go @@ -1,6 +1,6 @@ package volume -import "github.com/docker/docker/api/types/filters" +import "github.com/moby/moby/api/types/filters" // ListOptions holds parameters to list volumes. type ListOptions struct { diff --git a/client/auth.go b/client/auth.go index 7d858877b7..8baf39d2cf 100644 --- a/client/auth.go +++ b/client/auth.go @@ -3,7 +3,7 @@ package client import ( "context" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/registry" ) // staticAuth creates a privilegeFn from the given registryAuth. diff --git a/client/build_prune.go b/client/build_prune.go index 6f0f59e30d..62ef66c467 100644 --- a/client/build_prune.go +++ b/client/build_prune.go @@ -6,8 +6,8 @@ import ( "net/url" "strconv" - "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/filters" "github.com/pkg/errors" ) diff --git a/client/checkpoint.go b/client/checkpoint.go index d020574c89..af942c412c 100644 --- a/client/checkpoint.go +++ b/client/checkpoint.go @@ -3,7 +3,7 @@ package client import ( "context" - "github.com/docker/docker/api/types/checkpoint" + "github.com/moby/moby/api/types/checkpoint" ) // CheckpointAPIClient defines API client methods for the checkpoints. diff --git a/client/checkpoint_create.go b/client/checkpoint_create.go index 961a5fe62f..b7acd281f2 100644 --- a/client/checkpoint_create.go +++ b/client/checkpoint_create.go @@ -3,7 +3,7 @@ package client import ( "context" - "github.com/docker/docker/api/types/checkpoint" + "github.com/moby/moby/api/types/checkpoint" ) // CheckpointCreate creates a checkpoint from the given container with the given name diff --git a/client/checkpoint_create_test.go b/client/checkpoint_create_test.go index 93db7a2092..60e4fea41e 100644 --- a/client/checkpoint_create_test.go +++ b/client/checkpoint_create_test.go @@ -12,7 +12,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/checkpoint" + "github.com/moby/moby/api/types/checkpoint" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/checkpoint_delete.go b/client/checkpoint_delete.go index 4c51b25f24..0048300cb7 100644 --- a/client/checkpoint_delete.go +++ b/client/checkpoint_delete.go @@ -4,7 +4,7 @@ import ( "context" "net/url" - "github.com/docker/docker/api/types/checkpoint" + "github.com/moby/moby/api/types/checkpoint" ) // CheckpointDelete deletes the checkpoint with the given name from the given container diff --git a/client/checkpoint_delete_test.go b/client/checkpoint_delete_test.go index 1faa483bf9..31de55363f 100644 --- a/client/checkpoint_delete_test.go +++ b/client/checkpoint_delete_test.go @@ -10,7 +10,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/checkpoint" + "github.com/moby/moby/api/types/checkpoint" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/checkpoint_list.go b/client/checkpoint_list.go index 8164c7668b..c4cb82df22 100644 --- a/client/checkpoint_list.go +++ b/client/checkpoint_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/url" - "github.com/docker/docker/api/types/checkpoint" + "github.com/moby/moby/api/types/checkpoint" ) // CheckpointList returns the checkpoints of the given container in the docker host diff --git a/client/checkpoint_list_test.go b/client/checkpoint_list_test.go index 4103780bb5..c39f7959b0 100644 --- a/client/checkpoint_list_test.go +++ b/client/checkpoint_list_test.go @@ -11,7 +11,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/checkpoint" + "github.com/moby/moby/api/types/checkpoint" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/client.go b/client/client.go index 298852f55a..709d480e40 100644 --- a/client/client.go +++ b/client/client.go @@ -19,7 +19,7 @@ For example, to list running containers (the equivalent of "docker ps"): "context" "fmt" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" "github.com/docker/docker/client" ) @@ -53,9 +53,9 @@ import ( "sync/atomic" "time" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/versions" "github.com/docker/go-connections/sockets" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/versions" "github.com/pkg/errors" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" ) diff --git a/client/client_interfaces.go b/client/client_interfaces.go index df7aad430c..ec6917708f 100644 --- a/client/client_interfaces.go +++ b/client/client_interfaces.go @@ -6,17 +6,17 @@ import ( "net" "net/http" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/api/types/system" - "github.com/docker/docker/api/types/volume" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/network" + "github.com/moby/moby/api/types/registry" + "github.com/moby/moby/api/types/swarm" + "github.com/moby/moby/api/types/system" + "github.com/moby/moby/api/types/volume" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/client/client_mock_test.go b/client/client_mock_test.go index 2da540f2fc..239daf1586 100644 --- a/client/client_mock_test.go +++ b/client/client_mock_test.go @@ -6,7 +6,7 @@ import ( "io" "net/http" - "github.com/docker/docker/api/types" + "github.com/moby/moby/api/types" ) // transportFunc allows us to inject a mock transport for testing. We define it diff --git a/client/client_test.go b/client/client_test.go index 6f2085f5b5..d0265e4325 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -11,7 +11,7 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types" + "github.com/moby/moby/api/types" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/client/config_create.go b/client/config_create.go index a39168e23b..bb1cf9a5b1 100644 --- a/client/config_create.go +++ b/client/config_create.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" ) // ConfigCreate creates a new config. diff --git a/client/config_create_test.go b/client/config_create_test.go index 25ff789150..b330fcdc1b 100644 --- a/client/config_create_test.go +++ b/client/config_create_test.go @@ -11,7 +11,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/config_inspect.go b/client/config_inspect.go index a9f0a8b05e..d43182e85e 100644 --- a/client/config_inspect.go +++ b/client/config_inspect.go @@ -6,7 +6,7 @@ import ( "encoding/json" "io" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" ) // ConfigInspectWithRaw returns the config information with raw data diff --git a/client/config_inspect_test.go b/client/config_inspect_test.go index 94f2f97386..6463df616c 100644 --- a/client/config_inspect_test.go +++ b/client/config_inspect_test.go @@ -12,7 +12,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/config_list.go b/client/config_list.go index 6f8a1c21f0..aae9c0d4e3 100644 --- a/client/config_list.go +++ b/client/config_list.go @@ -5,8 +5,8 @@ import ( "encoding/json" "net/url" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/swarm" ) // ConfigList returns the list of configs. diff --git a/client/config_list_test.go b/client/config_list_test.go index 2ae5b809aa..6c578f6b8c 100644 --- a/client/config_list_test.go +++ b/client/config_list_test.go @@ -11,8 +11,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/config_update.go b/client/config_update.go index 9bc137f7f9..a55f01beff 100644 --- a/client/config_update.go +++ b/client/config_update.go @@ -4,7 +4,7 @@ import ( "context" "net/url" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" ) // ConfigUpdate attempts to update a config diff --git a/client/config_update_test.go b/client/config_update_test.go index e846781b1b..2821dc532e 100644 --- a/client/config_update_test.go +++ b/client/config_update_test.go @@ -10,7 +10,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/container_attach.go b/client/container_attach.go index 1fb3493ebf..c626e02511 100644 --- a/client/container_attach.go +++ b/client/container_attach.go @@ -5,8 +5,8 @@ import ( "net/http" "net/url" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/container" ) // ContainerAttach attaches a connection to a container in the server. diff --git a/client/container_commit.go b/client/container_commit.go index 2b5b9852fb..fcdb115afe 100644 --- a/client/container_commit.go +++ b/client/container_commit.go @@ -7,7 +7,7 @@ import ( "net/url" "github.com/distribution/reference" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" ) // ContainerCommit applies changes to a container and creates a new tagged image. diff --git a/client/container_commit_test.go b/client/container_commit_test.go index 6b5f781f53..5c9ae145e6 100644 --- a/client/container_commit_test.go +++ b/client/container_commit_test.go @@ -11,7 +11,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/container_copy.go b/client/container_copy.go index 7c4130dc7f..082ff56c3b 100644 --- a/client/container_copy.go +++ b/client/container_copy.go @@ -11,7 +11,7 @@ import ( "path/filepath" "strings" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" ) // ContainerStatPath returns stat information about a path inside the container filesystem. diff --git a/client/container_copy_test.go b/client/container_copy_test.go index a07c7af1ee..e81275a184 100644 --- a/client/container_copy_test.go +++ b/client/container_copy_test.go @@ -14,7 +14,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/container_create.go b/client/container_create.go index d5326ee4d7..5cfe6db3f5 100644 --- a/client/container_create.go +++ b/client/container_create.go @@ -9,9 +9,9 @@ import ( "sort" "strings" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/versions" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" + "github.com/moby/moby/api/types/versions" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/client/container_create_test.go b/client/container_create_test.go index 195d354cbe..40fe990e04 100644 --- a/client/container_create_test.go +++ b/client/container_create_test.go @@ -11,7 +11,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/container_diff.go b/client/container_diff.go index 3848e3117e..c87c6e4be9 100644 --- a/client/container_diff.go +++ b/client/container_diff.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/url" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" ) // ContainerDiff shows differences in a container filesystem since it was started. diff --git a/client/container_diff_test.go b/client/container_diff_test.go index 28ddd85339..25598105ad 100644 --- a/client/container_diff_test.go +++ b/client/container_diff_test.go @@ -11,7 +11,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/container_exec.go b/client/container_exec.go index eb732fd027..b48e84c46c 100644 --- a/client/container_exec.go +++ b/client/container_exec.go @@ -5,9 +5,9 @@ import ( "encoding/json" "net/http" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/versions" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/versions" ) // ContainerExecCreate creates a new exec configuration to run an exec process. diff --git a/client/container_exec_test.go b/client/container_exec_test.go index ca3327c4cf..78592bf77b 100644 --- a/client/container_exec_test.go +++ b/client/container_exec_test.go @@ -11,7 +11,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/container_inspect.go b/client/container_inspect.go index 18ccdf2339..077d753d91 100644 --- a/client/container_inspect.go +++ b/client/container_inspect.go @@ -7,7 +7,7 @@ import ( "io" "net/url" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" ) // ContainerInspect returns the container information. diff --git a/client/container_inspect_test.go b/client/container_inspect_test.go index 5a61debec8..d6c807ee53 100644 --- a/client/container_inspect_test.go +++ b/client/container_inspect_test.go @@ -12,7 +12,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/container_list.go b/client/container_list.go index e17b14acff..98b8c85593 100644 --- a/client/container_list.go +++ b/client/container_list.go @@ -6,8 +6,8 @@ import ( "net/url" "strconv" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" ) // ContainerList returns the list of containers in the docker host. diff --git a/client/container_list_test.go b/client/container_list_test.go index ae461e7b4b..9bc4cce9c2 100644 --- a/client/container_list_test.go +++ b/client/container_list_test.go @@ -11,8 +11,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/container_logs.go b/client/container_logs.go index 3ea1f68d42..bd8e63fadf 100644 --- a/client/container_logs.go +++ b/client/container_logs.go @@ -6,8 +6,8 @@ import ( "net/url" "time" - "github.com/docker/docker/api/types/container" - timetypes "github.com/docker/docker/api/types/time" + "github.com/moby/moby/api/types/container" + timetypes "github.com/moby/moby/api/types/time" "github.com/pkg/errors" ) diff --git a/client/container_logs_test.go b/client/container_logs_test.go index b18eecda69..4acfd7b4ac 100644 --- a/client/container_logs_test.go +++ b/client/container_logs_test.go @@ -14,7 +14,7 @@ import ( "time" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/container_prune.go b/client/container_prune.go index 84fb6bc235..49a5989339 100644 --- a/client/container_prune.go +++ b/client/container_prune.go @@ -5,8 +5,8 @@ import ( "encoding/json" "fmt" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" ) // ContainersPrune requests the daemon to delete unused data diff --git a/client/container_prune_test.go b/client/container_prune_test.go index b4541ea219..368e18291a 100644 --- a/client/container_prune_test.go +++ b/client/container_prune_test.go @@ -11,8 +11,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/container_remove.go b/client/container_remove.go index b1a2ce6b83..5d4b020e5e 100644 --- a/client/container_remove.go +++ b/client/container_remove.go @@ -4,7 +4,7 @@ import ( "context" "net/url" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" ) // ContainerRemove kills and removes a container from the docker host. diff --git a/client/container_remove_test.go b/client/container_remove_test.go index 6aec805046..c012e6a09c 100644 --- a/client/container_remove_test.go +++ b/client/container_remove_test.go @@ -10,7 +10,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/container_resize.go b/client/container_resize.go index 56b7368b75..f6dab77910 100644 --- a/client/container_resize.go +++ b/client/container_resize.go @@ -5,7 +5,7 @@ import ( "net/url" "strconv" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" ) // ContainerResize changes the size of the tty for a container. diff --git a/client/container_resize_test.go b/client/container_resize_test.go index 518876fc74..4ba161ddba 100644 --- a/client/container_resize_test.go +++ b/client/container_resize_test.go @@ -9,7 +9,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/container_restart.go b/client/container_restart.go index 5af07bfc76..e45b2fb618 100644 --- a/client/container_restart.go +++ b/client/container_restart.go @@ -5,8 +5,8 @@ import ( "net/url" "strconv" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/versions" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/versions" ) // ContainerRestart stops and starts a container again. diff --git a/client/container_restart_test.go b/client/container_restart_test.go index cb850cf26d..06a0dabb82 100644 --- a/client/container_restart_test.go +++ b/client/container_restart_test.go @@ -10,7 +10,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/container_start.go b/client/container_start.go index c7206e320a..e6c35223ee 100644 --- a/client/container_start.go +++ b/client/container_start.go @@ -4,7 +4,7 @@ import ( "context" "net/url" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" ) // ContainerStart sends a request to the docker daemon to start a container. diff --git a/client/container_start_test.go b/client/container_start_test.go index d75c52294d..99979660cd 100644 --- a/client/container_start_test.go +++ b/client/container_start_test.go @@ -11,7 +11,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/container_stats.go b/client/container_stats.go index 076954f4c3..f701a693c6 100644 --- a/client/container_stats.go +++ b/client/container_stats.go @@ -4,7 +4,7 @@ import ( "context" "net/url" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" ) // ContainerStats returns near realtime stats for a given container. diff --git a/client/container_stop.go b/client/container_stop.go index 175b9c8bcc..8ea2e6bd35 100644 --- a/client/container_stop.go +++ b/client/container_stop.go @@ -5,8 +5,8 @@ import ( "net/url" "strconv" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/versions" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/versions" ) // ContainerStop stops a container. In case the container fails to stop diff --git a/client/container_stop_test.go b/client/container_stop_test.go index b22c671149..12e4869095 100644 --- a/client/container_stop_test.go +++ b/client/container_stop_test.go @@ -10,7 +10,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/container_top.go b/client/container_top.go index 5770f9d469..96b7e87f3d 100644 --- a/client/container_top.go +++ b/client/container_top.go @@ -6,7 +6,7 @@ import ( "net/url" "strings" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" ) // ContainerTop shows process information from within a container. diff --git a/client/container_top_test.go b/client/container_top_test.go index 3819a59158..8551ab1b17 100644 --- a/client/container_top_test.go +++ b/client/container_top_test.go @@ -11,7 +11,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/container_update.go b/client/container_update.go index 10e966d089..fc524b1c91 100644 --- a/client/container_update.go +++ b/client/container_update.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" ) // ContainerUpdate updates the resources of a container. diff --git a/client/container_update_test.go b/client/container_update_test.go index 5ea156b768..37bc616639 100644 --- a/client/container_update_test.go +++ b/client/container_update_test.go @@ -11,7 +11,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/container_wait.go b/client/container_wait.go index 75c03a12fa..e30ee8dddd 100644 --- a/client/container_wait.go +++ b/client/container_wait.go @@ -8,8 +8,8 @@ import ( "io" "net/url" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/versions" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/versions" ) const containerWaitErrorMsgLimit = 2 * 1024 /* Max: 2KiB */ diff --git a/client/container_wait_test.go b/client/container_wait_test.go index 66eccbfca2..5277bce839 100644 --- a/client/container_wait_test.go +++ b/client/container_wait_test.go @@ -16,7 +16,7 @@ import ( "time" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/disk_usage.go b/client/disk_usage.go index 729e105715..31a261a10a 100644 --- a/client/disk_usage.go +++ b/client/disk_usage.go @@ -6,7 +6,7 @@ import ( "fmt" "net/url" - "github.com/docker/docker/api/types" + "github.com/moby/moby/api/types" ) // DiskUsage requests the current data usage from the daemon diff --git a/client/disk_usage_test.go b/client/disk_usage_test.go index f7b529bebd..a1bf29d851 100644 --- a/client/disk_usage_test.go +++ b/client/disk_usage_test.go @@ -11,7 +11,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types" + "github.com/moby/moby/api/types" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/distribution_inspect.go b/client/distribution_inspect.go index 693c4121a6..334c6d6bcf 100644 --- a/client/distribution_inspect.go +++ b/client/distribution_inspect.go @@ -6,7 +6,7 @@ import ( "net/http" "net/url" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/registry" ) // DistributionInspect returns the image digest with the full manifest. diff --git a/client/errors.go b/client/errors.go index 9e3a2538f2..0968e5470d 100644 --- a/client/errors.go +++ b/client/errors.go @@ -8,7 +8,7 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/containerd/errdefs/pkg/errhttp" - "github.com/docker/docker/api/types/versions" + "github.com/moby/moby/api/types/versions" ) // errConnectionFailed implements an error returned when connection failed. diff --git a/client/events.go b/client/events.go index 498fe46314..cc23e71397 100644 --- a/client/events.go +++ b/client/events.go @@ -6,9 +6,9 @@ import ( "net/url" "time" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" - timetypes "github.com/docker/docker/api/types/time" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/filters" + timetypes "github.com/moby/moby/api/types/time" ) // Events returns a stream of events in the daemon. It's up to the caller to close the stream diff --git a/client/events_test.go b/client/events_test.go index 84042c7522..b37af874bc 100644 --- a/client/events_test.go +++ b/client/events_test.go @@ -12,8 +12,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/filters" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/hijack.go b/client/hijack.go index 01d121a62e..c983a8e856 100644 --- a/client/hijack.go +++ b/client/hijack.go @@ -9,8 +9,8 @@ import ( "net/url" "time" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/versions" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/versions" "github.com/pkg/errors" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" ) diff --git a/client/hijack_test.go b/client/hijack_test.go index 4f038fe40d..4e53a4eac3 100644 --- a/client/hijack_test.go +++ b/client/hijack_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "github.com/docker/docker/api/types" + "github.com/moby/moby/api/types" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/image_build.go b/client/image_build.go index 1ed0878bfd..6127753f9b 100644 --- a/client/image_build.go +++ b/client/image_build.go @@ -10,9 +10,9 @@ import ( "strconv" "strings" - "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" ) // ImageBuild sends a request to the daemon to build images. diff --git a/client/image_build_test.go b/client/image_build_test.go index 76c514962d..b63a027eb6 100644 --- a/client/image_build_test.go +++ b/client/image_build_test.go @@ -11,9 +11,9 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/registry" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/image_create.go b/client/image_create.go index 103163a5ce..4282158d21 100644 --- a/client/image_create.go +++ b/client/image_create.go @@ -8,8 +8,8 @@ import ( "strings" "github.com/distribution/reference" - "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/registry" ) // ImageCreate creates a new image based on the parent options. diff --git a/client/image_create_test.go b/client/image_create_test.go index d647316190..1412565528 100644 --- a/client/image_create_test.go +++ b/client/image_create_test.go @@ -10,8 +10,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/registry" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/image_history.go b/client/image_history.go index fce8b80e18..42c2b134bd 100644 --- a/client/image_history.go +++ b/client/image_history.go @@ -6,7 +6,7 @@ import ( "fmt" "net/url" - "github.com/docker/docker/api/types/image" + "github.com/moby/moby/api/types/image" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/client/image_history_opts.go b/client/image_history_opts.go index 6d3494dd0b..9641219f3f 100644 --- a/client/image_history_opts.go +++ b/client/image_history_opts.go @@ -1,7 +1,7 @@ package client import ( - "github.com/docker/docker/api/types/image" + "github.com/moby/moby/api/types/image" ) // ImageHistoryOption is a type representing functional options for the image history operation. diff --git a/client/image_history_test.go b/client/image_history_test.go index 8fb2690aea..8e2b6c9b0b 100644 --- a/client/image_history_test.go +++ b/client/image_history_test.go @@ -8,7 +8,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/image" + "github.com/moby/moby/api/types/image" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/client/image_import.go b/client/image_import.go index 5236dbc62a..b95438fbe8 100644 --- a/client/image_import.go +++ b/client/image_import.go @@ -7,7 +7,7 @@ import ( "strings" "github.com/distribution/reference" - "github.com/docker/docker/api/types/image" + "github.com/moby/moby/api/types/image" ) // ImageImport creates a new image based on the source options. diff --git a/client/image_import_test.go b/client/image_import_test.go index 1b82d7f9be..ce9b4c45fa 100644 --- a/client/image_import_test.go +++ b/client/image_import_test.go @@ -10,7 +10,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/image" + "github.com/moby/moby/api/types/image" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/image_inspect.go b/client/image_inspect.go index 4c35003129..b1ea1d0c27 100644 --- a/client/image_inspect.go +++ b/client/image_inspect.go @@ -8,7 +8,7 @@ import ( "io" "net/url" - "github.com/docker/docker/api/types/image" + "github.com/moby/moby/api/types/image" ) // ImageInspect returns the image information. diff --git a/client/image_inspect_opts.go b/client/image_inspect_opts.go index 655cbf0b7a..c8abbdd4f5 100644 --- a/client/image_inspect_opts.go +++ b/client/image_inspect_opts.go @@ -3,7 +3,7 @@ package client import ( "bytes" - "github.com/docker/docker/api/types/image" + "github.com/moby/moby/api/types/image" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/client/image_inspect_test.go b/client/image_inspect_test.go index 93d28bdc8c..9cc9814fff 100644 --- a/client/image_inspect_test.go +++ b/client/image_inspect_test.go @@ -12,7 +12,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/image" + "github.com/moby/moby/api/types/image" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/client/image_list.go b/client/image_list.go index ec0a2ad570..126ade63b8 100644 --- a/client/image_list.go +++ b/client/image_list.go @@ -5,9 +5,9 @@ import ( "encoding/json" "net/url" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/versions" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/versions" ) // ImageList returns a list of images in the docker host. diff --git a/client/image_list_test.go b/client/image_list_test.go index 07d6094169..fd32f58fc9 100644 --- a/client/image_list_test.go +++ b/client/image_list_test.go @@ -12,8 +12,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/image" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/image" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/image_load.go b/client/image_load.go index 079002e943..356b7a97c4 100644 --- a/client/image_load.go +++ b/client/image_load.go @@ -6,7 +6,7 @@ import ( "net/http" "net/url" - "github.com/docker/docker/api/types/image" + "github.com/moby/moby/api/types/image" ) // ImageLoad loads an image in the docker host from the client host. diff --git a/client/image_load_opts.go b/client/image_load_opts.go index ebcedd41ff..6681a63ddd 100644 --- a/client/image_load_opts.go +++ b/client/image_load_opts.go @@ -3,7 +3,7 @@ package client import ( "fmt" - "github.com/docker/docker/api/types/image" + "github.com/moby/moby/api/types/image" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/client/image_prune.go b/client/image_prune.go index 52e8bcf551..3909c16c09 100644 --- a/client/image_prune.go +++ b/client/image_prune.go @@ -5,8 +5,8 @@ import ( "encoding/json" "fmt" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/image" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/image" ) // ImagesPrune requests the daemon to delete unused data diff --git a/client/image_prune_test.go b/client/image_prune_test.go index a81b0059bc..7327f6bb65 100644 --- a/client/image_prune_test.go +++ b/client/image_prune_test.go @@ -11,9 +11,9 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/image" + "github.com/moby/moby/api/types/image" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types/filters" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/image_pull.go b/client/image_pull.go index 54aeed8a1f..c40cfbfea1 100644 --- a/client/image_pull.go +++ b/client/image_pull.go @@ -8,7 +8,7 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/distribution/reference" - "github.com/docker/docker/api/types/image" + "github.com/moby/moby/api/types/image" ) // ImagePull requests the docker host to pull an image from a remote registry. diff --git a/client/image_pull_test.go b/client/image_pull_test.go index 88b8b18e95..1a37a2b4b9 100644 --- a/client/image_pull_test.go +++ b/client/image_pull_test.go @@ -11,8 +11,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/registry" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/image_push.go b/client/image_push.go index 6d6ee21a1b..efd1e4603e 100644 --- a/client/image_push.go +++ b/client/image_push.go @@ -11,8 +11,8 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/distribution/reference" - "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/registry" ) // ImagePush requests the docker host to push an image to a remote registry. diff --git a/client/image_push_test.go b/client/image_push_test.go index 16d17947ec..37a4833304 100644 --- a/client/image_push_test.go +++ b/client/image_push_test.go @@ -11,8 +11,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/registry" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/image_remove.go b/client/image_remove.go index 8f357c729a..fb3175e6ab 100644 --- a/client/image_remove.go +++ b/client/image_remove.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/url" - "github.com/docker/docker/api/types/image" + "github.com/moby/moby/api/types/image" ) // ImageRemove removes an image from the docker host. diff --git a/client/image_remove_test.go b/client/image_remove_test.go index debe8b35e0..c0e91af9f9 100644 --- a/client/image_remove_test.go +++ b/client/image_remove_test.go @@ -11,7 +11,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/image" + "github.com/moby/moby/api/types/image" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/client/image_save_opts.go b/client/image_save_opts.go index acd8f282b3..787e78bda9 100644 --- a/client/image_save_opts.go +++ b/client/image_save_opts.go @@ -3,7 +3,7 @@ package client import ( "fmt" - "github.com/docker/docker/api/types/image" + "github.com/moby/moby/api/types/image" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/client/image_search.go b/client/image_search.go index 8f5343b9da..807fb69316 100644 --- a/client/image_search.go +++ b/client/image_search.go @@ -8,8 +8,8 @@ import ( "strconv" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/registry" ) // ImageSearch makes the docker host search by a term in a remote registry. diff --git a/client/image_search_test.go b/client/image_search_test.go index 55cb33f163..a6061bdfe7 100644 --- a/client/image_search_test.go +++ b/client/image_search_test.go @@ -12,8 +12,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/registry" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/info.go b/client/info.go index ed85d7f8d9..865cd35eee 100644 --- a/client/info.go +++ b/client/info.go @@ -6,7 +6,7 @@ import ( "fmt" "net/url" - "github.com/docker/docker/api/types/system" + "github.com/moby/moby/api/types/system" ) // Info returns information about the docker server. diff --git a/client/info_test.go b/client/info_test.go index 01674ee885..bf83ba2db7 100644 --- a/client/info_test.go +++ b/client/info_test.go @@ -11,7 +11,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/system" + "github.com/moby/moby/api/types/system" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/login.go b/client/login.go index 2d7f179023..9cb365338d 100644 --- a/client/login.go +++ b/client/login.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/url" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/registry" ) // RegistryLogin authenticates the docker server with a given docker registry. diff --git a/client/network_connect.go b/client/network_connect.go index f7526c5d8e..0f76056f1a 100644 --- a/client/network_connect.go +++ b/client/network_connect.go @@ -3,7 +3,7 @@ package client import ( "context" - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/network" ) // NetworkConnect connects a container to an existent network in the docker host. diff --git a/client/network_connect_test.go b/client/network_connect_test.go index 3c20715167..363a3a7034 100644 --- a/client/network_connect_test.go +++ b/client/network_connect_test.go @@ -11,7 +11,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/network_create.go b/client/network_create.go index 6a7f2ea52e..9babf0cb9c 100644 --- a/client/network_create.go +++ b/client/network_create.go @@ -4,8 +4,8 @@ import ( "context" "encoding/json" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/versions" + "github.com/moby/moby/api/types/network" + "github.com/moby/moby/api/types/versions" ) // NetworkCreate creates a new network in the docker host. diff --git a/client/network_create_test.go b/client/network_create_test.go index 76d4dec6c6..fd0b7463ef 100644 --- a/client/network_create_test.go +++ b/client/network_create_test.go @@ -11,7 +11,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/network_disconnect.go b/client/network_disconnect.go index 55f9b6a206..09063fcc32 100644 --- a/client/network_disconnect.go +++ b/client/network_disconnect.go @@ -3,7 +3,7 @@ package client import ( "context" - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/network" ) // NetworkDisconnect disconnects a container from an existent network in the docker host. diff --git a/client/network_disconnect_test.go b/client/network_disconnect_test.go index 946d52c20f..02c6e4c745 100644 --- a/client/network_disconnect_test.go +++ b/client/network_disconnect_test.go @@ -11,7 +11,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/network_inspect.go b/client/network_inspect.go index 734ec10211..83d91f55c9 100644 --- a/client/network_inspect.go +++ b/client/network_inspect.go @@ -7,7 +7,7 @@ import ( "io" "net/url" - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/network" ) // NetworkInspect returns the information for a specific network configured in the docker host. diff --git a/client/network_inspect_test.go b/client/network_inspect_test.go index 5676a707ac..1309b1423d 100644 --- a/client/network_inspect_test.go +++ b/client/network_inspect_test.go @@ -11,7 +11,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/network_list.go b/client/network_list.go index 8d93361966..1d7b2e6546 100644 --- a/client/network_list.go +++ b/client/network_list.go @@ -5,8 +5,8 @@ import ( "encoding/json" "net/url" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/network" ) // NetworkList returns the list of networks configured in the docker host. diff --git a/client/network_list_test.go b/client/network_list_test.go index ac1af894f0..12f502f661 100644 --- a/client/network_list_test.go +++ b/client/network_list_test.go @@ -11,8 +11,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/network_prune.go b/client/network_prune.go index 7835fe9069..ae4b8c2847 100644 --- a/client/network_prune.go +++ b/client/network_prune.go @@ -5,8 +5,8 @@ import ( "encoding/json" "fmt" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/network" ) // NetworksPrune requests the daemon to delete unused networks diff --git a/client/network_prune_test.go b/client/network_prune_test.go index 269257c3a6..4948093090 100644 --- a/client/network_prune_test.go +++ b/client/network_prune_test.go @@ -11,8 +11,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/node_inspect.go b/client/node_inspect.go index dd1f1f8ab4..816eb19f66 100644 --- a/client/node_inspect.go +++ b/client/node_inspect.go @@ -6,7 +6,7 @@ import ( "encoding/json" "io" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" ) // NodeInspectWithRaw returns the node information. diff --git a/client/node_inspect_test.go b/client/node_inspect_test.go index 7617ef1653..9965a7f392 100644 --- a/client/node_inspect_test.go +++ b/client/node_inspect_test.go @@ -12,7 +12,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/node_list.go b/client/node_list.go index 3b393ffe38..f6d2cad23e 100644 --- a/client/node_list.go +++ b/client/node_list.go @@ -5,8 +5,8 @@ import ( "encoding/json" "net/url" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/swarm" ) // NodeList returns the list of nodes. diff --git a/client/node_list_test.go b/client/node_list_test.go index cc7c9adf85..2c412f2397 100644 --- a/client/node_list_test.go +++ b/client/node_list_test.go @@ -11,8 +11,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/node_remove.go b/client/node_remove.go index 644fe13810..9499a5efbc 100644 --- a/client/node_remove.go +++ b/client/node_remove.go @@ -4,7 +4,7 @@ import ( "context" "net/url" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" ) // NodeRemove removes a Node. diff --git a/client/node_remove_test.go b/client/node_remove_test.go index 188233c7f4..7eca7af455 100644 --- a/client/node_remove_test.go +++ b/client/node_remove_test.go @@ -10,7 +10,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/node_update.go b/client/node_update.go index 62af964cf0..0265d4fc01 100644 --- a/client/node_update.go +++ b/client/node_update.go @@ -4,7 +4,7 @@ import ( "context" "net/url" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" ) // NodeUpdate updates a Node. diff --git a/client/node_update_test.go b/client/node_update_test.go index f8976d2040..84352c5619 100644 --- a/client/node_update_test.go +++ b/client/node_update_test.go @@ -10,7 +10,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/ping.go b/client/ping.go index 385fdf0524..974e8ad156 100644 --- a/client/ping.go +++ b/client/ping.go @@ -6,9 +6,9 @@ import ( "path" "strings" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/swarm" ) // Ping pings the server and returns the value of the "Docker-Experimental", diff --git a/client/ping_test.go b/client/ping_test.go index bffc17fe63..8e5e86048e 100644 --- a/client/ping_test.go +++ b/client/ping_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/plugin_create.go b/client/plugin_create.go index eaba7ee653..e7b03fcc59 100644 --- a/client/plugin_create.go +++ b/client/plugin_create.go @@ -6,7 +6,7 @@ import ( "net/http" "net/url" - "github.com/docker/docker/api/types" + "github.com/moby/moby/api/types" ) // PluginCreate creates a plugin diff --git a/client/plugin_disable.go b/client/plugin_disable.go index 4049b1b6ac..2f37f10968 100644 --- a/client/plugin_disable.go +++ b/client/plugin_disable.go @@ -4,7 +4,7 @@ import ( "context" "net/url" - "github.com/docker/docker/api/types" + "github.com/moby/moby/api/types" ) // PluginDisable disables a plugin diff --git a/client/plugin_disable_test.go b/client/plugin_disable_test.go index 4f14e64a6a..9cc8385615 100644 --- a/client/plugin_disable_test.go +++ b/client/plugin_disable_test.go @@ -10,7 +10,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types" + "github.com/moby/moby/api/types" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/plugin_enable.go b/client/plugin_enable.go index 611856935d..598b19e6f6 100644 --- a/client/plugin_enable.go +++ b/client/plugin_enable.go @@ -5,7 +5,7 @@ import ( "net/url" "strconv" - "github.com/docker/docker/api/types" + "github.com/moby/moby/api/types" ) // PluginEnable enables a plugin diff --git a/client/plugin_enable_test.go b/client/plugin_enable_test.go index e1663c3ce8..58f1b0521a 100644 --- a/client/plugin_enable_test.go +++ b/client/plugin_enable_test.go @@ -10,7 +10,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types" + "github.com/moby/moby/api/types" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/plugin_inspect.go b/client/plugin_inspect.go index eaedeb8a67..fd9c3fb7ea 100644 --- a/client/plugin_inspect.go +++ b/client/plugin_inspect.go @@ -6,7 +6,7 @@ import ( "encoding/json" "io" - "github.com/docker/docker/api/types" + "github.com/moby/moby/api/types" ) // PluginInspectWithRaw inspects an existing plugin diff --git a/client/plugin_inspect_test.go b/client/plugin_inspect_test.go index 2e94e24495..dd187eaca1 100644 --- a/client/plugin_inspect_test.go +++ b/client/plugin_inspect_test.go @@ -12,7 +12,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types" + "github.com/moby/moby/api/types" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/plugin_install.go b/client/plugin_install.go index 5fd2ff2182..5da687fd21 100644 --- a/client/plugin_install.go +++ b/client/plugin_install.go @@ -9,8 +9,8 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/distribution/reference" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/registry" "github.com/pkg/errors" ) diff --git a/client/plugin_list.go b/client/plugin_list.go index f314e17f1e..dac375b3d3 100644 --- a/client/plugin_list.go +++ b/client/plugin_list.go @@ -5,8 +5,8 @@ import ( "encoding/json" "net/url" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/filters" ) // PluginList returns the installed plugins diff --git a/client/plugin_list_test.go b/client/plugin_list_test.go index e5fa2aa973..44804d72b4 100644 --- a/client/plugin_list_test.go +++ b/client/plugin_list_test.go @@ -11,8 +11,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/filters" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/plugin_push.go b/client/plugin_push.go index 4574dcddbf..778a9b99b1 100644 --- a/client/plugin_push.go +++ b/client/plugin_push.go @@ -5,7 +5,7 @@ import ( "io" "net/http" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/registry" ) // PluginPush pushes a plugin to a registry diff --git a/client/plugin_push_test.go b/client/plugin_push_test.go index 430badf72c..138c63a80a 100644 --- a/client/plugin_push_test.go +++ b/client/plugin_push_test.go @@ -10,7 +10,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/registry" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/plugin_remove.go b/client/plugin_remove.go index 2ba0a8ccc4..858d9471df 100644 --- a/client/plugin_remove.go +++ b/client/plugin_remove.go @@ -4,7 +4,7 @@ import ( "context" "net/url" - "github.com/docker/docker/api/types" + "github.com/moby/moby/api/types" ) // PluginRemove removes a plugin diff --git a/client/plugin_remove_test.go b/client/plugin_remove_test.go index b15d2c05fe..ad817a8fd7 100644 --- a/client/plugin_remove_test.go +++ b/client/plugin_remove_test.go @@ -10,7 +10,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types" + "github.com/moby/moby/api/types" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/plugin_upgrade.go b/client/plugin_upgrade.go index cd0cf4d222..a20db3ec06 100644 --- a/client/plugin_upgrade.go +++ b/client/plugin_upgrade.go @@ -7,8 +7,8 @@ import ( "net/url" "github.com/distribution/reference" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/registry" "github.com/pkg/errors" ) diff --git a/client/request.go b/client/request.go index ed6b6227d8..50c9c86c87 100644 --- a/client/request.go +++ b/client/request.go @@ -13,7 +13,7 @@ import ( "reflect" "strings" - "github.com/docker/docker/api/types" + "github.com/moby/moby/api/types" "github.com/pkg/errors" ) diff --git a/client/request_test.go b/client/request_test.go index 9d2976d78e..912d86c5b8 100644 --- a/client/request_test.go +++ b/client/request_test.go @@ -13,8 +13,8 @@ import ( "time" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/secret_create.go b/client/secret_create.go index be4a1da456..f7081f4c4f 100644 --- a/client/secret_create.go +++ b/client/secret_create.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" ) // SecretCreate creates a new secret. diff --git a/client/secret_create_test.go b/client/secret_create_test.go index 6ece7cad4b..7d7a8966c5 100644 --- a/client/secret_create_test.go +++ b/client/secret_create_test.go @@ -11,7 +11,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/secret_inspect.go b/client/secret_inspect.go index f44c00e755..da3191ec73 100644 --- a/client/secret_inspect.go +++ b/client/secret_inspect.go @@ -6,7 +6,7 @@ import ( "encoding/json" "io" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" ) // SecretInspectWithRaw returns the secret information with raw data diff --git a/client/secret_inspect_test.go b/client/secret_inspect_test.go index 4f8797742f..43518a0bc9 100644 --- a/client/secret_inspect_test.go +++ b/client/secret_inspect_test.go @@ -12,7 +12,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/secret_list.go b/client/secret_list.go index 2e37bda273..2ed1997a0a 100644 --- a/client/secret_list.go +++ b/client/secret_list.go @@ -5,8 +5,8 @@ import ( "encoding/json" "net/url" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/swarm" ) // SecretList returns the list of secrets. diff --git a/client/secret_list_test.go b/client/secret_list_test.go index c82521c2b8..c50e3ba4b6 100644 --- a/client/secret_list_test.go +++ b/client/secret_list_test.go @@ -11,8 +11,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/secret_update.go b/client/secret_update.go index a0aff7cb69..d7cb995361 100644 --- a/client/secret_update.go +++ b/client/secret_update.go @@ -4,7 +4,7 @@ import ( "context" "net/url" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" ) // SecretUpdate attempts to update a secret. diff --git a/client/secret_update_test.go b/client/secret_update_test.go index 6de1b4bfa8..568ff79e45 100644 --- a/client/secret_update_test.go +++ b/client/secret_update_test.go @@ -10,7 +10,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/service_create.go b/client/service_create.go index db7566a85d..73342c3002 100644 --- a/client/service_create.go +++ b/client/service_create.go @@ -8,9 +8,9 @@ import ( "strings" "github.com/distribution/reference" - "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/api/types/versions" + "github.com/moby/moby/api/types/registry" + "github.com/moby/moby/api/types/swarm" + "github.com/moby/moby/api/types/versions" "github.com/opencontainers/go-digest" "github.com/pkg/errors" ) diff --git a/client/service_create_test.go b/client/service_create_test.go index 4a25710955..9b89e64739 100644 --- a/client/service_create_test.go +++ b/client/service_create_test.go @@ -12,8 +12,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - registrytypes "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/api/types/swarm" + registrytypes "github.com/moby/moby/api/types/registry" + "github.com/moby/moby/api/types/swarm" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" diff --git a/client/service_inspect.go b/client/service_inspect.go index cb25ade174..dab40392a2 100644 --- a/client/service_inspect.go +++ b/client/service_inspect.go @@ -8,7 +8,7 @@ import ( "io" "net/url" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" ) // ServiceInspectWithRaw returns the service information and the raw data. diff --git a/client/service_inspect_test.go b/client/service_inspect_test.go index 9576a435de..1ae93606c6 100644 --- a/client/service_inspect_test.go +++ b/client/service_inspect_test.go @@ -12,7 +12,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/service_list.go b/client/service_list.go index 26b25ff0be..78b039d198 100644 --- a/client/service_list.go +++ b/client/service_list.go @@ -5,8 +5,8 @@ import ( "encoding/json" "net/url" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/swarm" ) // ServiceList returns the list of services. diff --git a/client/service_list_test.go b/client/service_list_test.go index ce0f655654..9bf373be37 100644 --- a/client/service_list_test.go +++ b/client/service_list_test.go @@ -11,8 +11,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/service_logs.go b/client/service_logs.go index 8bf0408261..ea39cc6c52 100644 --- a/client/service_logs.go +++ b/client/service_logs.go @@ -6,8 +6,8 @@ import ( "net/url" "time" - "github.com/docker/docker/api/types/container" - timetypes "github.com/docker/docker/api/types/time" + "github.com/moby/moby/api/types/container" + timetypes "github.com/moby/moby/api/types/time" "github.com/pkg/errors" ) diff --git a/client/service_logs_test.go b/client/service_logs_test.go index e4d79af11e..04e5379f64 100644 --- a/client/service_logs_test.go +++ b/client/service_logs_test.go @@ -14,7 +14,7 @@ import ( "time" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/service_update.go b/client/service_update.go index 9c7c3e2218..c5f80e8806 100644 --- a/client/service_update.go +++ b/client/service_update.go @@ -6,9 +6,9 @@ import ( "net/http" "net/url" - "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/api/types/versions" + "github.com/moby/moby/api/types/registry" + "github.com/moby/moby/api/types/swarm" + "github.com/moby/moby/api/types/versions" ) // ServiceUpdate updates a Service. The version number is required to avoid conflicting writes. diff --git a/client/service_update_test.go b/client/service_update_test.go index c5cb0eca5d..fe1a8834f9 100644 --- a/client/service_update_test.go +++ b/client/service_update_test.go @@ -10,7 +10,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/swarm_get_unlock_key.go b/client/swarm_get_unlock_key.go index 41151f6cd2..9a41f0ac31 100644 --- a/client/swarm_get_unlock_key.go +++ b/client/swarm_get_unlock_key.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" ) // SwarmGetUnlockKey retrieves the swarm's unlock key. diff --git a/client/swarm_get_unlock_key_test.go b/client/swarm_get_unlock_key_test.go index 849cbb72e4..5d2e40c38b 100644 --- a/client/swarm_get_unlock_key_test.go +++ b/client/swarm_get_unlock_key_test.go @@ -11,7 +11,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/swarm_init.go b/client/swarm_init.go index 7f29165493..a8d02a920f 100644 --- a/client/swarm_init.go +++ b/client/swarm_init.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" ) // SwarmInit initializes the swarm. diff --git a/client/swarm_init_test.go b/client/swarm_init_test.go index 97fbdd3c19..2644e4c4e6 100644 --- a/client/swarm_init_test.go +++ b/client/swarm_init_test.go @@ -10,7 +10,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/swarm_inspect.go b/client/swarm_inspect.go index 597693bd33..56e0ec4250 100644 --- a/client/swarm_inspect.go +++ b/client/swarm_inspect.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" ) // SwarmInspect inspects the swarm. diff --git a/client/swarm_inspect_test.go b/client/swarm_inspect_test.go index 83c188380e..cc24b55941 100644 --- a/client/swarm_inspect_test.go +++ b/client/swarm_inspect_test.go @@ -11,7 +11,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/swarm_join.go b/client/swarm_join.go index 446d4d0482..b144593015 100644 --- a/client/swarm_join.go +++ b/client/swarm_join.go @@ -3,7 +3,7 @@ package client import ( "context" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" ) // SwarmJoin joins the swarm. diff --git a/client/swarm_join_test.go b/client/swarm_join_test.go index de2bc5092c..ac7c7a4543 100644 --- a/client/swarm_join_test.go +++ b/client/swarm_join_test.go @@ -10,7 +10,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/swarm_unlock.go b/client/swarm_unlock.go index e3c756b661..3d8d68b67a 100644 --- a/client/swarm_unlock.go +++ b/client/swarm_unlock.go @@ -3,7 +3,7 @@ package client import ( "context" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" ) // SwarmUnlock unlocks locked swarm. diff --git a/client/swarm_unlock_test.go b/client/swarm_unlock_test.go index 841fc0fb29..046ba52ddd 100644 --- a/client/swarm_unlock_test.go +++ b/client/swarm_unlock_test.go @@ -10,7 +10,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/swarm_update.go b/client/swarm_update.go index 309ab194a4..948d07b7a8 100644 --- a/client/swarm_update.go +++ b/client/swarm_update.go @@ -5,7 +5,7 @@ import ( "net/url" "strconv" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" ) // SwarmUpdate updates the swarm. diff --git a/client/swarm_update_test.go b/client/swarm_update_test.go index 21a923e98b..3ece66cd8f 100644 --- a/client/swarm_update_test.go +++ b/client/swarm_update_test.go @@ -10,7 +10,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/task_inspect.go b/client/task_inspect.go index ca3924fc48..f38392d4e6 100644 --- a/client/task_inspect.go +++ b/client/task_inspect.go @@ -6,7 +6,7 @@ import ( "encoding/json" "io" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" ) // TaskInspectWithRaw returns the task information and its raw representation. diff --git a/client/task_inspect_test.go b/client/task_inspect_test.go index 002de669f3..e9d29f5cb6 100644 --- a/client/task_inspect_test.go +++ b/client/task_inspect_test.go @@ -12,7 +12,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/task_list.go b/client/task_list.go index de743e99c5..b0e612cfca 100644 --- a/client/task_list.go +++ b/client/task_list.go @@ -5,8 +5,8 @@ import ( "encoding/json" "net/url" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/swarm" ) // TaskList returns the list of tasks. diff --git a/client/task_list_test.go b/client/task_list_test.go index b954796003..1c40d6e3e6 100644 --- a/client/task_list_test.go +++ b/client/task_list_test.go @@ -11,8 +11,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/task_logs.go b/client/task_logs.go index baa55528a7..df5ff97c44 100644 --- a/client/task_logs.go +++ b/client/task_logs.go @@ -6,8 +6,8 @@ import ( "net/url" "time" - "github.com/docker/docker/api/types/container" - timetypes "github.com/docker/docker/api/types/time" + "github.com/moby/moby/api/types/container" + timetypes "github.com/moby/moby/api/types/time" ) // TaskLogs returns the logs generated by a task in an io.ReadCloser. diff --git a/client/utils.go b/client/utils.go index 7b82f185ac..6908542419 100644 --- a/client/utils.go +++ b/client/utils.go @@ -7,7 +7,7 @@ import ( "strings" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types/filters" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/client/version.go b/client/version.go index 046af16cc5..46c70b8ad5 100644 --- a/client/version.go +++ b/client/version.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" - "github.com/docker/docker/api/types" + "github.com/moby/moby/api/types" ) // ServerVersion returns information of the docker client and server host. diff --git a/client/volume_create.go b/client/volume_create.go index 1aad3f479c..dcbd453c57 100644 --- a/client/volume_create.go +++ b/client/volume_create.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" - "github.com/docker/docker/api/types/volume" + "github.com/moby/moby/api/types/volume" ) // VolumeCreate creates a volume in the docker host. diff --git a/client/volume_create_test.go b/client/volume_create_test.go index ac0a7f5ba1..5b742fe734 100644 --- a/client/volume_create_test.go +++ b/client/volume_create_test.go @@ -11,7 +11,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/volume" + "github.com/moby/moby/api/types/volume" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/volume_inspect.go b/client/volume_inspect.go index 389a4a71aa..f763bdbf66 100644 --- a/client/volume_inspect.go +++ b/client/volume_inspect.go @@ -6,7 +6,7 @@ import ( "encoding/json" "io" - "github.com/docker/docker/api/types/volume" + "github.com/moby/moby/api/types/volume" ) // VolumeInspect returns the information about a specific volume in the docker host. diff --git a/client/volume_inspect_test.go b/client/volume_inspect_test.go index 361d714aef..67009cf924 100644 --- a/client/volume_inspect_test.go +++ b/client/volume_inspect_test.go @@ -12,7 +12,7 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/volume" + "github.com/moby/moby/api/types/volume" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/volume_list.go b/client/volume_list.go index 61ed518cd6..d0d0e8b90e 100644 --- a/client/volume_list.go +++ b/client/volume_list.go @@ -5,8 +5,8 @@ import ( "encoding/json" "net/url" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/volume" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/volume" ) // VolumeList returns the volumes configured in the docker host. diff --git a/client/volume_list_test.go b/client/volume_list_test.go index 8ea0fcb9f5..0f1a0d15a2 100644 --- a/client/volume_list_test.go +++ b/client/volume_list_test.go @@ -11,8 +11,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/volume" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/volume" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/client/volume_prune.go b/client/volume_prune.go index e22f0072f9..aee6de98ab 100644 --- a/client/volume_prune.go +++ b/client/volume_prune.go @@ -5,8 +5,8 @@ import ( "encoding/json" "fmt" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/volume" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/volume" ) // VolumesPrune requests the daemon to delete unused data diff --git a/client/volume_remove.go b/client/volume_remove.go index e2a53fa9b8..c165b22f4e 100644 --- a/client/volume_remove.go +++ b/client/volume_remove.go @@ -4,7 +4,7 @@ import ( "context" "net/url" - "github.com/docker/docker/api/types/versions" + "github.com/moby/moby/api/types/versions" ) // VolumeRemove removes a volume from the docker host. diff --git a/client/volume_update.go b/client/volume_update.go index 879932f008..50a16e2c0f 100644 --- a/client/volume_update.go +++ b/client/volume_update.go @@ -4,8 +4,8 @@ import ( "context" "net/url" - "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/api/types/volume" + "github.com/moby/moby/api/types/swarm" + "github.com/moby/moby/api/types/volume" ) // VolumeUpdate updates a volume. This only works for Cluster Volumes, and diff --git a/client/volume_update_test.go b/client/volume_update_test.go index a1e8ec5753..21d6d906b0 100644 --- a/client/volume_update_test.go +++ b/client/volume_update_test.go @@ -10,8 +10,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/swarm" - volumetypes "github.com/docker/docker/api/types/volume" + "github.com/moby/moby/api/types/swarm" + volumetypes "github.com/moby/moby/api/types/volume" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/daemon/archive.go b/daemon/archive.go index 8130a5040c..211567f629 100644 --- a/daemon/archive.go +++ b/daemon/archive.go @@ -5,8 +5,8 @@ import ( "os" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/errdefs" + "github.com/moby/moby/api/types/container" ) // ContainerStatPath stats the filesystem resource at the specified path in the diff --git a/daemon/archive_unix.go b/daemon/archive_unix.go index 9b0532a76f..32a89580e7 100644 --- a/daemon/archive_unix.go +++ b/daemon/archive_unix.go @@ -8,13 +8,13 @@ import ( "os" "path/filepath" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/container" volumemounts "github.com/docker/docker/daemon/volume/mounts" "github.com/docker/docker/errdefs" "github.com/docker/docker/pkg/ioutils" "github.com/moby/go-archive" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" "github.com/pkg/errors" ) diff --git a/daemon/archive_windows.go b/daemon/archive_windows.go index 830fb105d0..323a232acf 100644 --- a/daemon/archive_windows.go +++ b/daemon/archive_windows.go @@ -6,13 +6,13 @@ import ( "os" "path/filepath" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/container" "github.com/docker/docker/errdefs" "github.com/docker/docker/pkg/ioutils" "github.com/moby/go-archive" "github.com/moby/go-archive/chrootarchive" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" ) // containerStatPath stats the filesystem resource at the specified path in this diff --git a/daemon/attach.go b/daemon/attach.go index 4b52e7b920..f0a9bd6fdf 100644 --- a/daemon/attach.go +++ b/daemon/attach.go @@ -6,14 +6,14 @@ import ( "io" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/internal/stream" "github.com/docker/docker/daemon/logger" "github.com/docker/docker/errdefs" "github.com/docker/docker/pkg/stdcopy" + "github.com/moby/moby/api/types/backend" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" "github.com/moby/term" "github.com/pkg/errors" ) diff --git a/daemon/auth.go b/daemon/auth.go index 3e76a400c2..0d8b0949e8 100644 --- a/daemon/auth.go +++ b/daemon/auth.go @@ -3,8 +3,8 @@ package daemon import ( "context" - "github.com/docker/docker/api/types/registry" "github.com/docker/docker/dockerversion" + "github.com/moby/moby/api/types/registry" ) // AuthenticateToRegistry checks the validity of credentials in authConfig diff --git a/daemon/build.go b/daemon/build.go index cae0cda850..c1d15d7281 100644 --- a/daemon/build.go +++ b/daemon/build.go @@ -4,7 +4,7 @@ import ( "context" "github.com/distribution/reference" - "github.com/docker/docker/api/types/events" + "github.com/moby/moby/api/types/events" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/daemon/builder/backend/backend.go b/daemon/builder/backend/backend.go index 6b48b1f7f6..445c14c34d 100644 --- a/daemon/builder/backend/backend.go +++ b/daemon/builder/backend/backend.go @@ -6,14 +6,14 @@ import ( "strconv" "github.com/distribution/reference" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/builder" daemonevents "github.com/docker/docker/daemon/events" buildkit "github.com/docker/docker/daemon/internal/builder-next" "github.com/docker/docker/image" "github.com/docker/docker/pkg/stringid" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/events" "github.com/pkg/errors" "google.golang.org/grpc" ) diff --git a/daemon/builder/builder.go b/daemon/builder/builder.go index a67ba28db2..ca9b50e5c1 100644 --- a/daemon/builder/builder.go +++ b/daemon/builder/builder.go @@ -8,10 +8,10 @@ import ( "context" "io" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/image" "github.com/docker/docker/layer" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/container" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/daemon/builder/dockerfile/builder.go b/daemon/builder/dockerfile/builder.go index f9a1204f0c..20e612fa5e 100644 --- a/daemon/builder/dockerfile/builder.go +++ b/daemon/builder/dockerfile/builder.go @@ -10,9 +10,6 @@ import ( "github.com/containerd/log" "github.com/containerd/platforms" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/builder" "github.com/docker/docker/daemon/builder/remotecontext" "github.com/docker/docker/errdefs" @@ -20,6 +17,9 @@ import ( "github.com/moby/buildkit/frontend/dockerfile/instructions" "github.com/moby/buildkit/frontend/dockerfile/parser" "github.com/moby/buildkit/frontend/dockerfile/shell" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/container" "github.com/moby/sys/user" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" diff --git a/daemon/builder/dockerfile/containerbackend.go b/daemon/builder/dockerfile/containerbackend.go index 73d303166b..529e990055 100644 --- a/daemon/builder/dockerfile/containerbackend.go +++ b/daemon/builder/dockerfile/containerbackend.go @@ -7,10 +7,10 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/builder" "github.com/docker/docker/pkg/stringid" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/container" "github.com/pkg/errors" ) diff --git a/daemon/builder/dockerfile/dispatchers_test.go b/daemon/builder/dockerfile/dispatchers_test.go index 716cc1a028..f05f7515d0 100644 --- a/daemon/builder/dockerfile/dispatchers_test.go +++ b/daemon/builder/dockerfile/dispatchers_test.go @@ -8,9 +8,6 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/builder" "github.com/docker/docker/image" "github.com/docker/docker/oci" @@ -18,6 +15,9 @@ import ( "github.com/moby/buildkit/frontend/dockerfile/instructions" "github.com/moby/buildkit/frontend/dockerfile/parser" "github.com/moby/buildkit/frontend/dockerfile/shell" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/daemon/builder/dockerfile/dispatchers_unix.go b/daemon/builder/dockerfile/dispatchers_unix.go index 9b4fd7ccac..6ba6e5eb2d 100644 --- a/daemon/builder/dockerfile/dispatchers_unix.go +++ b/daemon/builder/dockerfile/dispatchers_unix.go @@ -7,8 +7,8 @@ import ( "os" "path/filepath" - "github.com/docker/docker/api/types/container" "github.com/moby/buildkit/frontend/dockerfile/instructions" + "github.com/moby/moby/api/types/container" ) // normalizeWorkdir normalizes a user requested working directory in a diff --git a/daemon/builder/dockerfile/dispatchers_windows.go b/daemon/builder/dockerfile/dispatchers_windows.go index a306345fee..5152f381dc 100644 --- a/daemon/builder/dockerfile/dispatchers_windows.go +++ b/daemon/builder/dockerfile/dispatchers_windows.go @@ -8,9 +8,9 @@ import ( "path/filepath" "strings" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/internal/lazyregexp" "github.com/moby/buildkit/frontend/dockerfile/instructions" + "github.com/moby/moby/api/types/container" ) var pattern = lazyregexp.New(`^[a-zA-Z]:\.$`) diff --git a/daemon/builder/dockerfile/evaluator.go b/daemon/builder/dockerfile/evaluator.go index b772ee8cfd..4dddc714ad 100644 --- a/daemon/builder/dockerfile/evaluator.go +++ b/daemon/builder/dockerfile/evaluator.go @@ -25,13 +25,13 @@ import ( "strconv" "strings" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/builder" "github.com/docker/docker/errdefs" "github.com/docker/docker/image" "github.com/docker/docker/oci" "github.com/moby/buildkit/frontend/dockerfile/instructions" "github.com/moby/buildkit/frontend/dockerfile/shell" + "github.com/moby/moby/api/types/container" "github.com/pkg/errors" ) diff --git a/daemon/builder/dockerfile/imagecontext.go b/daemon/builder/dockerfile/imagecontext.go index 57366d9e93..98ea2fc3db 100644 --- a/daemon/builder/dockerfile/imagecontext.go +++ b/daemon/builder/dockerfile/imagecontext.go @@ -6,9 +6,9 @@ import ( "github.com/containerd/log" "github.com/containerd/platforms" - "github.com/docker/docker/api/types/backend" "github.com/docker/docker/daemon/builder" dockerimage "github.com/docker/docker/image" + "github.com/moby/moby/api/types/backend" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" ) diff --git a/daemon/builder/dockerfile/imageprobe.go b/daemon/builder/dockerfile/imageprobe.go index 821f753aca..06267466d5 100644 --- a/daemon/builder/dockerfile/imageprobe.go +++ b/daemon/builder/dockerfile/imageprobe.go @@ -4,8 +4,8 @@ import ( "context" "github.com/containerd/log" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/builder" + "github.com/moby/moby/api/types/container" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/daemon/builder/dockerfile/internals.go b/daemon/builder/dockerfile/internals.go index 1d217f3b81..a27d4139ac 100644 --- a/daemon/builder/dockerfile/internals.go +++ b/daemon/builder/dockerfile/internals.go @@ -12,10 +12,6 @@ import ( "github.com/containerd/log" "github.com/containerd/platforms" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" "github.com/docker/docker/daemon/builder" networkSettings "github.com/docker/docker/daemon/network" "github.com/docker/docker/image" @@ -23,6 +19,10 @@ import ( "github.com/docker/go-connections/nat" "github.com/moby/go-archive" "github.com/moby/go-archive/chrootarchive" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" ) diff --git a/daemon/builder/dockerfile/internals_linux_test.go b/daemon/builder/dockerfile/internals_linux_test.go index 3203ce55b8..07fba0cf96 100644 --- a/daemon/builder/dockerfile/internals_linux_test.go +++ b/daemon/builder/dockerfile/internals_linux_test.go @@ -6,7 +6,7 @@ import ( "path/filepath" "testing" - "github.com/docker/docker/api/types/build" + "github.com/moby/moby/api/types/build" "github.com/moby/sys/user" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/daemon/builder/dockerfile/internals_test.go b/daemon/builder/dockerfile/internals_test.go index 5806b5da0d..57958b0a20 100644 --- a/daemon/builder/dockerfile/internals_test.go +++ b/daemon/builder/dockerfile/internals_test.go @@ -7,15 +7,15 @@ import ( "runtime" "testing" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/builder" "github.com/docker/docker/daemon/builder/remotecontext" "github.com/docker/docker/image" "github.com/docker/docker/layer" "github.com/docker/go-connections/nat" "github.com/moby/go-archive" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/container" "github.com/opencontainers/go-digest" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/daemon/builder/dockerfile/internals_windows.go b/daemon/builder/dockerfile/internals_windows.go index f23b1b23c3..afec1b1f9c 100644 --- a/daemon/builder/dockerfile/internals_windows.go +++ b/daemon/builder/dockerfile/internals_windows.go @@ -8,10 +8,10 @@ import ( "strings" "github.com/containerd/platforms" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/mount" "github.com/docker/docker/errdefs" "github.com/docker/docker/pkg/jsonmessage" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/mount" "github.com/moby/sys/user" "golang.org/x/sys/windows" ) diff --git a/daemon/builder/dockerfile/mockbackend_test.go b/daemon/builder/dockerfile/mockbackend_test.go index 59ffff9706..b4cd649c49 100644 --- a/daemon/builder/dockerfile/mockbackend_test.go +++ b/daemon/builder/dockerfile/mockbackend_test.go @@ -6,11 +6,11 @@ import ( "io" "runtime" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/builder" "github.com/docker/docker/image" "github.com/docker/docker/layer" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/container" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/daemon/builder/remotecontext/detect.go b/daemon/builder/remotecontext/detect.go index 243bcb9bad..00bf786432 100644 --- a/daemon/builder/remotecontext/detect.go +++ b/daemon/builder/remotecontext/detect.go @@ -12,11 +12,11 @@ import ( "github.com/containerd/continuity/driver" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" "github.com/docker/docker/daemon/builder" "github.com/docker/docker/daemon/builder/remotecontext/urlutil" "github.com/docker/docker/errdefs" "github.com/moby/buildkit/frontend/dockerfile/parser" + "github.com/moby/moby/api/types/backend" "github.com/moby/patternmatcher" "github.com/moby/patternmatcher/ignorefile" "github.com/moby/sys/symlink" diff --git a/daemon/cdi.go b/daemon/cdi.go index 2f4e8bf799..66889f6a17 100644 --- a/daemon/cdi.go +++ b/daemon/cdi.go @@ -6,10 +6,10 @@ import ( "os" "github.com/containerd/log" - "github.com/docker/docker/api/types/system" "github.com/docker/docker/daemon/config" "github.com/docker/docker/errdefs" "github.com/hashicorp/go-multierror" + "github.com/moby/moby/api/types/system" "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" "tags.cncf.io/container-device-interface/pkg/cdi" diff --git a/daemon/checkpoint.go b/daemon/checkpoint.go index 9faf9a0390..f024731846 100644 --- a/daemon/checkpoint.go +++ b/daemon/checkpoint.go @@ -6,9 +6,9 @@ import ( "os" "path/filepath" - "github.com/docker/docker/api/types/checkpoint" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/names" + "github.com/moby/moby/api/types/checkpoint" + "github.com/moby/moby/api/types/events" ) var ( diff --git a/daemon/cluster.go b/daemon/cluster.go index a6a3933354..bf1a6376c9 100644 --- a/daemon/cluster.go +++ b/daemon/cluster.go @@ -1,9 +1,9 @@ package daemon import ( - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/network" lncluster "github.com/docker/docker/daemon/libnetwork/cluster" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/network" ) // Cluster is the interface for github.com/docker/docker/daemon/cluster.(*Cluster). diff --git a/daemon/cluster/cluster.go b/daemon/cluster/cluster.go index 24be6a8aa5..0ffe55ba56 100644 --- a/daemon/cluster/cluster.go +++ b/daemon/cluster/cluster.go @@ -50,12 +50,12 @@ import ( "time" "github.com/containerd/log" - "github.com/docker/docker/api/types/network" - types "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/daemon/cluster/controllers/plugin" executorpkg "github.com/docker/docker/daemon/cluster/executor" lncluster "github.com/docker/docker/daemon/libnetwork/cluster" "github.com/docker/docker/pkg/stack" + "github.com/moby/moby/api/types/network" + types "github.com/moby/moby/api/types/swarm" swarmapi "github.com/moby/swarmkit/v2/api" swarmnode "github.com/moby/swarmkit/v2/node" "github.com/pkg/errors" diff --git a/daemon/cluster/configs.go b/daemon/cluster/configs.go index c1d5dc039b..f2787645f8 100644 --- a/daemon/cluster/configs.go +++ b/daemon/cluster/configs.go @@ -3,8 +3,8 @@ package cluster import ( "context" - types "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/daemon/cluster/convert" + types "github.com/moby/moby/api/types/swarm" swarmapi "github.com/moby/swarmkit/v2/api" "google.golang.org/grpc" ) diff --git a/daemon/cluster/controllers/plugin/controller.go b/daemon/cluster/controllers/plugin/controller.go index f5a0ce1059..e29b932b7c 100644 --- a/daemon/cluster/controllers/plugin/controller.go +++ b/daemon/cluster/controllers/plugin/controller.go @@ -8,13 +8,13 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/distribution/reference" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/api/types/swarm/runtime" "github.com/docker/docker/daemon/pkg/plugin" v2 "github.com/docker/docker/daemon/pkg/plugin/v2" "github.com/gogo/protobuf/proto" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/registry" + "github.com/moby/moby/api/types/swarm/runtime" "github.com/moby/swarmkit/v2/api" "github.com/pkg/errors" ) diff --git a/daemon/cluster/controllers/plugin/controller_test.go b/daemon/cluster/controllers/plugin/controller_test.go index ed94942616..48a41f2de0 100644 --- a/daemon/cluster/controllers/plugin/controller_test.go +++ b/daemon/cluster/controllers/plugin/controller_test.go @@ -11,12 +11,12 @@ import ( "github.com/containerd/log" "github.com/distribution/reference" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/api/types/swarm/runtime" "github.com/docker/docker/daemon/pkg/plugin" v2 "github.com/docker/docker/daemon/pkg/plugin/v2" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/registry" + "github.com/moby/moby/api/types/swarm/runtime" "github.com/moby/pubsub" "github.com/sirupsen/logrus" ) diff --git a/daemon/cluster/convert/config.go b/daemon/cluster/convert/config.go index 01ffd426ac..573cd9f299 100644 --- a/daemon/cluster/convert/config.go +++ b/daemon/cluster/convert/config.go @@ -1,8 +1,8 @@ package convert import ( - swarmtypes "github.com/docker/docker/api/types/swarm" gogotypes "github.com/gogo/protobuf/types" + swarmtypes "github.com/moby/moby/api/types/swarm" swarmapi "github.com/moby/swarmkit/v2/api" ) diff --git a/daemon/cluster/convert/container.go b/daemon/cluster/convert/container.go index 631cfcfab5..f03f3797f1 100644 --- a/daemon/cluster/convert/container.go +++ b/daemon/cluster/convert/container.go @@ -7,10 +7,10 @@ import ( "strings" "github.com/containerd/log" - "github.com/docker/docker/api/types/container" - mounttypes "github.com/docker/docker/api/types/mount" - types "github.com/docker/docker/api/types/swarm" gogotypes "github.com/gogo/protobuf/types" + "github.com/moby/moby/api/types/container" + mounttypes "github.com/moby/moby/api/types/mount" + types "github.com/moby/moby/api/types/swarm" swarmapi "github.com/moby/swarmkit/v2/api" "github.com/pkg/errors" ) diff --git a/daemon/cluster/convert/network.go b/daemon/cluster/convert/network.go index 5951a34f7e..16645f80c2 100644 --- a/daemon/cluster/convert/network.go +++ b/daemon/cluster/convert/network.go @@ -3,10 +3,10 @@ package convert import ( "strings" - "github.com/docker/docker/api/types/network" - types "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/daemon/libnetwork/scope" gogotypes "github.com/gogo/protobuf/types" + "github.com/moby/moby/api/types/network" + types "github.com/moby/moby/api/types/swarm" swarmapi "github.com/moby/swarmkit/v2/api" ) diff --git a/daemon/cluster/convert/node.go b/daemon/cluster/convert/node.go index cedd736213..7c3b43caf0 100644 --- a/daemon/cluster/convert/node.go +++ b/daemon/cluster/convert/node.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - types "github.com/docker/docker/api/types/swarm" gogotypes "github.com/gogo/protobuf/types" + types "github.com/moby/moby/api/types/swarm" swarmapi "github.com/moby/swarmkit/v2/api" ) diff --git a/daemon/cluster/convert/node_test.go b/daemon/cluster/convert/node_test.go index 617c0fc4d2..b7110f2079 100644 --- a/daemon/cluster/convert/node_test.go +++ b/daemon/cluster/convert/node_test.go @@ -3,7 +3,7 @@ package convert import ( "testing" - types "github.com/docker/docker/api/types/swarm" + types "github.com/moby/moby/api/types/swarm" swarmapi "github.com/moby/swarmkit/v2/api" "gotest.tools/v3/assert" ) diff --git a/daemon/cluster/convert/secret.go b/daemon/cluster/convert/secret.go index 1db38bc711..0fe55b3b6f 100644 --- a/daemon/cluster/convert/secret.go +++ b/daemon/cluster/convert/secret.go @@ -1,8 +1,8 @@ package convert import ( - swarmtypes "github.com/docker/docker/api/types/swarm" gogotypes "github.com/gogo/protobuf/types" + swarmtypes "github.com/moby/moby/api/types/swarm" swarmapi "github.com/moby/swarmkit/v2/api" ) diff --git a/daemon/cluster/convert/service.go b/daemon/cluster/convert/service.go index 5dca2426f1..2fdbc24b7d 100644 --- a/daemon/cluster/convert/service.go +++ b/daemon/cluster/convert/service.go @@ -4,11 +4,11 @@ import ( "fmt" "strings" - types "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/api/types/swarm/runtime" "github.com/docker/docker/pkg/namesgenerator" "github.com/gogo/protobuf/proto" gogotypes "github.com/gogo/protobuf/types" + types "github.com/moby/moby/api/types/swarm" + "github.com/moby/moby/api/types/swarm/runtime" swarmapi "github.com/moby/swarmkit/v2/api" "github.com/moby/swarmkit/v2/api/genericresource" "github.com/pkg/errors" diff --git a/daemon/cluster/convert/service_test.go b/daemon/cluster/convert/service_test.go index b45f0103f2..333ba64cc5 100644 --- a/daemon/cluster/convert/service_test.go +++ b/daemon/cluster/convert/service_test.go @@ -4,11 +4,11 @@ import ( "errors" "testing" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/mount" - swarmtypes "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/api/types/swarm/runtime" google_protobuf3 "github.com/gogo/protobuf/types" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/mount" + swarmtypes "github.com/moby/moby/api/types/swarm" + "github.com/moby/moby/api/types/swarm/runtime" swarmapi "github.com/moby/swarmkit/v2/api" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/daemon/cluster/convert/swarm.go b/daemon/cluster/convert/swarm.go index f3d64ab58a..778ba6edc0 100644 --- a/daemon/cluster/convert/swarm.go +++ b/daemon/cluster/convert/swarm.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - types "github.com/docker/docker/api/types/swarm" gogotypes "github.com/gogo/protobuf/types" + types "github.com/moby/moby/api/types/swarm" swarmapi "github.com/moby/swarmkit/v2/api" "github.com/moby/swarmkit/v2/ca" ) diff --git a/daemon/cluster/convert/task.go b/daemon/cluster/convert/task.go index 5f913f30f6..03c43b4796 100644 --- a/daemon/cluster/convert/task.go +++ b/daemon/cluster/convert/task.go @@ -3,8 +3,8 @@ package convert import ( "strings" - types "github.com/docker/docker/api/types/swarm" gogotypes "github.com/gogo/protobuf/types" + types "github.com/moby/moby/api/types/swarm" swarmapi "github.com/moby/swarmkit/v2/api" ) diff --git a/daemon/cluster/convert/volume.go b/daemon/cluster/convert/volume.go index 4f5bcd3e55..4566a29bb8 100644 --- a/daemon/cluster/convert/volume.go +++ b/daemon/cluster/convert/volume.go @@ -1,8 +1,8 @@ package convert import ( - volumetypes "github.com/docker/docker/api/types/volume" gogotypes "github.com/gogo/protobuf/types" + volumetypes "github.com/moby/moby/api/types/volume" swarmapi "github.com/moby/swarmkit/v2/api" ) diff --git a/daemon/cluster/convert/volume_test.go b/daemon/cluster/convert/volume_test.go index 92594aee25..6444b957de 100644 --- a/daemon/cluster/convert/volume_test.go +++ b/daemon/cluster/convert/volume_test.go @@ -3,7 +3,7 @@ package convert import ( "testing" - volumetypes "github.com/docker/docker/api/types/volume" + volumetypes "github.com/moby/moby/api/types/volume" swarmapi "github.com/moby/swarmkit/v2/api" "gotest.tools/v3/assert" diff --git a/daemon/cluster/executor/backend.go b/daemon/cluster/executor/backend.go index 00ec1849b7..44c4614311 100644 --- a/daemon/cluster/executor/backend.go +++ b/daemon/cluster/executor/backend.go @@ -7,15 +7,6 @@ import ( "github.com/distribution/reference" "github.com/docker/distribution" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/api/types/system" - "github.com/docker/docker/api/types/volume" clustertypes "github.com/docker/docker/daemon/cluster/provider" "github.com/docker/docker/daemon/libnetwork" "github.com/docker/docker/daemon/libnetwork/cluster" @@ -24,6 +15,15 @@ import ( "github.com/docker/docker/daemon/pkg/plugin" volumeopts "github.com/docker/docker/daemon/volume/service/opts" "github.com/docker/docker/image" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/network" + "github.com/moby/moby/api/types/registry" + "github.com/moby/moby/api/types/swarm" + "github.com/moby/moby/api/types/system" + "github.com/moby/moby/api/types/volume" "github.com/moby/swarmkit/v2/agent/exec" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/daemon/cluster/executor/container/adapter.go b/daemon/cluster/executor/container/adapter.go index 4efc1325d1..e313e4ca46 100644 --- a/daemon/cluster/executor/container/adapter.go +++ b/daemon/cluster/executor/container/adapter.go @@ -13,11 +13,6 @@ import ( "github.com/containerd/log" "github.com/distribution/reference" - "github.com/docker/docker/api/types/backend" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/registry" "github.com/docker/docker/daemon" "github.com/docker/docker/daemon/cluster/convert" executorpkg "github.com/docker/docker/daemon/cluster/executor" @@ -25,6 +20,11 @@ import ( networkSettings "github.com/docker/docker/daemon/network" volumeopts "github.com/docker/docker/daemon/volume/service/opts" gogotypes "github.com/gogo/protobuf/types" + "github.com/moby/moby/api/types/backend" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/network" + "github.com/moby/moby/api/types/registry" "github.com/moby/swarmkit/v2/agent/exec" "github.com/moby/swarmkit/v2/api" swarmlog "github.com/moby/swarmkit/v2/log" diff --git a/daemon/cluster/executor/container/container.go b/daemon/cluster/executor/container/container.go index 5492f5d961..c00fa59f74 100644 --- a/daemon/cluster/executor/container/container.go +++ b/daemon/cluster/executor/container/container.go @@ -10,18 +10,18 @@ import ( "github.com/containerd/log" "github.com/distribution/reference" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" - enginemount "github.com/docker/docker/api/types/mount" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/volume" "github.com/docker/docker/daemon/cluster/convert" executorpkg "github.com/docker/docker/daemon/cluster/executor" clustertypes "github.com/docker/docker/daemon/cluster/provider" "github.com/docker/docker/daemon/libnetwork/scope" "github.com/docker/go-connections/nat" gogotypes "github.com/gogo/protobuf/types" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/filters" + enginemount "github.com/moby/moby/api/types/mount" + "github.com/moby/moby/api/types/network" + "github.com/moby/moby/api/types/volume" "github.com/moby/swarmkit/v2/agent/exec" "github.com/moby/swarmkit/v2/api" "github.com/moby/swarmkit/v2/api/genericresource" diff --git a/daemon/cluster/executor/container/container_test.go b/daemon/cluster/executor/container/container_test.go index 0538286901..e7327f2c26 100644 --- a/daemon/cluster/executor/container/container_test.go +++ b/daemon/cluster/executor/container/container_test.go @@ -3,8 +3,8 @@ package container import ( "testing" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/mount" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/mount" swarmapi "github.com/moby/swarmkit/v2/api" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/daemon/cluster/executor/container/controller.go b/daemon/cluster/executor/container/controller.go index fdff258209..915e94b2cd 100644 --- a/daemon/cluster/executor/container/controller.go +++ b/daemon/cluster/executor/container/controller.go @@ -9,12 +9,12 @@ import ( "time" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" executorpkg "github.com/docker/docker/daemon/cluster/executor" "github.com/docker/docker/daemon/libnetwork" "github.com/docker/go-connections/nat" gogotypes "github.com/gogo/protobuf/types" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" "github.com/moby/swarmkit/v2/agent/exec" "github.com/moby/swarmkit/v2/api" "github.com/moby/swarmkit/v2/log" diff --git a/daemon/cluster/executor/container/executor.go b/daemon/cluster/executor/container/executor.go index 92508161d5..33985e5813 100644 --- a/daemon/cluster/executor/container/executor.go +++ b/daemon/cluster/executor/container/executor.go @@ -8,15 +8,15 @@ import ( "sync" "github.com/containerd/log" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/network" - swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/daemon/cluster/controllers/plugin" "github.com/docker/docker/daemon/cluster/convert" executorpkg "github.com/docker/docker/daemon/cluster/executor" clustertypes "github.com/docker/docker/daemon/cluster/provider" "github.com/docker/docker/daemon/libnetwork" networktypes "github.com/docker/docker/daemon/libnetwork/types" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/network" + swarmtypes "github.com/moby/moby/api/types/swarm" "github.com/moby/swarmkit/v2/agent" "github.com/moby/swarmkit/v2/agent/exec" "github.com/moby/swarmkit/v2/api" diff --git a/daemon/cluster/executor/container/health_test.go b/daemon/cluster/executor/container/health_test.go index e8bc139d73..b67adf2fb4 100644 --- a/daemon/cluster/executor/container/health_test.go +++ b/daemon/cluster/executor/container/health_test.go @@ -8,11 +8,11 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" - eventtypes "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/events" + containertypes "github.com/moby/moby/api/types/container" + eventtypes "github.com/moby/moby/api/types/events" "github.com/moby/swarmkit/v2/api" ) diff --git a/daemon/cluster/filters.go b/daemon/cluster/filters.go index a7c7bbd173..450f45f0af 100644 --- a/daemon/cluster/filters.go +++ b/daemon/cluster/filters.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types/filters" swarmapi "github.com/moby/swarmkit/v2/api" ) diff --git a/daemon/cluster/filters_test.go b/daemon/cluster/filters_test.go index 0f32e16adb..a2643d487f 100644 --- a/daemon/cluster/filters_test.go +++ b/daemon/cluster/filters_test.go @@ -3,7 +3,7 @@ package cluster import ( "testing" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types/filters" ) func TestNewListSecretsFilters(t *testing.T) { diff --git a/daemon/cluster/networks.go b/daemon/cluster/networks.go index 186f9285b6..f26036e882 100644 --- a/daemon/cluster/networks.go +++ b/daemon/cluster/networks.go @@ -5,12 +5,12 @@ import ( "fmt" "github.com/containerd/log" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/network" - types "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/daemon/cluster/convert" networkSettings "github.com/docker/docker/daemon/network" "github.com/docker/docker/errdefs" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/network" + types "github.com/moby/moby/api/types/swarm" swarmapi "github.com/moby/swarmkit/v2/api" "github.com/pkg/errors" ) diff --git a/daemon/cluster/noderunner.go b/daemon/cluster/noderunner.go index ef98385438..71ee206d53 100644 --- a/daemon/cluster/noderunner.go +++ b/daemon/cluster/noderunner.go @@ -9,11 +9,11 @@ import ( "time" "github.com/containerd/log" - types "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/daemon/cluster/convert" "github.com/docker/docker/daemon/cluster/executor/container" lncluster "github.com/docker/docker/daemon/libnetwork/cluster" "github.com/docker/docker/daemon/libnetwork/cnmallocator" + types "github.com/moby/moby/api/types/swarm" swarmapi "github.com/moby/swarmkit/v2/api" "github.com/moby/swarmkit/v2/manager/allocator/networkallocator" swarmnode "github.com/moby/swarmkit/v2/node" diff --git a/daemon/cluster/nodes.go b/daemon/cluster/nodes.go index 0ea6e9f83b..ec912759f7 100644 --- a/daemon/cluster/nodes.go +++ b/daemon/cluster/nodes.go @@ -3,9 +3,9 @@ package cluster import ( "context" - types "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/daemon/cluster/convert" "github.com/docker/docker/errdefs" + types "github.com/moby/moby/api/types/swarm" swarmapi "github.com/moby/swarmkit/v2/api" "google.golang.org/grpc" ) diff --git a/daemon/cluster/provider/network.go b/daemon/cluster/provider/network.go index 6bd6b126ca..9a57736536 100644 --- a/daemon/cluster/provider/network.go +++ b/daemon/cluster/provider/network.go @@ -1,6 +1,6 @@ package provider -import "github.com/docker/docker/api/types/network" +import "github.com/moby/moby/api/types/network" // NetworkCreateRequest is a request when creating a network. type NetworkCreateRequest struct { diff --git a/daemon/cluster/secrets.go b/daemon/cluster/secrets.go index d6285a5c28..af247222b7 100644 --- a/daemon/cluster/secrets.go +++ b/daemon/cluster/secrets.go @@ -3,8 +3,8 @@ package cluster import ( "context" - types "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/daemon/cluster/convert" + types "github.com/moby/moby/api/types/swarm" swarmapi "github.com/moby/swarmkit/v2/api" "google.golang.org/grpc" ) diff --git a/daemon/cluster/services.go b/daemon/cluster/services.go index a45f9fcd94..84f4496a3b 100644 --- a/daemon/cluster/services.go +++ b/daemon/cluster/services.go @@ -13,14 +13,14 @@ import ( "github.com/containerd/log" "github.com/distribution/reference" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/api/types/swarm" - timetypes "github.com/docker/docker/api/types/time" "github.com/docker/docker/daemon/cluster/convert" "github.com/docker/docker/errdefs" gogotypes "github.com/gogo/protobuf/types" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/registry" + "github.com/moby/moby/api/types/swarm" + timetypes "github.com/moby/moby/api/types/time" swarmapi "github.com/moby/swarmkit/v2/api" "github.com/opencontainers/go-digest" "github.com/pkg/errors" diff --git a/daemon/cluster/swarm.go b/daemon/cluster/swarm.go index 56b066c30a..4b55b38ee7 100644 --- a/daemon/cluster/swarm.go +++ b/daemon/cluster/swarm.go @@ -8,14 +8,14 @@ import ( "time" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" - types "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/daemon/cluster/convert" "github.com/docker/docker/daemon/pkg/opts" "github.com/docker/docker/errdefs" "github.com/docker/docker/pkg/stack" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" + types "github.com/moby/moby/api/types/swarm" swarmapi "github.com/moby/swarmkit/v2/api" "github.com/moby/swarmkit/v2/manager/encryption" swarmnode "github.com/moby/swarmkit/v2/node" diff --git a/daemon/cluster/tasks.go b/daemon/cluster/tasks.go index 5a9c044ddc..78b793f17b 100644 --- a/daemon/cluster/tasks.go +++ b/daemon/cluster/tasks.go @@ -3,9 +3,9 @@ package cluster import ( "context" - "github.com/docker/docker/api/types/filters" - types "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/daemon/cluster/convert" + "github.com/moby/moby/api/types/filters" + types "github.com/moby/moby/api/types/swarm" swarmapi "github.com/moby/swarmkit/v2/api" "google.golang.org/grpc" ) diff --git a/daemon/cluster/volumes.go b/daemon/cluster/volumes.go index e27239aabe..f829207fb0 100644 --- a/daemon/cluster/volumes.go +++ b/daemon/cluster/volumes.go @@ -5,9 +5,9 @@ import ( "fmt" cerrdefs "github.com/containerd/errdefs" - volumetypes "github.com/docker/docker/api/types/volume" "github.com/docker/docker/daemon/cluster/convert" "github.com/docker/docker/errdefs" + volumetypes "github.com/moby/moby/api/types/volume" swarmapi "github.com/moby/swarmkit/v2/api" "google.golang.org/grpc" ) diff --git a/daemon/commit.go b/daemon/commit.go index 7303d6464b..e00bcc7d63 100644 --- a/daemon/commit.go +++ b/daemon/commit.go @@ -8,12 +8,12 @@ import ( "time" "github.com/distribution/reference" - "github.com/docker/docker/api/types/backend" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/builder/dockerfile" "github.com/docker/docker/daemon/internal/metrics" "github.com/docker/docker/errdefs" + "github.com/moby/moby/api/types/backend" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" "github.com/pkg/errors" ) diff --git a/daemon/config/builder.go b/daemon/config/builder.go index 22cdd48f4c..26812091d0 100644 --- a/daemon/config/builder.go +++ b/daemon/config/builder.go @@ -5,8 +5,8 @@ import ( "sort" "strings" - "github.com/docker/docker/api/types/filters" bkconfig "github.com/moby/buildkit/cmd/buildkitd/config" + "github.com/moby/moby/api/types/filters" ) // BuilderGCRule represents a GC rule for buildkit cache diff --git a/daemon/config/builder_test.go b/daemon/config/builder_test.go index 3acc463063..80a0f6db15 100644 --- a/daemon/config/builder_test.go +++ b/daemon/config/builder_test.go @@ -4,8 +4,8 @@ import ( "encoding/json" "testing" - "github.com/docker/docker/api/types/filters" "github.com/google/go-cmp/cmp" + "github.com/moby/moby/api/types/filters" "gotest.tools/v3/assert" "gotest.tools/v3/fs" ) diff --git a/daemon/config/config.go b/daemon/config/config.go index 9a1be36852..353e2e3987 100644 --- a/daemon/config/config.go +++ b/daemon/config/config.go @@ -13,11 +13,11 @@ import ( "dario.cat/mergo" "github.com/containerd/log" - "github.com/docker/docker/api" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/daemon/pkg/opts" dopts "github.com/docker/docker/internal/opts" "github.com/docker/docker/registry" + "github.com/moby/moby/api" + "github.com/moby/moby/api/types/versions" "github.com/pkg/errors" "github.com/spf13/pflag" "golang.org/x/text/encoding" diff --git a/daemon/config/config_linux.go b/daemon/config/config_linux.go index 10478c76ae..1d11a3d3ec 100644 --- a/daemon/config/config_linux.go +++ b/daemon/config/config_linux.go @@ -10,12 +10,12 @@ import ( "github.com/containerd/cgroups/v3" "github.com/containerd/log" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/system" "github.com/docker/docker/daemon/libnetwork/drivers/bridge" "github.com/docker/docker/daemon/pkg/opts" "github.com/docker/docker/pkg/homedir" "github.com/docker/docker/pkg/rootless" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/system" "github.com/pkg/errors" ) diff --git a/daemon/config/config_linux_test.go b/daemon/config/config_linux_test.go index 9ee529ebad..5317c3287d 100644 --- a/daemon/config/config_linux_test.go +++ b/daemon/config/config_linux_test.go @@ -4,10 +4,10 @@ import ( "net/netip" "testing" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/pkg/opts" dopts "github.com/docker/docker/internal/opts" "github.com/google/go-cmp/cmp/cmpopts" + "github.com/moby/moby/api/types/container" "github.com/spf13/pflag" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/daemon/config/opts.go b/daemon/config/opts.go index 55cd68cb67..265c724c71 100644 --- a/daemon/config/opts.go +++ b/daemon/config/opts.go @@ -1,8 +1,8 @@ package config import ( - "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/daemon/cluster/convert" + "github.com/moby/moby/api/types/swarm" "github.com/moby/swarmkit/v2/api/genericresource" ) diff --git a/daemon/configs.go b/daemon/configs.go index dca3e594fd..4e1819b3af 100644 --- a/daemon/configs.go +++ b/daemon/configs.go @@ -1,7 +1,7 @@ package daemon import ( - swarmtypes "github.com/docker/docker/api/types/swarm" + swarmtypes "github.com/moby/moby/api/types/swarm" ) // SetContainerConfigReferences sets the container config references needed diff --git a/daemon/container.go b/daemon/container.go index 23233fc687..b408df258e 100644 --- a/daemon/container.go +++ b/daemon/container.go @@ -15,9 +15,6 @@ import ( "time" "github.com/containerd/log" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/mount" - networktypes "github.com/docker/docker/api/types/network" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/network" @@ -27,6 +24,9 @@ import ( "github.com/docker/docker/image" "github.com/docker/docker/oci/caps" "github.com/docker/go-connections/nat" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/mount" + networktypes "github.com/moby/moby/api/types/network" "github.com/moby/sys/signal" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/opencontainers/selinux/go-selinux" diff --git a/daemon/container/archive_windows.go b/daemon/container/archive_windows.go index e60536c0a5..e0951396cd 100644 --- a/daemon/container/archive_windows.go +++ b/daemon/container/archive_windows.go @@ -4,8 +4,8 @@ import ( "os" "path/filepath" - containertypes "github.com/docker/docker/api/types/container" "github.com/moby/go-archive" + containertypes "github.com/moby/moby/api/types/container" "github.com/pkg/errors" ) diff --git a/daemon/container/container.go b/daemon/container/container.go index 8f85523566..861b3b6cb7 100644 --- a/daemon/container/container.go +++ b/daemon/container/container.go @@ -17,10 +17,6 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/platforms" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - mounttypes "github.com/docker/docker/api/types/mount" - swarmtypes "github.com/docker/docker/api/types/swarm" libcontainerdtypes "github.com/docker/docker/daemon/internal/libcontainerd/types" "github.com/docker/docker/daemon/internal/restartmanager" "github.com/docker/docker/daemon/internal/stream" @@ -35,6 +31,10 @@ import ( "github.com/docker/docker/image" "github.com/docker/docker/oci" "github.com/docker/go-units" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" + mounttypes "github.com/moby/moby/api/types/mount" + swarmtypes "github.com/moby/moby/api/types/swarm" agentexec "github.com/moby/swarmkit/v2/agent/exec" "github.com/moby/sys/atomicwriter" "github.com/moby/sys/signal" diff --git a/daemon/container/container_test.go b/daemon/container/container_test.go index 886f51b16a..60cb50e831 100644 --- a/daemon/container/container_test.go +++ b/daemon/container/container_test.go @@ -6,9 +6,9 @@ import ( "syscall" "testing" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/daemon/logger/jsonfilelog" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" ) diff --git a/daemon/container/container_unix.go b/daemon/container/container_unix.go index 473b59edb7..e9a17451e2 100644 --- a/daemon/container/container_unix.go +++ b/daemon/container/container_unix.go @@ -10,11 +10,11 @@ import ( "github.com/containerd/continuity/fs" "github.com/containerd/log" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - mounttypes "github.com/docker/docker/api/types/mount" - swarmtypes "github.com/docker/docker/api/types/swarm" volumemounts "github.com/docker/docker/daemon/volume/mounts" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" + mounttypes "github.com/moby/moby/api/types/mount" + swarmtypes "github.com/moby/moby/api/types/swarm" "github.com/moby/sys/mount" "github.com/opencontainers/selinux/go-selinux/label" "github.com/pkg/errors" diff --git a/daemon/container/container_windows.go b/daemon/container/container_windows.go index f41aa4ff9f..82f83e6897 100644 --- a/daemon/container/container_windows.go +++ b/daemon/container/container_windows.go @@ -6,10 +6,10 @@ import ( "os" "path/filepath" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/errdefs" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" + swarmtypes "github.com/moby/moby/api/types/swarm" ) const ( diff --git a/daemon/container/health.go b/daemon/container/health.go index 1379c7c30f..d510688479 100644 --- a/daemon/container/health.go +++ b/daemon/container/health.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/containerd/log" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" ) // Health holds the current container health-check state diff --git a/daemon/container/state.go b/daemon/container/state.go index 1361454480..1c8a5bbfa0 100644 --- a/daemon/container/state.go +++ b/daemon/container/state.go @@ -7,9 +7,9 @@ import ( "sync" "time" - "github.com/docker/docker/api/types/container" libcontainerdtypes "github.com/docker/docker/daemon/internal/libcontainerd/types" "github.com/docker/go-units" + "github.com/moby/moby/api/types/container" ) // State holds the current container state, and has methods to get and diff --git a/daemon/container/state_test.go b/daemon/container/state_test.go index 943aa2a9d7..e394859b8d 100644 --- a/daemon/container/state_test.go +++ b/daemon/container/state_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/container" libcontainerdtypes "github.com/docker/docker/daemon/internal/libcontainerd/types" + "github.com/moby/moby/api/types/container" ) type mockTask struct { diff --git a/daemon/container/view.go b/daemon/container/view.go index fa2a6d7463..3daed8bc02 100644 --- a/daemon/container/view.go +++ b/daemon/container/view.go @@ -13,11 +13,11 @@ import ( "time" "github.com/containerd/log" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" "github.com/docker/docker/errdefs" "github.com/docker/go-connections/nat" memdb "github.com/hashicorp/go-memdb" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" ) const ( diff --git a/daemon/container/view_test.go b/daemon/container/view_test.go index 52fa4a2cf4..a9ff5848ee 100644 --- a/daemon/container/view_test.go +++ b/daemon/container/view_test.go @@ -8,9 +8,9 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/pkg/stringid" "github.com/google/uuid" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/daemon/container_operations.go b/daemon/container_operations.go index aafb3c6842..5e55a704ef 100644 --- a/daemon/container_operations.go +++ b/daemon/container_operations.go @@ -15,9 +15,6 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - networktypes "github.com/docker/docker/api/types/network" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/internal/metrics" @@ -33,6 +30,9 @@ import ( "github.com/docker/docker/pkg/stringid" "github.com/docker/docker/runconfig" "github.com/docker/go-connections/nat" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" + networktypes "github.com/moby/moby/api/types/network" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" diff --git a/daemon/container_operations_test.go b/daemon/container_operations_test.go index f0be787f1b..aa0379dc4c 100644 --- a/daemon/container_operations_test.go +++ b/daemon/container_operations_test.go @@ -4,10 +4,10 @@ import ( "encoding/json" "testing" - containertypes "github.com/docker/docker/api/types/container" - networktypes "github.com/docker/docker/api/types/network" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/libnetwork" + containertypes "github.com/moby/moby/api/types/container" + networktypes "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/daemon/container_unix_test.go b/daemon/container_unix_test.go index 5dd25e297d..abf5ec0366 100644 --- a/daemon/container_unix_test.go +++ b/daemon/container_unix_test.go @@ -5,9 +5,9 @@ package daemon import ( "testing" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/config" "github.com/docker/go-connections/nat" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" ) diff --git a/daemon/containerd/cache.go b/daemon/containerd/cache.go index c925a5474e..44937ea3e0 100644 --- a/daemon/containerd/cache.go +++ b/daemon/containerd/cache.go @@ -9,14 +9,14 @@ import ( "github.com/containerd/containerd/v2/core/content" cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/builder" "github.com/docker/docker/errdefs" "github.com/docker/docker/image" "github.com/docker/docker/image/cache" "github.com/docker/docker/internal/multierror" "github.com/docker/docker/layer" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/container" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/daemon/containerd/image.go b/daemon/containerd/image.go index 2cac81ced9..d77a3c3d7c 100644 --- a/daemon/containerd/image.go +++ b/daemon/containerd/image.go @@ -12,11 +12,11 @@ import ( "github.com/containerd/log" "github.com/containerd/platforms" "github.com/distribution/reference" - "github.com/docker/docker/api/types/backend" "github.com/docker/docker/daemon/images" "github.com/docker/docker/errdefs" "github.com/docker/docker/image" imagespec "github.com/moby/docker-image-spec/specs-go/v1" + "github.com/moby/moby/api/types/backend" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" diff --git a/daemon/containerd/image_builder.go b/daemon/containerd/image_builder.go index 4834b5ad01..451f5c6478 100644 --- a/daemon/containerd/image_builder.go +++ b/daemon/containerd/image_builder.go @@ -21,10 +21,6 @@ import ( "github.com/containerd/log" "github.com/containerd/platforms" "github.com/distribution/reference" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/registry" "github.com/docker/docker/daemon/builder" "github.com/docker/docker/errdefs" "github.com/docker/docker/image" @@ -34,6 +30,10 @@ import ( "github.com/docker/docker/pkg/stringid" imagespec "github.com/moby/docker-image-spec/specs-go/v1" "github.com/moby/go-archive" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/registry" "github.com/opencontainers/go-digest" "github.com/opencontainers/image-spec/identity" "github.com/opencontainers/image-spec/specs-go" diff --git a/daemon/containerd/image_commit.go b/daemon/containerd/image_commit.go index 723f742b91..64ba0afb2a 100644 --- a/daemon/containerd/image_commit.go +++ b/daemon/containerd/image_commit.go @@ -16,10 +16,10 @@ import ( "github.com/containerd/containerd/v2/core/snapshots" cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" "github.com/docker/docker/image" imagespec "github.com/moby/docker-image-spec/specs-go/v1" "github.com/moby/go-archive" + "github.com/moby/moby/api/types/backend" "github.com/opencontainers/go-digest" "github.com/opencontainers/image-spec/identity" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/daemon/containerd/image_delete.go b/daemon/containerd/image_delete.go index a02dbadb43..18c3b1ee6a 100644 --- a/daemon/containerd/image_delete.go +++ b/daemon/containerd/image_delete.go @@ -14,13 +14,13 @@ import ( "github.com/containerd/log" "github.com/containerd/platforms" "github.com/distribution/reference" - "github.com/docker/docker/api/types/events" - imagetypes "github.com/docker/docker/api/types/image" "github.com/docker/docker/daemon/container" dimages "github.com/docker/docker/daemon/images" "github.com/docker/docker/daemon/internal/metrics" "github.com/docker/docker/image" "github.com/docker/docker/pkg/stringid" + "github.com/moby/moby/api/types/events" + imagetypes "github.com/moby/moby/api/types/image" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/daemon/containerd/image_delete_test.go b/daemon/containerd/image_delete_test.go index 501ec103d6..f483ae1d9c 100644 --- a/daemon/containerd/image_delete_test.go +++ b/daemon/containerd/image_delete_test.go @@ -8,10 +8,10 @@ import ( "github.com/containerd/containerd/v2/core/metadata" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/log/logtest" - "github.com/docker/docker/api/types/image" "github.com/docker/docker/daemon/container" daemonevents "github.com/docker/docker/daemon/events" dimages "github.com/docker/docker/daemon/images" + "github.com/moby/moby/api/types/image" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/daemon/containerd/image_events.go b/daemon/containerd/image_events.go index 6dbcecd0f2..36450bdffc 100644 --- a/daemon/containerd/image_events.go +++ b/daemon/containerd/image_events.go @@ -4,8 +4,8 @@ import ( "context" c8dimages "github.com/containerd/containerd/v2/core/images" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/events" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/events" ) // LogImageEvent generates an event related to an image with only the default attributes. diff --git a/daemon/containerd/image_exporter.go b/daemon/containerd/image_exporter.go index f4f3f33e2c..7e2f152807 100644 --- a/daemon/containerd/image_exporter.go +++ b/daemon/containerd/image_exporter.go @@ -15,11 +15,11 @@ import ( "github.com/containerd/log" "github.com/containerd/platforms" "github.com/distribution/reference" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/images" "github.com/docker/docker/errdefs" "github.com/docker/docker/pkg/streamformatter" "github.com/moby/go-archive/compression" + "github.com/moby/moby/api/types/events" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" ) diff --git a/daemon/containerd/image_history.go b/daemon/containerd/image_history.go index e87dd0c626..11a1355f21 100644 --- a/daemon/containerd/image_history.go +++ b/daemon/containerd/image_history.go @@ -8,8 +8,8 @@ import ( "github.com/containerd/log" "github.com/containerd/platforms" "github.com/distribution/reference" - imagetype "github.com/docker/docker/api/types/image" "github.com/docker/docker/daemon/internal/metrics" + imagetype "github.com/moby/moby/api/types/image" "github.com/opencontainers/go-digest" "github.com/opencontainers/image-spec/identity" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/daemon/containerd/image_import.go b/daemon/containerd/image_import.go index bdc017620a..bb68529f82 100644 --- a/daemon/containerd/image_import.go +++ b/daemon/containerd/image_import.go @@ -15,8 +15,6 @@ import ( "github.com/containerd/log" "github.com/containerd/platforms" "github.com/distribution/reference" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/builder/dockerfile" "github.com/docker/docker/errdefs" "github.com/docker/docker/image" @@ -24,6 +22,8 @@ import ( "github.com/google/uuid" imagespec "github.com/moby/docker-image-spec/specs-go/v1" "github.com/moby/go-archive/compression" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" "github.com/opencontainers/go-digest" "github.com/opencontainers/image-spec/specs-go" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/daemon/containerd/image_import_test.go b/daemon/containerd/image_import_test.go index a6e8b3ad86..a339bee6df 100644 --- a/daemon/containerd/image_import_test.go +++ b/daemon/containerd/image_import_test.go @@ -3,8 +3,8 @@ package containerd import ( "testing" - "github.com/docker/docker/api/types/container" "github.com/docker/go-connections/nat" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/daemon/containerd/image_inspect.go b/daemon/containerd/image_inspect.go index 7d7127acc3..5ce415061e 100644 --- a/daemon/containerd/image_inspect.go +++ b/daemon/containerd/image_inspect.go @@ -13,11 +13,11 @@ import ( "github.com/containerd/log" "github.com/containerd/platforms" "github.com/distribution/reference" - "github.com/docker/docker/api/types/backend" - imagetypes "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/storage" "github.com/docker/docker/internal/sliceutil" imagespec "github.com/moby/docker-image-spec/specs-go/v1" + "github.com/moby/moby/api/types/backend" + imagetypes "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/storage" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "golang.org/x/sync/semaphore" ) diff --git a/daemon/containerd/image_inspect_test.go b/daemon/containerd/image_inspect_test.go index bef2b092ee..ff2b67f7d1 100644 --- a/daemon/containerd/image_inspect_test.go +++ b/daemon/containerd/image_inspect_test.go @@ -9,8 +9,8 @@ import ( c8dimages "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/log/logtest" - "github.com/docker/docker/api/types/backend" "github.com/docker/docker/internal/testutils/specialimage" + "github.com/moby/moby/api/types/backend" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/daemon/containerd/image_list.go b/daemon/containerd/image_list.go index dba0f8b566..ed27322622 100644 --- a/daemon/containerd/image_list.go +++ b/daemon/containerd/image_list.go @@ -16,13 +16,13 @@ import ( "github.com/containerd/log" "github.com/containerd/platforms" "github.com/distribution/reference" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/filters" - imagetypes "github.com/docker/docker/api/types/image" - timetypes "github.com/docker/docker/api/types/time" "github.com/docker/docker/errdefs" "github.com/moby/buildkit/util/attestation" dockerspec "github.com/moby/docker-image-spec/specs-go/v1" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/filters" + imagetypes "github.com/moby/moby/api/types/image" + timetypes "github.com/moby/moby/api/types/time" "github.com/opencontainers/go-digest" "github.com/opencontainers/image-spec/identity" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/daemon/containerd/image_list_test.go b/daemon/containerd/image_list_test.go index bf7b0e4c70..fcfc50c364 100644 --- a/daemon/containerd/image_list_test.go +++ b/daemon/containerd/image_list_test.go @@ -15,9 +15,9 @@ import ( "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/log/logtest" "github.com/containerd/platforms" - imagetypes "github.com/docker/docker/api/types/image" "github.com/docker/docker/daemon/container" "github.com/docker/docker/internal/testutils/specialimage" + imagetypes "github.com/moby/moby/api/types/image" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" diff --git a/daemon/containerd/image_prune.go b/daemon/containerd/image_prune.go index 7a3e0256d5..8431973475 100644 --- a/daemon/containerd/image_prune.go +++ b/daemon/containerd/image_prune.go @@ -11,11 +11,11 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/distribution/reference" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/image" "github.com/docker/docker/daemon/container" "github.com/docker/docker/errdefs" "github.com/hashicorp/go-multierror" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/image" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" diff --git a/daemon/containerd/image_pull.go b/daemon/containerd/image_pull.go index ab851a4ddc..80a34b423c 100644 --- a/daemon/containerd/image_pull.go +++ b/daemon/containerd/image_pull.go @@ -16,14 +16,14 @@ import ( "github.com/containerd/log" "github.com/containerd/platforms" "github.com/distribution/reference" - "github.com/docker/docker/api/types/events" - registrytypes "github.com/docker/docker/api/types/registry" "github.com/docker/docker/daemon/internal/metrics" "github.com/docker/docker/distribution" "github.com/docker/docker/errdefs" "github.com/docker/docker/pkg/progress" "github.com/docker/docker/pkg/streamformatter" "github.com/docker/docker/pkg/stringid" + "github.com/moby/moby/api/types/events" + registrytypes "github.com/moby/moby/api/types/registry" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" ) diff --git a/daemon/containerd/image_push.go b/daemon/containerd/image_push.go index cf4e2b7554..f4f43dd412 100644 --- a/daemon/containerd/image_push.go +++ b/daemon/containerd/image_push.go @@ -17,13 +17,13 @@ import ( "github.com/containerd/log" "github.com/containerd/platforms" "github.com/distribution/reference" - "github.com/docker/docker/api/types/auxprogress" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/registry" "github.com/docker/docker/daemon/internal/metrics" "github.com/docker/docker/errdefs" "github.com/docker/docker/pkg/progress" "github.com/docker/docker/pkg/streamformatter" + "github.com/moby/moby/api/types/auxprogress" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/registry" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" diff --git a/daemon/containerd/image_tag.go b/daemon/containerd/image_tag.go index 1b32dbdedc..8494eb92af 100644 --- a/daemon/containerd/image_tag.go +++ b/daemon/containerd/image_tag.go @@ -8,9 +8,9 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/distribution/reference" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/errdefs" "github.com/docker/docker/image" + "github.com/moby/moby/api/types/events" "github.com/pkg/errors" ) diff --git a/daemon/containerd/imagespec.go b/daemon/containerd/imagespec.go index 5bc781689e..451f8a3760 100644 --- a/daemon/containerd/imagespec.go +++ b/daemon/containerd/imagespec.go @@ -6,11 +6,11 @@ package containerd import ( "slices" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/dockerversion" "github.com/docker/docker/image" "github.com/docker/go-connections/nat" imagespec "github.com/moby/docker-image-spec/specs-go/v1" + "github.com/moby/moby/api/types/container" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/daemon/containerd/resolver.go b/daemon/containerd/resolver.go index f7b218dde1..9705fe39e6 100644 --- a/daemon/containerd/resolver.go +++ b/daemon/containerd/resolver.go @@ -10,10 +10,10 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/distribution/reference" - registrytypes "github.com/docker/docker/api/types/registry" "github.com/docker/docker/dockerversion" "github.com/docker/docker/pkg/useragent" "github.com/docker/docker/registry" + registrytypes "github.com/moby/moby/api/types/registry" ) func (i *ImageService) newResolverFromAuthConfig(ctx context.Context, authConfig *registrytypes.AuthConfig, ref reference.Named) (remotes.Resolver, docker.StatusTracker) { diff --git a/daemon/containerfs_linux.go b/daemon/containerfs_linux.go index 3700e33e78..c883762ff3 100644 --- a/daemon/containerfs_linux.go +++ b/daemon/containerfs_linux.go @@ -15,11 +15,11 @@ import ( "github.com/moby/sys/symlink" "golang.org/x/sys/unix" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/internal/mounttree" "github.com/docker/docker/internal/unshare" "github.com/docker/docker/pkg/fileutils" + containertypes "github.com/moby/moby/api/types/container" ) type future struct { diff --git a/daemon/create.go b/daemon/create.go index b3cc2216e2..47bdd3160d 100644 --- a/daemon/create.go +++ b/daemon/create.go @@ -14,10 +14,6 @@ import ( "github.com/containerd/log" "github.com/containerd/platforms" - "github.com/docker/docker/api/types/backend" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - networktypes "github.com/docker/docker/api/types/network" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/images" @@ -27,6 +23,10 @@ import ( "github.com/docker/docker/internal/multierror" "github.com/docker/docker/internal/otelutil" "github.com/docker/docker/runconfig" + "github.com/moby/moby/api/types/backend" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" + networktypes "github.com/moby/moby/api/types/network" "github.com/moby/sys/user" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/opencontainers/selinux/go-selinux" diff --git a/daemon/create_unix.go b/daemon/create_unix.go index 920bd01b71..897cf6ba6f 100644 --- a/daemon/create_unix.go +++ b/daemon/create_unix.go @@ -10,13 +10,13 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" - containertypes "github.com/docker/docker/api/types/container" - mounttypes "github.com/docker/docker/api/types/mount" "github.com/docker/docker/daemon/container" volumemounts "github.com/docker/docker/daemon/volume/mounts" volumeopts "github.com/docker/docker/daemon/volume/service/opts" "github.com/docker/docker/oci" "github.com/docker/docker/pkg/idtools" + containertypes "github.com/moby/moby/api/types/container" + mounttypes "github.com/moby/moby/api/types/mount" "github.com/opencontainers/selinux/go-selinux/label" "github.com/pkg/errors" ) diff --git a/daemon/create_windows.go b/daemon/create_windows.go index 00e630eb9d..ee8eedd6e1 100644 --- a/daemon/create_windows.go +++ b/daemon/create_windows.go @@ -4,10 +4,10 @@ import ( "context" "fmt" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/container" volumemounts "github.com/docker/docker/daemon/volume/mounts" volumeopts "github.com/docker/docker/daemon/volume/service/opts" + containertypes "github.com/moby/moby/api/types/container" ) // createContainerOSSpecificSettings performs host-OS specific container create functionality diff --git a/daemon/daemon.go b/daemon/daemon.go index 3f2cd9f421..af5099729d 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -31,13 +31,6 @@ import ( "github.com/containerd/log" "github.com/distribution/reference" dist "github.com/docker/distribution" - "github.com/docker/docker/api/types/backend" - containertypes "github.com/docker/docker/api/types/container" - imagetypes "github.com/docker/docker/api/types/image" - networktypes "github.com/docker/docker/api/types/network" - registrytypes "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/api/types/swarm" - volumetypes "github.com/docker/docker/api/types/volume" "github.com/docker/docker/daemon/builder" executorpkg "github.com/docker/docker/daemon/cluster/executor" "github.com/docker/docker/daemon/config" @@ -75,6 +68,13 @@ import ( "github.com/moby/buildkit/util/grpcerrors" "github.com/moby/buildkit/util/tracing" "github.com/moby/locker" + "github.com/moby/moby/api/types/backend" + containertypes "github.com/moby/moby/api/types/container" + imagetypes "github.com/moby/moby/api/types/image" + networktypes "github.com/moby/moby/api/types/network" + registrytypes "github.com/moby/moby/api/types/registry" + "github.com/moby/moby/api/types/swarm" + volumetypes "github.com/moby/moby/api/types/volume" "github.com/moby/sys/user" "github.com/moby/sys/userns" "github.com/pkg/errors" diff --git a/daemon/daemon_linux_test.go b/daemon/daemon_linux_test.go index 60ff73d643..741c648dc3 100644 --- a/daemon/daemon_linux_test.go +++ b/daemon/daemon_linux_test.go @@ -9,10 +9,10 @@ import ( "strings" "testing" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/libnetwork/types" "github.com/docker/docker/internal/testutils/netnsutils" "github.com/google/go-cmp/cmp/cmpopts" + containertypes "github.com/moby/moby/api/types/container" "github.com/moby/sys/mount" "github.com/moby/sys/mountinfo" "github.com/vishvananda/netlink" diff --git a/daemon/daemon_test.go b/daemon/daemon_test.go index 96ccf1249b..2f12d43aec 100644 --- a/daemon/daemon_test.go +++ b/daemon/daemon_test.go @@ -8,12 +8,12 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/libnetwork" volumesservice "github.com/docker/docker/daemon/volume/service" "github.com/docker/docker/pkg/idtools" "github.com/docker/go-connections/nat" + containertypes "github.com/moby/moby/api/types/container" "github.com/pkg/errors" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/daemon/daemon_unix.go b/daemon/daemon_unix.go index e549906a90..e752504f00 100644 --- a/daemon/daemon_unix.go +++ b/daemon/daemon_unix.go @@ -23,9 +23,6 @@ import ( "github.com/containerd/cgroups/v3" cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" - "github.com/docker/docker/api/types/blkiodev" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/initlayer" @@ -44,6 +41,9 @@ import ( "github.com/docker/docker/internal/otelutil" "github.com/docker/docker/pkg/sysinfo" "github.com/docker/docker/runconfig" + "github.com/moby/moby/api/types/blkiodev" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" "github.com/moby/sys/mount" "github.com/moby/sys/user" "github.com/opencontainers/runtime-spec/specs-go" diff --git a/daemon/daemon_unix_test.go b/daemon/daemon_unix_test.go index ecaa22a290..44f2bf08cc 100644 --- a/daemon/daemon_unix_test.go +++ b/daemon/daemon_unix_test.go @@ -8,11 +8,11 @@ import ( "path/filepath" "testing" - "github.com/docker/docker/api/types/blkiodev" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/container" "github.com/docker/docker/pkg/sysinfo" + "github.com/moby/moby/api/types/blkiodev" + containertypes "github.com/moby/moby/api/types/container" "github.com/opencontainers/selinux/go-selinux" "golang.org/x/sys/unix" "gotest.tools/v3/assert" diff --git a/daemon/daemon_windows.go b/daemon/daemon_windows.go index 62ccdfc8d0..27e6454c13 100644 --- a/daemon/daemon_windows.go +++ b/daemon/daemon_windows.go @@ -12,8 +12,6 @@ import ( "github.com/Microsoft/hcsshim" "github.com/Microsoft/hcsshim/osversion" "github.com/containerd/log" - containertypes "github.com/docker/docker/api/types/container" - networktypes "github.com/docker/docker/api/types/network" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/internal/libcontainerd/local" @@ -28,6 +26,8 @@ import ( "github.com/docker/docker/pkg/parsers/operatingsystem" "github.com/docker/docker/pkg/sysinfo" "github.com/docker/docker/pkg/system" + containertypes "github.com/moby/moby/api/types/container" + networktypes "github.com/moby/moby/api/types/network" "github.com/moby/sys/user" "github.com/pkg/errors" "golang.org/x/sys/windows" diff --git a/daemon/delete.go b/daemon/delete.go index d045fe41c6..5039031834 100644 --- a/daemon/delete.go +++ b/daemon/delete.go @@ -9,14 +9,14 @@ import ( "time" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/internal/metrics" "github.com/docker/docker/errdefs" "github.com/docker/docker/internal/containerfs" + "github.com/moby/moby/api/types/backend" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" "github.com/opencontainers/selinux/go-selinux" "github.com/pkg/errors" ) diff --git a/daemon/delete_test.go b/daemon/delete_test.go index 42adff2511..796a4b1a18 100644 --- a/daemon/delete_test.go +++ b/daemon/delete_test.go @@ -7,9 +7,9 @@ import ( "time" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/backend" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/container" + "github.com/moby/moby/api/types/backend" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/daemon/devices.go b/daemon/devices.go index d3d49558a2..e81dc5c965 100644 --- a/daemon/devices.go +++ b/daemon/devices.go @@ -3,10 +3,10 @@ package daemon import ( "context" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/system" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/internal/capabilities" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/system" "github.com/opencontainers/runtime-spec/specs-go" ) diff --git a/daemon/disk_usage.go b/daemon/disk_usage.go index 59ef0896d2..b6e4a0daa3 100644 --- a/daemon/disk_usage.go +++ b/daemon/disk_usage.go @@ -4,12 +4,12 @@ import ( "context" "fmt" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/image" - systemtypes "github.com/docker/docker/api/types/system" - "github.com/docker/docker/api/types/volume" "github.com/docker/docker/daemon/server/router/system" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/image" + systemtypes "github.com/moby/moby/api/types/system" + "github.com/moby/moby/api/types/volume" "github.com/pkg/errors" "golang.org/x/sync/errgroup" ) diff --git a/daemon/events.go b/daemon/events.go index 35fbd52261..ce67559072 100644 --- a/daemon/events.go +++ b/daemon/events.go @@ -7,12 +7,12 @@ import ( "time" "github.com/containerd/log" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" "github.com/docker/docker/daemon/container" daemonevents "github.com/docker/docker/daemon/events" "github.com/docker/docker/daemon/libnetwork" gogotypes "github.com/gogo/protobuf/types" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/filters" swarmapi "github.com/moby/swarmkit/v2/api" ) diff --git a/daemon/events/events.go b/daemon/events/events.go index b7f06656e4..a01e32f607 100644 --- a/daemon/events/events.go +++ b/daemon/events/events.go @@ -4,8 +4,8 @@ import ( "sync" "time" - eventtypes "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/internal/metrics" + eventtypes "github.com/moby/moby/api/types/events" "github.com/moby/pubsub" ) diff --git a/daemon/events/events_test.go b/daemon/events/events_test.go index c0cd1b8e07..38a4848bfb 100644 --- a/daemon/events/events_test.go +++ b/daemon/events/events_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/events" - timetypes "github.com/docker/docker/api/types/time" eventstestutils "github.com/docker/docker/daemon/events/testutils" + "github.com/moby/moby/api/types/events" + timetypes "github.com/moby/moby/api/types/time" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/daemon/events/filter.go b/daemon/events/filter.go index 2a095b16f9..5536a83dcf 100644 --- a/daemon/events/filter.go +++ b/daemon/events/filter.go @@ -2,8 +2,8 @@ package events import ( "github.com/distribution/reference" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/filters" ) // Filter can filter out docker events from a stream diff --git a/daemon/events/testutils/testutils.go b/daemon/events/testutils/testutils.go index e63ab9b8a9..1f330ccf70 100644 --- a/daemon/events/testutils/testutils.go +++ b/daemon/events/testutils/testutils.go @@ -5,9 +5,9 @@ import ( "strings" "time" - "github.com/docker/docker/api/types/events" - timetypes "github.com/docker/docker/api/types/time" "github.com/docker/docker/internal/lazyregexp" + "github.com/moby/moby/api/types/events" + timetypes "github.com/moby/moby/api/types/time" ) const ( diff --git a/daemon/events_test.go b/daemon/events_test.go index f79ae246dc..f22726318d 100644 --- a/daemon/events_test.go +++ b/daemon/events_test.go @@ -4,10 +4,10 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" - eventtypes "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/events" + containertypes "github.com/moby/moby/api/types/container" + eventtypes "github.com/moby/moby/api/types/events" ) func TestLogContainerEventCopyLabels(t *testing.T) { diff --git a/daemon/exec.go b/daemon/exec.go index ecc52fdf73..cdd021ac85 100644 --- a/daemon/exec.go +++ b/daemon/exec.go @@ -11,13 +11,13 @@ import ( containerd "github.com/containerd/containerd/v2/client" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/internal/stream" "github.com/docker/docker/errdefs" "github.com/docker/docker/pkg/pools" + "github.com/moby/moby/api/types/backend" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" "github.com/moby/sys/signal" "github.com/moby/term" "github.com/opencontainers/runtime-spec/specs-go" diff --git a/daemon/exec_linux_test.go b/daemon/exec_linux_test.go index 1f4e26faa7..ecc640c133 100644 --- a/daemon/exec_linux_test.go +++ b/daemon/exec_linux_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/containerd/containerd/v2/pkg/apparmor" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/container" + containertypes "github.com/moby/moby/api/types/container" "github.com/opencontainers/runtime-spec/specs-go" "gotest.tools/v3/assert" ) diff --git a/daemon/export.go b/daemon/export.go index 1d3a5cd7b8..b99a786c5c 100644 --- a/daemon/export.go +++ b/daemon/export.go @@ -7,11 +7,11 @@ import ( "io" "github.com/containerd/log" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/container" "github.com/docker/docker/errdefs" "github.com/moby/go-archive" "github.com/moby/go-archive/chrootarchive" + "github.com/moby/moby/api/types/events" ) // ContainerExport writes the contents of the container to the given diff --git a/daemon/health.go b/daemon/health.go index e578280f72..6d962989fb 100644 --- a/daemon/health.go +++ b/daemon/health.go @@ -9,11 +9,11 @@ import ( "time" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/internal/metrics" + "github.com/moby/moby/api/types/backend" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" ) const ( diff --git a/daemon/health_test.go b/daemon/health_test.go index dd4fdd26a7..3e4a9ab6ac 100644 --- a/daemon/health_test.go +++ b/daemon/health_test.go @@ -4,10 +4,10 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" - eventtypes "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/events" + containertypes "github.com/moby/moby/api/types/container" + eventtypes "github.com/moby/moby/api/types/events" ) func reset(c *container.Container) { diff --git a/daemon/image_service.go b/daemon/image_service.go index a8fc42ab1c..62080bfb36 100644 --- a/daemon/image_service.go +++ b/daemon/image_service.go @@ -5,17 +5,17 @@ import ( "io" "github.com/distribution/reference" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" - imagetype "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/registry" "github.com/docker/docker/daemon/builder" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/images" "github.com/docker/docker/image" "github.com/docker/docker/layer" "github.com/moby/go-archive" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/filters" + imagetype "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/registry" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/daemon/images/cache.go b/daemon/images/cache.go index 61e3f01864..c7455b5bf3 100644 --- a/daemon/images/cache.go +++ b/daemon/images/cache.go @@ -6,11 +6,11 @@ import ( "fmt" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" "github.com/docker/docker/daemon/builder" "github.com/docker/docker/image" "github.com/docker/docker/image/cache" "github.com/docker/docker/layer" + "github.com/moby/moby/api/types/backend" ) type cacheAdaptor struct { diff --git a/daemon/images/image.go b/daemon/images/image.go index 80670c2c02..7c28db109c 100644 --- a/daemon/images/image.go +++ b/daemon/images/image.go @@ -13,9 +13,9 @@ import ( "github.com/containerd/log" "github.com/containerd/platforms" "github.com/distribution/reference" - "github.com/docker/docker/api/types/backend" "github.com/docker/docker/errdefs" "github.com/docker/docker/image" + "github.com/moby/moby/api/types/backend" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" diff --git a/daemon/images/image_builder.go b/daemon/images/image_builder.go index 3b17df8f7b..3eaaf84830 100644 --- a/daemon/images/image_builder.go +++ b/daemon/images/image_builder.go @@ -9,14 +9,14 @@ import ( "github.com/containerd/log" "github.com/containerd/platforms" "github.com/distribution/reference" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/registry" "github.com/docker/docker/daemon/builder" "github.com/docker/docker/image" "github.com/docker/docker/layer" "github.com/docker/docker/pkg/progress" "github.com/docker/docker/pkg/streamformatter" "github.com/docker/docker/pkg/stringid" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/registry" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" diff --git a/daemon/images/image_commit.go b/daemon/images/image_commit.go index 2b5ca76f33..e54189732e 100644 --- a/daemon/images/image_commit.go +++ b/daemon/images/image_commit.go @@ -5,11 +5,11 @@ import ( "encoding/json" "io" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/image" "github.com/docker/docker/layer" "github.com/docker/docker/pkg/ioutils" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/events" "github.com/pkg/errors" ) diff --git a/daemon/images/image_delete.go b/daemon/images/image_delete.go index 188e7a373f..ee7d88c7e5 100644 --- a/daemon/images/image_delete.go +++ b/daemon/images/image_delete.go @@ -7,14 +7,14 @@ import ( "time" "github.com/distribution/reference" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/events" - imagetypes "github.com/docker/docker/api/types/image" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/internal/metrics" "github.com/docker/docker/errdefs" "github.com/docker/docker/image" "github.com/docker/docker/pkg/stringid" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/events" + imagetypes "github.com/moby/moby/api/types/image" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" ) diff --git a/daemon/images/image_events.go b/daemon/images/image_events.go index b17a24126d..bd9fb763fc 100644 --- a/daemon/images/image_events.go +++ b/daemon/images/image_events.go @@ -3,8 +3,8 @@ package images import ( "context" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/events" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/events" ) // LogImageEvent generates an event related to an image with only the default attributes. diff --git a/daemon/images/image_history.go b/daemon/images/image_history.go index 9807520039..f9b2ef2a1c 100644 --- a/daemon/images/image_history.go +++ b/daemon/images/image_history.go @@ -6,10 +6,10 @@ import ( "time" "github.com/distribution/reference" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/image" "github.com/docker/docker/daemon/internal/metrics" "github.com/docker/docker/layer" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/image" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/daemon/images/image_import.go b/daemon/images/image_import.go index 9ee65e249c..b429186114 100644 --- a/daemon/images/image_import.go +++ b/daemon/images/image_import.go @@ -8,14 +8,14 @@ import ( "github.com/containerd/platforms" "github.com/distribution/reference" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/builder/dockerfile" "github.com/docker/docker/dockerversion" "github.com/docker/docker/errdefs" "github.com/docker/docker/image" "github.com/docker/docker/layer" "github.com/moby/go-archive/compression" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/daemon/images/image_inspect.go b/daemon/images/image_inspect.go index 8218f2d826..41e4c50be7 100644 --- a/daemon/images/image_inspect.go +++ b/daemon/images/image_inspect.go @@ -5,11 +5,11 @@ import ( "time" "github.com/distribution/reference" - "github.com/docker/docker/api/types/backend" - imagetypes "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/storage" "github.com/docker/docker/image" "github.com/docker/docker/layer" + "github.com/moby/moby/api/types/backend" + imagetypes "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/storage" ) func (i *ImageService) ImageInspect(ctx context.Context, refOrID string, opts backend.ImageInspectOpts) (*imagetypes.InspectResponse, error) { diff --git a/daemon/images/image_list.go b/daemon/images/image_list.go index 64f163582c..df36d89be3 100644 --- a/daemon/images/image_list.go +++ b/daemon/images/image_list.go @@ -8,12 +8,12 @@ import ( "time" "github.com/distribution/reference" - "github.com/docker/docker/api/types/backend" - imagetypes "github.com/docker/docker/api/types/image" - timetypes "github.com/docker/docker/api/types/time" "github.com/docker/docker/daemon/container" "github.com/docker/docker/image" "github.com/docker/docker/layer" + "github.com/moby/moby/api/types/backend" + imagetypes "github.com/moby/moby/api/types/image" + timetypes "github.com/moby/moby/api/types/time" ) var acceptedImageFilterTags = map[string]bool{ diff --git a/daemon/images/image_prune.go b/daemon/images/image_prune.go index b652792305..e4ccff779c 100644 --- a/daemon/images/image_prune.go +++ b/daemon/images/image_prune.go @@ -8,13 +8,13 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/distribution/reference" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" - imagetypes "github.com/docker/docker/api/types/image" - timetypes "github.com/docker/docker/api/types/time" "github.com/docker/docker/errdefs" "github.com/docker/docker/image" "github.com/docker/docker/layer" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/filters" + imagetypes "github.com/moby/moby/api/types/image" + timetypes "github.com/moby/moby/api/types/time" "github.com/opencontainers/go-digest" "github.com/pkg/errors" ) diff --git a/daemon/images/image_pull.go b/daemon/images/image_pull.go index 0486a5e376..b72acb2345 100644 --- a/daemon/images/image_pull.go +++ b/daemon/images/image_pull.go @@ -10,13 +10,13 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/distribution/reference" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/registry" "github.com/docker/docker/daemon/internal/metrics" "github.com/docker/docker/distribution" progressutils "github.com/docker/docker/distribution/utils" "github.com/docker/docker/pkg/progress" "github.com/docker/docker/pkg/streamformatter" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/registry" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" ) diff --git a/daemon/images/image_push.go b/daemon/images/image_push.go index 5595cfd553..412027c898 100644 --- a/daemon/images/image_push.go +++ b/daemon/images/image_push.go @@ -7,12 +7,12 @@ import ( "github.com/distribution/reference" "github.com/docker/distribution/manifest/schema2" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/registry" "github.com/docker/docker/daemon/internal/metrics" "github.com/docker/docker/distribution" progressutils "github.com/docker/docker/distribution/utils" "github.com/docker/docker/pkg/progress" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/registry" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/daemon/images/image_tag.go b/daemon/images/image_tag.go index e515299ab7..0bbcaac2b4 100644 --- a/daemon/images/image_tag.go +++ b/daemon/images/image_tag.go @@ -4,8 +4,8 @@ import ( "context" "github.com/distribution/reference" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/image" + "github.com/moby/moby/api/types/events" ) // TagImage adds the given reference to the image ID provided. diff --git a/daemon/images/imagespec.go b/daemon/images/imagespec.go index bdc6f4a964..50dac756b4 100644 --- a/daemon/images/imagespec.go +++ b/daemon/images/imagespec.go @@ -1,8 +1,8 @@ package images import ( - "github.com/docker/docker/api/types/container" imagespec "github.com/moby/docker-image-spec/specs-go/v1" + "github.com/moby/moby/api/types/container" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/daemon/info.go b/daemon/info.go index 34be0e532c..3e01ee5ed0 100644 --- a/daemon/info.go +++ b/daemon/info.go @@ -14,8 +14,6 @@ import ( "github.com/containerd/containerd/v2/pkg/tracing" "github.com/containerd/log" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/system" "github.com/docker/docker/daemon/command/debug" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/internal/filedescriptors" @@ -28,6 +26,8 @@ import ( "github.com/docker/docker/pkg/parsers/operatingsystem" "github.com/docker/docker/pkg/sysinfo" "github.com/docker/docker/registry" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/system" "github.com/opencontainers/selinux/go-selinux" ) diff --git a/daemon/info_unix.go b/daemon/info_unix.go index 8238f3f501..1732da47cf 100644 --- a/daemon/info_unix.go +++ b/daemon/info_unix.go @@ -13,12 +13,12 @@ import ( runcoptions "github.com/containerd/containerd/api/types/runc/options" "github.com/containerd/log" - "github.com/docker/docker/api/types" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/system" "github.com/docker/docker/daemon/config" "github.com/docker/docker/pkg/rootless" "github.com/docker/docker/pkg/sysinfo" + "github.com/moby/moby/api/types" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/system" "github.com/pkg/errors" rkclient "github.com/rootless-containers/rootlesskit/v2/pkg/api/client" ) diff --git a/daemon/info_windows.go b/daemon/info_windows.go index 6e78b8192d..1ff10ccb5f 100644 --- a/daemon/info_windows.go +++ b/daemon/info_windows.go @@ -3,10 +3,10 @@ package daemon import ( "context" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/system" "github.com/docker/docker/daemon/config" "github.com/docker/docker/pkg/sysinfo" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/system" ) // fillPlatformInfo fills the platform related info. diff --git a/daemon/inspect.go b/daemon/inspect.go index 3fcbeeb5a5..a030325f97 100644 --- a/daemon/inspect.go +++ b/daemon/inspect.go @@ -9,14 +9,14 @@ import ( "fmt" "time" - "github.com/docker/docker/api/types/backend" - containertypes "github.com/docker/docker/api/types/container" - networktypes "github.com/docker/docker/api/types/network" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/network" "github.com/docker/docker/errdefs" "github.com/docker/go-connections/nat" + "github.com/moby/moby/api/types/backend" + containertypes "github.com/moby/moby/api/types/container" + networktypes "github.com/moby/moby/api/types/network" ) // ContainerInspect returns low-level information about a diff --git a/daemon/inspect_linux.go b/daemon/inspect_linux.go index 512f169a45..2373d51a87 100644 --- a/daemon/inspect_linux.go +++ b/daemon/inspect_linux.go @@ -1,9 +1,9 @@ package daemon import ( - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/container" containerpkg "github.com/docker/docker/daemon/container" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/container" ) // This sets platform-specific fields diff --git a/daemon/inspect_test.go b/daemon/inspect_test.go index 1a09971596..b406a7591a 100644 --- a/daemon/inspect_test.go +++ b/daemon/inspect_test.go @@ -3,8 +3,8 @@ package daemon import ( "testing" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/container" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/daemon/inspect_windows.go b/daemon/inspect_windows.go index 2881934e47..a672ae8d2c 100644 --- a/daemon/inspect_windows.go +++ b/daemon/inspect_windows.go @@ -1,9 +1,9 @@ package daemon import ( - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/container" containerpkg "github.com/docker/docker/daemon/container" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/container" ) // This sets platform-specific fields diff --git a/daemon/internal/builder-next/builder.go b/daemon/internal/builder-next/builder.go index ae711a4535..b7b68f5262 100644 --- a/daemon/internal/builder-next/builder.go +++ b/daemon/internal/builder-next/builder.go @@ -12,11 +12,6 @@ import ( "github.com/containerd/containerd/v2/core/remotes/docker" "github.com/containerd/platforms" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" - timetypes "github.com/docker/docker/api/types/time" "github.com/docker/docker/daemon/builder" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/images" @@ -34,6 +29,11 @@ import ( "github.com/moby/buildkit/session" "github.com/moby/buildkit/util/entitlements" "github.com/moby/buildkit/util/tracing" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" + timetypes "github.com/moby/moby/api/types/time" "github.com/moby/sys/user" "github.com/pkg/errors" "golang.org/x/sync/errgroup" diff --git a/daemon/internal/builder-next/controller.go b/daemon/internal/builder-next/controller.go index 08f096bcd7..1bff6a0fec 100644 --- a/daemon/internal/builder-next/controller.go +++ b/daemon/internal/builder-next/controller.go @@ -16,8 +16,6 @@ import ( "github.com/containerd/containerd/v2/plugins/content/local" "github.com/containerd/log" "github.com/containerd/platforms" - "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/filters" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/graphdriver" "github.com/docker/docker/daemon/internal/builder-next/adapters/containerimage" @@ -56,6 +54,8 @@ import ( "github.com/moby/buildkit/worker" "github.com/moby/buildkit/worker/containerd" "github.com/moby/buildkit/worker/label" + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/filters" "github.com/pkg/errors" bolt "go.etcd.io/bbolt" "go.opentelemetry.io/otel/sdk/trace" diff --git a/daemon/internal/restartmanager/restartmanager.go b/daemon/internal/restartmanager/restartmanager.go index 04b07bc357..1bf3603c7f 100644 --- a/daemon/internal/restartmanager/restartmanager.go +++ b/daemon/internal/restartmanager/restartmanager.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" ) const ( diff --git a/daemon/internal/restartmanager/restartmanager_test.go b/daemon/internal/restartmanager/restartmanager_test.go index d0d29947d9..d385700406 100644 --- a/daemon/internal/restartmanager/restartmanager_test.go +++ b/daemon/internal/restartmanager/restartmanager_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" ) func TestRestartManagerTimeout(t *testing.T) { diff --git a/daemon/kill.go b/daemon/kill.go index e07c6d71c2..c2596fb870 100644 --- a/daemon/kill.go +++ b/daemon/kill.go @@ -10,10 +10,10 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" containerpkg "github.com/docker/docker/daemon/container" "github.com/docker/docker/errdefs" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" "github.com/moby/sys/signal" "github.com/pkg/errors" ) diff --git a/daemon/libnetwork/cluster/provider.go b/daemon/libnetwork/cluster/provider.go index 0259eb7005..33d45fa7a6 100644 --- a/daemon/libnetwork/cluster/provider.go +++ b/daemon/libnetwork/cluster/provider.go @@ -3,7 +3,7 @@ package cluster import ( "context" - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/network" ) const ( diff --git a/daemon/libnetwork/controller_linux.go b/daemon/libnetwork/controller_linux.go index 30dc71130b..94ee5880c6 100644 --- a/daemon/libnetwork/controller_linux.go +++ b/daemon/libnetwork/controller_linux.go @@ -7,12 +7,12 @@ import ( "time" "github.com/containerd/log" - "github.com/docker/docker/api/types/system" "github.com/docker/docker/daemon/libnetwork/internal/nftables" "github.com/docker/docker/daemon/libnetwork/iptables" "github.com/docker/docker/daemon/libnetwork/netlabel" "github.com/docker/docker/daemon/libnetwork/options" "github.com/docker/docker/daemon/libnetwork/osl" + "github.com/moby/moby/api/types/system" ) // FirewallBackend returns the name of the firewall backend for "docker info". diff --git a/daemon/libnetwork/controller_others.go b/daemon/libnetwork/controller_others.go index c8c8cc9ed2..0d58f06dd9 100644 --- a/daemon/libnetwork/controller_others.go +++ b/daemon/libnetwork/controller_others.go @@ -2,7 +2,7 @@ package libnetwork -import "github.com/docker/docker/api/types/system" +import "github.com/moby/moby/api/types/system" // FirewallBackend returns the name of the firewall backend for "docker info". func (c *Controller) FirewallBackend() *system.FirewallInfo { diff --git a/daemon/licensing.go b/daemon/licensing.go index 9b7d6a8699..1da65452c1 100644 --- a/daemon/licensing.go +++ b/daemon/licensing.go @@ -1,8 +1,8 @@ package daemon import ( - "github.com/docker/docker/api/types/system" "github.com/docker/docker/dockerversion" + "github.com/moby/moby/api/types/system" ) func (daemon *Daemon) fillLicense(v *system.Info) { diff --git a/daemon/licensing_test.go b/daemon/licensing_test.go index 5e193f31f2..2434365f47 100644 --- a/daemon/licensing_test.go +++ b/daemon/licensing_test.go @@ -3,8 +3,8 @@ package daemon import ( "testing" - "github.com/docker/docker/api/types/system" "github.com/docker/docker/dockerversion" + "github.com/moby/moby/api/types/system" "gotest.tools/v3/assert" ) diff --git a/daemon/list.go b/daemon/list.go index 338e767b5e..3e19b4dc7f 100644 --- a/daemon/list.go +++ b/daemon/list.go @@ -11,13 +11,13 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" "github.com/docker/docker/daemon/container" "github.com/docker/docker/errdefs" "github.com/docker/docker/image" "github.com/docker/go-connections/nat" + "github.com/moby/moby/api/types/backend" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" "github.com/pkg/errors" "golang.org/x/sync/errgroup" ) diff --git a/daemon/list_test.go b/daemon/list_test.go index 6ef0451ad0..2012d4c21e 100644 --- a/daemon/list_test.go +++ b/daemon/list_test.go @@ -8,11 +8,11 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" "github.com/docker/docker/daemon/container" "github.com/docker/docker/image" "github.com/google/uuid" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" "github.com/opencontainers/go-digest" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/daemon/logger/adapter.go b/daemon/logger/adapter.go index b865858286..6a1750dd39 100644 --- a/daemon/logger/adapter.go +++ b/daemon/logger/adapter.go @@ -9,8 +9,8 @@ import ( "time" "github.com/containerd/log" - "github.com/docker/docker/api/types/plugins/logdriver" "github.com/docker/docker/pkg/plugingetter" + "github.com/moby/moby/api/types/plugins/logdriver" "github.com/pkg/errors" ) diff --git a/daemon/logger/adapter_test.go b/daemon/logger/adapter_test.go index d9db7f7fc8..7971a5ac70 100644 --- a/daemon/logger/adapter_test.go +++ b/daemon/logger/adapter_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/plugins/logdriver" protoio "github.com/gogo/protobuf/io" + "github.com/moby/moby/api/types/plugins/logdriver" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/daemon/logger/copier.go b/daemon/logger/copier.go index c85c997e5c..457d686eeb 100644 --- a/daemon/logger/copier.go +++ b/daemon/logger/copier.go @@ -8,8 +8,8 @@ import ( "time" "github.com/containerd/log" - types "github.com/docker/docker/api/types/backend" "github.com/docker/docker/pkg/stringid" + types "github.com/moby/moby/api/types/backend" ) const ( diff --git a/daemon/logger/factory.go b/daemon/logger/factory.go index 54e3e4631d..15627669a7 100644 --- a/daemon/logger/factory.go +++ b/daemon/logger/factory.go @@ -5,9 +5,9 @@ import ( "sort" "sync" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/pkg/plugingetter" "github.com/docker/go-units" + containertypes "github.com/moby/moby/api/types/container" "github.com/pkg/errors" ) diff --git a/daemon/logger/journald/read.go b/daemon/logger/journald/read.go index 187db6bb60..5d47daf8e4 100644 --- a/daemon/logger/journald/read.go +++ b/daemon/logger/journald/read.go @@ -10,9 +10,9 @@ import ( "github.com/containerd/log" "github.com/coreos/go-systemd/v22/journal" - "github.com/docker/docker/api/types/backend" "github.com/docker/docker/daemon/logger" "github.com/docker/docker/daemon/logger/journald/internal/sdjournal" + "github.com/moby/moby/api/types/backend" ) const ( diff --git a/daemon/logger/jsonfilelog/read.go b/daemon/logger/jsonfilelog/read.go index 8f1bfb89e0..43b3c0d720 100644 --- a/daemon/logger/jsonfilelog/read.go +++ b/daemon/logger/jsonfilelog/read.go @@ -5,11 +5,11 @@ import ( "encoding/json" "io" - "github.com/docker/docker/api/types/backend" "github.com/docker/docker/daemon/logger" "github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog" "github.com/docker/docker/daemon/logger/loggerutils" "github.com/docker/docker/pkg/tailfile" + "github.com/moby/moby/api/types/backend" ) var _ logger.LogReader = (*JSONFileLogger)(nil) diff --git a/daemon/logger/local/local.go b/daemon/logger/local/local.go index bfa5d8e4df..7b39feb3c5 100644 --- a/daemon/logger/local/local.go +++ b/daemon/logger/local/local.go @@ -8,12 +8,12 @@ import ( "sync" "time" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/plugins/logdriver" "github.com/docker/docker/daemon/logger" "github.com/docker/docker/daemon/logger/loggerutils" "github.com/docker/docker/errdefs" "github.com/docker/go-units" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/plugins/logdriver" "github.com/pkg/errors" ) diff --git a/daemon/logger/local/local_test.go b/daemon/logger/local/local_test.go index c059db31ef..6d2aebe9b0 100644 --- a/daemon/logger/local/local_test.go +++ b/daemon/logger/local/local_test.go @@ -10,11 +10,11 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/plugins/logdriver" "github.com/docker/docker/daemon/logger" "github.com/docker/docker/daemon/logger/loggertest" protoio "github.com/gogo/protobuf/io" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/plugins/logdriver" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/daemon/logger/local/read.go b/daemon/logger/local/read.go index 186b4d6114..ad2e96faf2 100644 --- a/daemon/logger/local/read.go +++ b/daemon/logger/local/read.go @@ -7,10 +7,10 @@ import ( "fmt" "io" - "github.com/docker/docker/api/types/plugins/logdriver" "github.com/docker/docker/daemon/logger" "github.com/docker/docker/daemon/logger/loggerutils" "github.com/docker/docker/errdefs" + "github.com/moby/moby/api/types/plugins/logdriver" "github.com/pkg/errors" ) diff --git a/daemon/logger/logger.go b/daemon/logger/logger.go index 73e7d2a18d..defe67daae 100644 --- a/daemon/logger/logger.go +++ b/daemon/logger/logger.go @@ -12,7 +12,7 @@ import ( "sync" "time" - "github.com/docker/docker/api/types/backend" + "github.com/moby/moby/api/types/backend" ) // ErrReadLogsNotSupported is returned when the underlying log driver does not support reading diff --git a/daemon/logger/logger_test.go b/daemon/logger/logger_test.go index bfbd6daafe..57e9e71a9a 100644 --- a/daemon/logger/logger_test.go +++ b/daemon/logger/logger_test.go @@ -1,7 +1,7 @@ package logger import ( - "github.com/docker/docker/api/types/backend" + "github.com/moby/moby/api/types/backend" ) func (m *Message) copy() *Message { diff --git a/daemon/logger/loggertest/logreader.go b/daemon/logger/loggertest/logreader.go index 99e3387f2b..21335baf2a 100644 --- a/daemon/logger/loggertest/logreader.go +++ b/daemon/logger/loggertest/logreader.go @@ -15,8 +15,8 @@ import ( is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/assert/opt" - "github.com/docker/docker/api/types/backend" "github.com/docker/docker/daemon/logger" + "github.com/moby/moby/api/types/backend" ) type syncer interface { diff --git a/daemon/logger/loggerutils/cache/local_cache.go b/daemon/logger/loggerutils/cache/local_cache.go index 9dd96e8cc2..c7d407c294 100644 --- a/daemon/logger/loggerutils/cache/local_cache.go +++ b/daemon/logger/loggerutils/cache/local_cache.go @@ -5,10 +5,10 @@ import ( "strconv" "github.com/containerd/log" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/logger" "github.com/docker/docker/daemon/logger/local" "github.com/docker/go-units" + "github.com/moby/moby/api/types/container" "github.com/pkg/errors" ) diff --git a/daemon/logger/loggerutils/logfile_race_test.go b/daemon/logger/loggerutils/logfile_race_test.go index 4833fa3fae..03ddca0904 100644 --- a/daemon/logger/loggerutils/logfile_race_test.go +++ b/daemon/logger/loggerutils/logfile_race_test.go @@ -10,9 +10,9 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/backend" "github.com/docker/docker/daemon/logger" "github.com/docker/docker/pkg/tailfile" + "github.com/moby/moby/api/types/backend" "golang.org/x/sync/errgroup" "gotest.tools/v3/assert" ) diff --git a/daemon/logger/plugin.go b/daemon/logger/plugin.go index 148f0948c1..22fb13e529 100644 --- a/daemon/logger/plugin.go +++ b/daemon/logger/plugin.go @@ -6,11 +6,11 @@ import ( "os" "path/filepath" - "github.com/docker/docker/api/types/plugins/logdriver" "github.com/docker/docker/errdefs" "github.com/docker/docker/pkg/plugingetter" "github.com/docker/docker/pkg/plugins" "github.com/docker/docker/pkg/stringid" + "github.com/moby/moby/api/types/plugins/logdriver" "github.com/pkg/errors" ) diff --git a/daemon/logs.go b/daemon/logs.go index c0a74d2af9..a4a80f1b95 100644 --- a/daemon/logs.go +++ b/daemon/logs.go @@ -7,14 +7,14 @@ import ( "github.com/containerd/containerd/v2/pkg/tracing" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" - containertypes "github.com/docker/docker/api/types/container" - timetypes "github.com/docker/docker/api/types/time" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/logger" logcache "github.com/docker/docker/daemon/logger/loggerutils/cache" "github.com/docker/docker/errdefs" + "github.com/moby/moby/api/types/backend" + containertypes "github.com/moby/moby/api/types/container" + timetypes "github.com/moby/moby/api/types/time" "github.com/pkg/errors" ) diff --git a/daemon/logs_test.go b/daemon/logs_test.go index 0c36299e09..3f0f53adb9 100644 --- a/daemon/logs_test.go +++ b/daemon/logs_test.go @@ -3,7 +3,7 @@ package daemon import ( "testing" - containertypes "github.com/docker/docker/api/types/container" + containertypes "github.com/moby/moby/api/types/container" ) func TestMergeAndVerifyLogConfigNilConfig(t *testing.T) { diff --git a/daemon/migration.go b/daemon/migration.go index 2e2326ccf6..ccef57a480 100644 --- a/daemon/migration.go +++ b/daemon/migration.go @@ -7,10 +7,10 @@ import ( "github.com/containerd/containerd/v2/core/content" "github.com/containerd/log" "github.com/containerd/platforms" - "github.com/docker/docker/api/types/backend" "github.com/docker/docker/daemon/container" "github.com/docker/docker/image" "github.com/docker/docker/internal/multierror" + "github.com/moby/moby/api/types/backend" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" ) diff --git a/daemon/monitor.go b/daemon/monitor.go index 660001e434..6a7df70393 100644 --- a/daemon/monitor.go +++ b/daemon/monitor.go @@ -8,13 +8,13 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/container" libcontainerdtypes "github.com/docker/docker/daemon/internal/libcontainerd/types" "github.com/docker/docker/daemon/internal/metrics" "github.com/docker/docker/daemon/internal/restartmanager" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/events" "github.com/pkg/errors" ) diff --git a/daemon/mounts.go b/daemon/mounts.go index e109d79cc9..077231483a 100644 --- a/daemon/mounts.go +++ b/daemon/mounts.go @@ -6,9 +6,9 @@ import ( "strings" "github.com/containerd/log" - mounttypes "github.com/docker/docker/api/types/mount" "github.com/docker/docker/daemon/container" volumesservice "github.com/docker/docker/daemon/volume/service" + mounttypes "github.com/moby/moby/api/types/mount" ) func (daemon *Daemon) prepareMountPoints(container *container.Container) error { diff --git a/daemon/network.go b/daemon/network.go index d3e9cb327c..f655298c28 100644 --- a/daemon/network.go +++ b/daemon/network.go @@ -11,11 +11,6 @@ import ( "sync" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" - networktypes "github.com/docker/docker/api/types/network" clustertypes "github.com/docker/docker/daemon/cluster/provider" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/container" @@ -33,6 +28,11 @@ import ( "github.com/docker/docker/internal/otelutil" "github.com/docker/docker/pkg/plugingetter" "github.com/docker/go-connections/nat" + "github.com/moby/moby/api/types/backend" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/filters" + networktypes "github.com/moby/moby/api/types/network" "go.opentelemetry.io/otel/baggage" ) diff --git a/daemon/network/filter.go b/daemon/network/filter.go index 53f1d57f5d..2a7a0d5a6f 100644 --- a/daemon/network/filter.go +++ b/daemon/network/filter.go @@ -1,9 +1,9 @@ package network import ( - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/network" "github.com/docker/docker/errdefs" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/network" "github.com/pkg/errors" ) diff --git a/daemon/network/filter_test.go b/daemon/network/filter_test.go index 61b434f6dd..e3278dae4f 100644 --- a/daemon/network/filter_test.go +++ b/daemon/network/filter_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/network" ) func TestFilterNetworks(t *testing.T) { diff --git a/daemon/network/network_mode_unix.go b/daemon/network/network_mode_unix.go index 584b6cdd38..a5cd26ece0 100644 --- a/daemon/network/network_mode_unix.go +++ b/daemon/network/network_mode_unix.go @@ -3,8 +3,8 @@ package network import ( - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" ) const defaultNetwork = network.NetworkBridge diff --git a/daemon/network/network_mode_windows.go b/daemon/network/network_mode_windows.go index a827641d75..0edae87588 100644 --- a/daemon/network/network_mode_windows.go +++ b/daemon/network/network_mode_windows.go @@ -1,8 +1,8 @@ package network import ( - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" ) const defaultNetwork = network.NetworkNat diff --git a/daemon/network/settings.go b/daemon/network/settings.go index 285c4f2cdf..d35263825b 100644 --- a/daemon/network/settings.go +++ b/daemon/network/settings.go @@ -4,9 +4,9 @@ import ( "net" "sync" - networktypes "github.com/docker/docker/api/types/network" clustertypes "github.com/docker/docker/daemon/cluster/provider" "github.com/docker/go-connections/nat" + networktypes "github.com/moby/moby/api/types/network" "github.com/pkg/errors" ) diff --git a/daemon/oci_linux.go b/daemon/oci_linux.go index dc194a7c22..fb261def8f 100644 --- a/daemon/oci_linux.go +++ b/daemon/oci_linux.go @@ -13,7 +13,6 @@ import ( "github.com/containerd/containerd/v2/pkg/apparmor" coci "github.com/containerd/containerd/v2/pkg/oci" "github.com/containerd/log" - containertypes "github.com/docker/docker/api/types/container" dconfig "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/container" volumemounts "github.com/docker/docker/daemon/volume/mounts" @@ -22,6 +21,7 @@ import ( "github.com/docker/docker/internal/rootless/specconv" "github.com/docker/docker/oci" "github.com/docker/docker/oci/caps" + containertypes "github.com/moby/moby/api/types/container" "github.com/moby/sys/mount" "github.com/moby/sys/mountinfo" "github.com/moby/sys/user" diff --git a/daemon/oci_linux_test.go b/daemon/oci_linux_test.go index abe45a39f1..c1943fad36 100644 --- a/daemon/oci_linux_test.go +++ b/daemon/oci_linux_test.go @@ -6,13 +6,13 @@ import ( "path/filepath" "testing" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/libnetwork" nwconfig "github.com/docker/docker/daemon/libnetwork/config" "github.com/docker/docker/daemon/network" "github.com/google/go-cmp/cmp/cmpopts" + containertypes "github.com/moby/moby/api/types/container" "github.com/opencontainers/runtime-spec/specs-go" "golang.org/x/sys/unix" "gotest.tools/v3/assert" diff --git a/daemon/oci_windows.go b/daemon/oci_windows.go index ccae71686f..0b0f7d75ae 100644 --- a/daemon/oci_windows.go +++ b/daemon/oci_windows.go @@ -12,13 +12,13 @@ import ( "github.com/Microsoft/hcsshim" coci "github.com/containerd/containerd/v2/pkg/oci" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/container" "github.com/docker/docker/errdefs" "github.com/docker/docker/image" "github.com/docker/docker/oci" + "github.com/moby/moby/api/types/backend" + containertypes "github.com/moby/moby/api/types/container" "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" "golang.org/x/sys/windows" diff --git a/daemon/oci_windows_test.go b/daemon/oci_windows_test.go index 8007c50606..d2ad7e893b 100644 --- a/daemon/oci_windows_test.go +++ b/daemon/oci_windows_test.go @@ -10,8 +10,8 @@ import ( is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/fs" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/container" + containertypes "github.com/moby/moby/api/types/container" swarmagent "github.com/moby/swarmkit/v2/agent" swarmapi "github.com/moby/swarmkit/v2/api" "github.com/opencontainers/runtime-spec/specs-go" diff --git a/daemon/pause.go b/daemon/pause.go index 82dcedc3cb..b4b1cca9ce 100644 --- a/daemon/pause.go +++ b/daemon/pause.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/containerd/log" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/container" + "github.com/moby/moby/api/types/events" ) // ContainerPause pauses a container diff --git a/daemon/pkg/opts/runtime.go b/daemon/pkg/opts/runtime.go index 4704bae17a..87157b3c68 100644 --- a/daemon/pkg/opts/runtime.go +++ b/daemon/pkg/opts/runtime.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/docker/docker/api/types/system" + "github.com/moby/moby/api/types/system" ) // RuntimeOpt defines a map of Runtimes diff --git a/daemon/pkg/opts/ulimit.go b/daemon/pkg/opts/ulimit.go index 7d3b39935a..b29af25489 100644 --- a/daemon/pkg/opts/ulimit.go +++ b/daemon/pkg/opts/ulimit.go @@ -3,8 +3,8 @@ package opts import ( "fmt" - "github.com/docker/docker/api/types/container" "github.com/docker/go-units" + "github.com/moby/moby/api/types/container" ) // UlimitOpt defines a map of Ulimits diff --git a/daemon/pkg/opts/ulimit_test.go b/daemon/pkg/opts/ulimit_test.go index ab40befb31..b8c087328b 100644 --- a/daemon/pkg/opts/ulimit_test.go +++ b/daemon/pkg/opts/ulimit_test.go @@ -3,7 +3,7 @@ package opts import ( "testing" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" ) func TestUlimitOpt(t *testing.T) { diff --git a/daemon/pkg/plugin/backend_linux.go b/daemon/pkg/plugin/backend_linux.go index dd682e9986..5513eb22e9 100644 --- a/daemon/pkg/plugin/backend_linux.go +++ b/daemon/pkg/plugin/backend_linux.go @@ -21,11 +21,6 @@ import ( "github.com/containerd/log" "github.com/containerd/platforms" "github.com/distribution/reference" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/registry" v2 "github.com/docker/docker/daemon/pkg/plugin/v2" "github.com/docker/docker/dockerversion" "github.com/docker/docker/errdefs" @@ -35,6 +30,11 @@ import ( "github.com/docker/docker/pkg/progress" "github.com/docker/docker/pkg/stringid" "github.com/moby/go-archive/chrootarchive" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/registry" "github.com/moby/sys/mount" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/daemon/pkg/plugin/backend_unsupported.go b/daemon/pkg/plugin/backend_unsupported.go index ca807241ef..13786880ff 100644 --- a/daemon/pkg/plugin/backend_unsupported.go +++ b/daemon/pkg/plugin/backend_unsupported.go @@ -9,10 +9,10 @@ import ( "net/http" "github.com/distribution/reference" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/registry" ) var errNotSupported = errors.New("plugins are not supported on this platform") diff --git a/daemon/pkg/plugin/events.go b/daemon/pkg/plugin/events.go index 893406d2db..fe0974bfd3 100644 --- a/daemon/pkg/plugin/events.go +++ b/daemon/pkg/plugin/events.go @@ -4,7 +4,7 @@ import ( "fmt" "reflect" - "github.com/docker/docker/api/types" + "github.com/moby/moby/api/types" ) // Event is emitted for actions performed on the plugin manager diff --git a/daemon/pkg/plugin/fetch_linux.go b/daemon/pkg/plugin/fetch_linux.go index c2a4085459..bebd96e7a8 100644 --- a/daemon/pkg/plugin/fetch_linux.go +++ b/daemon/pkg/plugin/fetch_linux.go @@ -13,12 +13,12 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/distribution/reference" - "github.com/docker/docker/api/types/registry" progressutils "github.com/docker/docker/distribution/utils" "github.com/docker/docker/pkg/ioutils" "github.com/docker/docker/pkg/progress" "github.com/docker/docker/pkg/stringid" "github.com/moby/go-archive/chrootarchive" + "github.com/moby/moby/api/types/registry" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" diff --git a/daemon/pkg/plugin/manager.go b/daemon/pkg/plugin/manager.go index 47fdbcec50..5b04fc8acc 100644 --- a/daemon/pkg/plugin/manager.go +++ b/daemon/pkg/plugin/manager.go @@ -15,13 +15,13 @@ import ( "github.com/containerd/containerd/v2/core/content" "github.com/containerd/containerd/v2/plugins/content/local" "github.com/containerd/log" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/events" v2 "github.com/docker/docker/daemon/pkg/plugin/v2" "github.com/docker/docker/internal/containerfs" "github.com/docker/docker/internal/lazyregexp" "github.com/docker/docker/pkg/authorization" "github.com/docker/docker/registry" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/events" "github.com/moby/pubsub" "github.com/moby/sys/atomicwriter" "github.com/opencontainers/go-digest" diff --git a/daemon/pkg/plugin/manager_linux.go b/daemon/pkg/plugin/manager_linux.go index 54accd8821..296eb7ba72 100644 --- a/daemon/pkg/plugin/manager_linux.go +++ b/daemon/pkg/plugin/manager_linux.go @@ -10,12 +10,12 @@ import ( "github.com/containerd/containerd/v2/core/content" "github.com/containerd/log" - "github.com/docker/docker/api/types" "github.com/docker/docker/daemon/initlayer" v2 "github.com/docker/docker/daemon/pkg/plugin/v2" "github.com/docker/docker/errdefs" "github.com/docker/docker/pkg/plugins" "github.com/docker/docker/pkg/stringid" + "github.com/moby/moby/api/types" "github.com/moby/sys/mount" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/daemon/pkg/plugin/manager_linux_test.go b/daemon/pkg/plugin/manager_linux_test.go index 0b91fa55ed..1c9450aca0 100644 --- a/daemon/pkg/plugin/manager_linux_test.go +++ b/daemon/pkg/plugin/manager_linux_test.go @@ -8,12 +8,12 @@ import ( "syscall" "testing" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/events" v2 "github.com/docker/docker/daemon/pkg/plugin/v2" "github.com/docker/docker/internal/containerfs" "github.com/docker/docker/pkg/stringid" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/events" "github.com/moby/sys/mount" "github.com/moby/sys/mountinfo" "github.com/opencontainers/runtime-spec/specs-go" diff --git a/daemon/pkg/plugin/manager_test.go b/daemon/pkg/plugin/manager_test.go index 4efe76b446..7ac46b8b20 100644 --- a/daemon/pkg/plugin/manager_test.go +++ b/daemon/pkg/plugin/manager_test.go @@ -3,7 +3,7 @@ package plugin import ( "testing" - "github.com/docker/docker/api/types" + "github.com/moby/moby/api/types" ) func TestValidatePrivileges(t *testing.T) { diff --git a/daemon/pkg/plugin/registry.go b/daemon/pkg/plugin/registry.go index 73f5f553a8..c7a67c2b3f 100644 --- a/daemon/pkg/plugin/registry.go +++ b/daemon/pkg/plugin/registry.go @@ -11,8 +11,8 @@ import ( "github.com/containerd/containerd/v2/core/remotes/docker" "github.com/containerd/log" "github.com/distribution/reference" - "github.com/docker/docker/api/types/registry" "github.com/docker/docker/dockerversion" + "github.com/moby/moby/api/types/registry" "github.com/pkg/errors" ) diff --git a/daemon/pkg/plugin/store_test.go b/daemon/pkg/plugin/store_test.go index d92e96083c..9ae572ee23 100644 --- a/daemon/pkg/plugin/store_test.go +++ b/daemon/pkg/plugin/store_test.go @@ -3,9 +3,9 @@ package plugin import ( "testing" - "github.com/docker/docker/api/types" v2 "github.com/docker/docker/daemon/pkg/plugin/v2" "github.com/docker/docker/pkg/plugingetter" + "github.com/moby/moby/api/types" ) func TestFilterByCapNeg(t *testing.T) { diff --git a/daemon/pkg/plugin/v2/plugin.go b/daemon/pkg/plugin/v2/plugin.go index 9e76b6b3ef..9b9fa28b0f 100644 --- a/daemon/pkg/plugin/v2/plugin.go +++ b/daemon/pkg/plugin/v2/plugin.go @@ -9,9 +9,9 @@ import ( "sync" "time" - "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/plugingetter" "github.com/docker/docker/pkg/plugins" + "github.com/moby/moby/api/types" "github.com/opencontainers/go-digest" "github.com/opencontainers/runtime-spec/specs-go" ) diff --git a/daemon/pkg/plugin/v2/plugin_linux.go b/daemon/pkg/plugin/v2/plugin_linux.go index bfbd24090a..f9ff28cbbe 100644 --- a/daemon/pkg/plugin/v2/plugin_linux.go +++ b/daemon/pkg/plugin/v2/plugin_linux.go @@ -9,10 +9,10 @@ import ( "runtime" "strings" - "github.com/docker/docker/api/types" "github.com/docker/docker/internal/rootless/mountopts" "github.com/docker/docker/internal/sliceutil" "github.com/docker/docker/oci" + "github.com/moby/moby/api/types" "github.com/moby/sys/userns" "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" diff --git a/daemon/prune.go b/daemon/prune.go index a32f668e08..0215a7affa 100644 --- a/daemon/prune.go +++ b/daemon/prune.go @@ -6,15 +6,15 @@ import ( "time" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/network" - timetypes "github.com/docker/docker/api/types/time" "github.com/docker/docker/daemon/libnetwork" "github.com/docker/docker/errdefs" "github.com/docker/docker/internal/lazyregexp" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/network" + timetypes "github.com/moby/moby/api/types/time" "github.com/pkg/errors" ) diff --git a/daemon/reload.go b/daemon/reload.go index 7c940680e6..9ad37f0275 100644 --- a/daemon/reload.go +++ b/daemon/reload.go @@ -7,9 +7,9 @@ import ( "strconv" "github.com/containerd/log" - "github.com/docker/docker/api/types/events" "github.com/hashicorp/go-multierror" "github.com/mitchellh/copystructure" + "github.com/moby/moby/api/types/events" "github.com/docker/docker/daemon/config" ) diff --git a/daemon/rename.go b/daemon/rename.go index 190e84cb02..11a4e9e2e3 100644 --- a/daemon/rename.go +++ b/daemon/rename.go @@ -6,11 +6,11 @@ import ( "strings" "github.com/containerd/log" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/libnetwork" "github.com/docker/docker/daemon/network" "github.com/docker/docker/errdefs" + "github.com/moby/moby/api/types/events" "github.com/pkg/errors" ) diff --git a/daemon/resize.go b/daemon/resize.go index de53ca4a10..3d21d184d5 100644 --- a/daemon/resize.go +++ b/daemon/resize.go @@ -6,8 +6,8 @@ import ( "strconv" "time" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/errdefs" + "github.com/moby/moby/api/types/events" ) // ContainerResize changes the size of the TTY of the process running diff --git a/daemon/restart.go b/daemon/restart.go index 98672b853a..ecb38f79d9 100644 --- a/daemon/restart.go +++ b/daemon/restart.go @@ -4,9 +4,9 @@ import ( "context" "fmt" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/container" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" ) // ContainerRestart stops and starts a container. It attempts to diff --git a/daemon/runtime_unix_test.go b/daemon/runtime_unix_test.go index 8f4dde95d9..9bd002ed8b 100644 --- a/daemon/runtime_unix_test.go +++ b/daemon/runtime_unix_test.go @@ -13,9 +13,9 @@ import ( runtimeoptions "github.com/containerd/containerd/api/types/runtimeoptions/v1" "github.com/containerd/containerd/v2/plugins" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/system" "github.com/docker/docker/daemon/config" "github.com/google/go-cmp/cmp/cmpopts" + "github.com/moby/moby/api/types/system" "google.golang.org/protobuf/proto" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/daemon/seccomp_linux_test.go b/daemon/seccomp_linux_test.go index 5ab66d1b29..3d39589f28 100644 --- a/daemon/seccomp_linux_test.go +++ b/daemon/seccomp_linux_test.go @@ -4,12 +4,12 @@ import ( "testing" coci "github.com/containerd/containerd/v2/pkg/oci" - containertypes "github.com/docker/docker/api/types/container" dconfig "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/container" "github.com/docker/docker/oci" "github.com/docker/docker/pkg/sysinfo" "github.com/docker/docker/profiles/seccomp" + containertypes "github.com/moby/moby/api/types/container" "github.com/opencontainers/runtime-spec/specs-go" "gotest.tools/v3/assert" ) diff --git a/daemon/secrets.go b/daemon/secrets.go index 9daef784d2..dc1dca1ed8 100644 --- a/daemon/secrets.go +++ b/daemon/secrets.go @@ -1,7 +1,7 @@ package daemon import ( - swarmtypes "github.com/docker/docker/api/types/swarm" + swarmtypes "github.com/moby/moby/api/types/swarm" ) // SetContainerSecretReferences sets the container secret references needed diff --git a/daemon/server/httputils/decoder.go b/daemon/server/httputils/decoder.go index 0e62ed356e..08f309ac26 100644 --- a/daemon/server/httputils/decoder.go +++ b/daemon/server/httputils/decoder.go @@ -3,8 +3,8 @@ package httputils import ( "io" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" ) // ContainerDecoder specifies how diff --git a/daemon/server/httputils/write_log_stream.go b/daemon/server/httputils/write_log_stream.go index 5f9e43f585..5e993ceece 100644 --- a/daemon/server/httputils/write_log_stream.go +++ b/daemon/server/httputils/write_log_stream.go @@ -8,11 +8,11 @@ import ( "net/url" "sort" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/pkg/ioutils" "github.com/docker/docker/pkg/jsonmessage" "github.com/docker/docker/pkg/stdcopy" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/container" ) // WriteLogStream writes an encoded byte stream of log messages from the diff --git a/daemon/server/middleware/version.go b/daemon/server/middleware/version.go index 4e8ce30aff..8ce08ea591 100644 --- a/daemon/server/middleware/version.go +++ b/daemon/server/middleware/version.go @@ -6,10 +6,10 @@ import ( "net/http" "runtime" - "github.com/docker/docker/api" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/server/httputils" + "github.com/moby/moby/api" + "github.com/moby/moby/api/types/versions" ) // VersionMiddleware is a middleware that diff --git a/daemon/server/middleware/version_test.go b/daemon/server/middleware/version_test.go index a0b72d8ff5..be33353206 100644 --- a/daemon/server/middleware/version_test.go +++ b/daemon/server/middleware/version_test.go @@ -8,9 +8,9 @@ import ( "runtime" "testing" - "github.com/docker/docker/api" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/server/httputils" + "github.com/moby/moby/api" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/daemon/server/router/build/backend.go b/daemon/server/router/build/backend.go index 68daeb25ac..be61730b44 100644 --- a/daemon/server/router/build/backend.go +++ b/daemon/server/router/build/backend.go @@ -3,8 +3,8 @@ package build import ( "context" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/build" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/build" ) // Backend abstracts an image builder whose only purpose is to build an image referenced by an imageID. diff --git a/daemon/server/router/build/build.go b/daemon/server/router/build/build.go index dee9f6dadd..6b3df616cc 100644 --- a/daemon/server/router/build/build.go +++ b/daemon/server/router/build/build.go @@ -3,8 +3,8 @@ package build import ( "runtime" - "github.com/docker/docker/api/types/build" "github.com/docker/docker/daemon/server/router" + "github.com/moby/moby/api/types/build" ) // buildRouter is a router to talk with the build controller diff --git a/daemon/server/router/build/build_routes.go b/daemon/server/router/build/build_routes.go index 57e05572cd..1b843425cf 100644 --- a/daemon/server/router/build/build_routes.go +++ b/daemon/server/router/build/build_routes.go @@ -16,16 +16,16 @@ import ( "syscall" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/daemon/server/httputils" "github.com/docker/docker/pkg/ioutils" "github.com/docker/docker/pkg/progress" "github.com/docker/docker/pkg/streamformatter" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/registry" + "github.com/moby/moby/api/types/versions" "github.com/pkg/errors" ) diff --git a/daemon/server/router/checkpoint/backend.go b/daemon/server/router/checkpoint/backend.go index ae410a6a8e..e942cce27c 100644 --- a/daemon/server/router/checkpoint/backend.go +++ b/daemon/server/router/checkpoint/backend.go @@ -1,6 +1,6 @@ package checkpoint -import "github.com/docker/docker/api/types/checkpoint" +import "github.com/moby/moby/api/types/checkpoint" // Backend for Checkpoint type Backend interface { diff --git a/daemon/server/router/checkpoint/checkpoint_routes.go b/daemon/server/router/checkpoint/checkpoint_routes.go index 5c28442e65..b0175019cf 100644 --- a/daemon/server/router/checkpoint/checkpoint_routes.go +++ b/daemon/server/router/checkpoint/checkpoint_routes.go @@ -4,8 +4,8 @@ import ( "context" "net/http" - "github.com/docker/docker/api/types/checkpoint" "github.com/docker/docker/daemon/server/httputils" + "github.com/moby/moby/api/types/checkpoint" ) func (cr *checkpointRouter) postContainerCheckpoint(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error { diff --git a/daemon/server/router/container/backend.go b/daemon/server/router/container/backend.go index e7824933d0..1aa9e7b0f2 100644 --- a/daemon/server/router/container/backend.go +++ b/daemon/server/router/container/backend.go @@ -4,10 +4,10 @@ import ( "context" "io" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" "github.com/moby/go-archive" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" ) // execBackend includes functions to implement to provide exec functionality. diff --git a/daemon/server/router/container/container_routes.go b/daemon/server/router/container/container_routes.go index 90c5428d4a..5fd27ce15a 100644 --- a/daemon/server/router/container/container_routes.go +++ b/daemon/server/router/container/container_routes.go @@ -12,13 +12,6 @@ import ( "github.com/containerd/log" "github.com/containerd/platforms" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/mount" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/daemon/libnetwork/netlabel" networkSettings "github.com/docker/docker/daemon/network" "github.com/docker/docker/daemon/server/httpstatus" @@ -26,6 +19,13 @@ import ( "github.com/docker/docker/errdefs" "github.com/docker/docker/pkg/ioutils" "github.com/docker/docker/runconfig" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/mount" + "github.com/moby/moby/api/types/network" + "github.com/moby/moby/api/types/versions" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" "go.opentelemetry.io/otel" diff --git a/daemon/server/router/container/container_routes_test.go b/daemon/server/router/container/container_routes_test.go index 4a14f62a4c..0ab587b2b0 100644 --- a/daemon/server/router/container/container_routes_test.go +++ b/daemon/server/router/container/container_routes_test.go @@ -4,9 +4,9 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" "github.com/docker/docker/daemon/libnetwork/netlabel" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/daemon/server/router/container/copy.go b/daemon/server/router/container/copy.go index bde6786b40..773234b7b4 100644 --- a/daemon/server/router/container/copy.go +++ b/daemon/server/router/container/copy.go @@ -9,9 +9,9 @@ import ( "io" "net/http" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/server/httputils" gddohttputil "github.com/golang/gddo/httputil" + "github.com/moby/moby/api/types/container" ) // setContainerPathStatHeader encodes the stat to JSON, base64 encode, and place in a header. diff --git a/daemon/server/router/container/exec.go b/daemon/server/router/container/exec.go index 7e4582a347..ab9a8ff09b 100644 --- a/daemon/server/router/container/exec.go +++ b/daemon/server/router/container/exec.go @@ -7,13 +7,13 @@ import ( "net/http" "github.com/containerd/log" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/daemon/server/httputils" "github.com/docker/docker/errdefs" "github.com/docker/docker/pkg/stdcopy" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/versions" "github.com/pkg/errors" ) diff --git a/daemon/server/router/container/inspect.go b/daemon/server/router/container/inspect.go index f33465c22e..b0bf8e1b5e 100644 --- a/daemon/server/router/container/inspect.go +++ b/daemon/server/router/container/inspect.go @@ -7,12 +7,12 @@ import ( "context" "net/http" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/daemon/server/httputils" "github.com/docker/docker/internal/sliceutil" "github.com/docker/docker/pkg/stringid" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/versions" ) // getContainersByName inspects container's configuration and serializes it as json. diff --git a/daemon/server/router/distribution/backend.go b/daemon/server/router/distribution/backend.go index ca4b6837bc..f879cac72a 100644 --- a/daemon/server/router/distribution/backend.go +++ b/daemon/server/router/distribution/backend.go @@ -5,7 +5,7 @@ import ( "github.com/distribution/reference" "github.com/docker/distribution" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/registry" ) // Backend is all the methods that need to be implemented diff --git a/daemon/server/router/distribution/distribution_routes.go b/daemon/server/router/distribution/distribution_routes.go index 1daaf89dd1..41cf0b3d46 100644 --- a/daemon/server/router/distribution/distribution_routes.go +++ b/daemon/server/router/distribution/distribution_routes.go @@ -9,10 +9,10 @@ import ( "github.com/docker/distribution" "github.com/docker/distribution/manifest/manifestlist" "github.com/docker/distribution/manifest/schema2" - "github.com/docker/docker/api/types/registry" "github.com/docker/docker/daemon/server/httputils" distributionpkg "github.com/docker/docker/distribution" "github.com/docker/docker/errdefs" + "github.com/moby/moby/api/types/registry" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" ) diff --git a/daemon/server/router/image/backend.go b/daemon/server/router/image/backend.go index 307a0fb9a3..4d6aa57acc 100644 --- a/daemon/server/router/image/backend.go +++ b/daemon/server/router/image/backend.go @@ -5,11 +5,11 @@ import ( "io" "github.com/distribution/reference" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/registry" dockerimage "github.com/docker/docker/image" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/registry" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/daemon/server/router/image/image_routes.go b/daemon/server/router/image/image_routes.go index e326f67901..7167136c00 100644 --- a/daemon/server/router/image/image_routes.go +++ b/daemon/server/router/image/image_routes.go @@ -12,11 +12,6 @@ import ( "github.com/containerd/platforms" "github.com/distribution/reference" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/filters" - imagetypes "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/daemon/builder/remotecontext" "github.com/docker/docker/daemon/server/httputils" "github.com/docker/docker/dockerversion" @@ -25,6 +20,11 @@ import ( "github.com/docker/docker/pkg/ioutils" "github.com/docker/docker/pkg/progress" "github.com/docker/docker/pkg/streamformatter" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/filters" + imagetypes "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/registry" + "github.com/moby/moby/api/types/versions" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" diff --git a/daemon/server/router/image/inspect_response.go b/daemon/server/router/image/inspect_response.go index a188af4d81..7d7f855941 100644 --- a/daemon/server/router/image/inspect_response.go +++ b/daemon/server/router/image/inspect_response.go @@ -7,7 +7,7 @@ import ( "encoding/json" "maps" - "github.com/docker/docker/api/types/image" + "github.com/moby/moby/api/types/image" ) // legacyConfigFields defines legacy image-config fields to include in diff --git a/daemon/server/router/image/inspect_response_test.go b/daemon/server/router/image/inspect_response_test.go index acfd7bbd30..7e2905b76f 100644 --- a/daemon/server/router/image/inspect_response_test.go +++ b/daemon/server/router/image/inspect_response_test.go @@ -4,8 +4,8 @@ import ( "encoding/json" "testing" - "github.com/docker/docker/api/types/image" dockerspec "github.com/moby/docker-image-spec/specs-go/v1" + "github.com/moby/moby/api/types/image" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/daemon/server/router/network/backend.go b/daemon/server/router/network/backend.go index 933dfe10de..b4911ee211 100644 --- a/daemon/server/router/network/backend.go +++ b/daemon/server/router/network/backend.go @@ -3,9 +3,9 @@ package network import ( "context" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/network" ) // Backend is all the methods that need to be implemented diff --git a/daemon/server/router/network/network_routes.go b/daemon/server/router/network/network_routes.go index 25f8af08c4..d60886f82d 100644 --- a/daemon/server/router/network/network_routes.go +++ b/daemon/server/router/network/network_routes.go @@ -6,14 +6,14 @@ import ( "strconv" "strings" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/daemon/libnetwork" "github.com/docker/docker/daemon/libnetwork/scope" "github.com/docker/docker/daemon/server/httputils" "github.com/docker/docker/errdefs" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/network" + "github.com/moby/moby/api/types/versions" "github.com/pkg/errors" ) diff --git a/daemon/server/router/plugin/backend.go b/daemon/server/router/plugin/backend.go index dcce3e8c4d..e3be7f6571 100644 --- a/daemon/server/router/plugin/backend.go +++ b/daemon/server/router/plugin/backend.go @@ -6,11 +6,11 @@ import ( "net/http" "github.com/distribution/reference" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/registry" "github.com/docker/docker/daemon/pkg/plugin" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/registry" ) // Backend for Plugin diff --git a/daemon/server/router/plugin/plugin_routes.go b/daemon/server/router/plugin/plugin_routes.go index 473035a223..499f2974f5 100644 --- a/daemon/server/router/plugin/plugin_routes.go +++ b/daemon/server/router/plugin/plugin_routes.go @@ -7,13 +7,13 @@ import ( "strings" "github.com/distribution/reference" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/registry" "github.com/docker/docker/daemon/server/httputils" "github.com/docker/docker/pkg/ioutils" "github.com/docker/docker/pkg/streamformatter" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/registry" "github.com/pkg/errors" ) diff --git a/daemon/server/router/swarm/backend.go b/daemon/server/router/swarm/backend.go index 2a87c500f0..0cdf5ff586 100644 --- a/daemon/server/router/swarm/backend.go +++ b/daemon/server/router/swarm/backend.go @@ -3,9 +3,9 @@ package swarm import ( "context" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/swarm" ) // Backend abstracts a swarm manager. diff --git a/daemon/server/router/swarm/cluster_routes.go b/daemon/server/router/swarm/cluster_routes.go index 2e092ee664..7c0774697a 100644 --- a/daemon/server/router/swarm/cluster_routes.go +++ b/daemon/server/router/swarm/cluster_routes.go @@ -7,13 +7,13 @@ import ( "strconv" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/registry" - types "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/daemon/server/httputils" "github.com/docker/docker/errdefs" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/registry" + types "github.com/moby/moby/api/types/swarm" + "github.com/moby/moby/api/types/versions" "github.com/pkg/errors" ) diff --git a/daemon/server/router/swarm/helpers.go b/daemon/server/router/swarm/helpers.go index 4fc46aa0e4..d8010204d1 100644 --- a/daemon/server/router/swarm/helpers.go +++ b/daemon/server/router/swarm/helpers.go @@ -5,12 +5,12 @@ import ( "errors" "net/http" - basictypes "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/daemon/server/httputils" + basictypes "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/swarm" + "github.com/moby/moby/api/types/versions" ) // swarmLogs takes an http response, request, and selector, and writes the logs diff --git a/daemon/server/router/swarm/helpers_test.go b/daemon/server/router/swarm/helpers_test.go index f747e4f164..456ef3defc 100644 --- a/daemon/server/router/swarm/helpers_test.go +++ b/daemon/server/router/swarm/helpers_test.go @@ -4,9 +4,9 @@ import ( "reflect" "testing" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/mount" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/mount" + "github.com/moby/moby/api/types/swarm" ) func TestAdjustForAPIVersion(t *testing.T) { diff --git a/daemon/server/router/system/backend.go b/daemon/server/router/system/backend.go index 9612346af2..6da7825b54 100644 --- a/daemon/server/router/system/backend.go +++ b/daemon/server/router/system/backend.go @@ -4,13 +4,13 @@ import ( "context" "time" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/api/types/system" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/registry" + "github.com/moby/moby/api/types/swarm" + "github.com/moby/moby/api/types/system" ) // DiskUsageOptions holds parameters for system disk usage query. diff --git a/daemon/server/router/system/info_response.go b/daemon/server/router/system/info_response.go index 6d7f03d7e4..2ff1b5fdcf 100644 --- a/daemon/server/router/system/info_response.go +++ b/daemon/server/router/system/info_response.go @@ -6,7 +6,7 @@ package system import ( "encoding/json" - "github.com/docker/docker/api/types/system" + "github.com/moby/moby/api/types/system" ) // infoResponse is a wrapper around [system.Info] with a custom diff --git a/daemon/server/router/system/info_response_test.go b/daemon/server/router/system/info_response_test.go index e04c7b613b..c61c1dddf6 100644 --- a/daemon/server/router/system/info_response_test.go +++ b/daemon/server/router/system/info_response_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/system" + "github.com/moby/moby/api/types/system" ) func TestLegacyFields(t *testing.T) { diff --git a/daemon/server/router/system/system_routes.go b/daemon/server/router/system/system_routes.go index dd4af0c2a0..afb1bbbdc8 100644 --- a/daemon/server/router/system/system_routes.go +++ b/daemon/server/router/system/system_routes.go @@ -11,18 +11,18 @@ import ( "time" "github.com/containerd/log" - "github.com/docker/docker/api/types" - buildtypes "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/api/types/system" - timetypes "github.com/docker/docker/api/types/time" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/daemon/server/httputils" "github.com/docker/docker/daemon/server/router/build" "github.com/docker/docker/pkg/ioutils" + "github.com/moby/moby/api/types" + buildtypes "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/registry" + "github.com/moby/moby/api/types/swarm" + "github.com/moby/moby/api/types/system" + timetypes "github.com/moby/moby/api/types/time" + "github.com/moby/moby/api/types/versions" "github.com/pkg/errors" "golang.org/x/sync/errgroup" ) diff --git a/daemon/server/router/volume/backend.go b/daemon/server/router/volume/backend.go index 50bd3e1271..9d6ffb3b37 100644 --- a/daemon/server/router/volume/backend.go +++ b/daemon/server/router/volume/backend.go @@ -3,9 +3,9 @@ package volume import ( "context" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/volume" "github.com/docker/docker/daemon/volume/service/opts" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/volume" ) // Backend is the methods that need to be implemented to provide diff --git a/daemon/server/router/volume/volume_routes.go b/daemon/server/router/volume/volume_routes.go index 989f970f82..293a242f85 100644 --- a/daemon/server/router/volume/volume_routes.go +++ b/daemon/server/router/volume/volume_routes.go @@ -8,12 +8,12 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/versions" - "github.com/docker/docker/api/types/volume" "github.com/docker/docker/daemon/server/httputils" "github.com/docker/docker/daemon/volume/service/opts" "github.com/docker/docker/errdefs" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/versions" + "github.com/moby/moby/api/types/volume" "github.com/pkg/errors" ) diff --git a/daemon/server/router/volume/volume_routes_test.go b/daemon/server/router/volume/volume_routes_test.go index 2f2e0ce4e4..a4ff9b559a 100644 --- a/daemon/server/router/volume/volume_routes_test.go +++ b/daemon/server/router/volume/volume_routes_test.go @@ -13,11 +13,11 @@ import ( "gotest.tools/v3/assert" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/volume" "github.com/docker/docker/daemon/server/httputils" "github.com/docker/docker/daemon/volume/service/opts" "github.com/docker/docker/errdefs" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/volume" ) func callGetVolume(v *volumeRouter, name string) (*httptest.ResponseRecorder, error) { diff --git a/daemon/server/server.go b/daemon/server/server.go index bb2dc296fb..cab4ddbe78 100644 --- a/daemon/server/server.go +++ b/daemon/server/server.go @@ -5,8 +5,6 @@ import ( "net/http" "github.com/containerd/log" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/daemon/server/httpstatus" "github.com/docker/docker/daemon/server/httputils" "github.com/docker/docker/daemon/server/middleware" @@ -14,6 +12,8 @@ import ( "github.com/docker/docker/dockerversion" "github.com/docker/docker/internal/otelutil" "github.com/gorilla/mux" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/versions" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" "go.opentelemetry.io/otel/baggage" ) diff --git a/daemon/server/server_test.go b/daemon/server/server_test.go index 37206e246d..7fe8f16664 100644 --- a/daemon/server/server_test.go +++ b/daemon/server/server_test.go @@ -7,10 +7,10 @@ import ( "strings" "testing" - "github.com/docker/docker/api" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/server/httputils" "github.com/docker/docker/daemon/server/middleware" + "github.com/moby/moby/api" ) func TestMiddlewares(t *testing.T) { diff --git a/daemon/start.go b/daemon/start.go index 1523b3dcaf..01963715f1 100644 --- a/daemon/start.go +++ b/daemon/start.go @@ -7,14 +7,14 @@ import ( containerd "github.com/containerd/containerd/v2/client" "github.com/containerd/containerd/v2/core/containers" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/container" mobyc8dstore "github.com/docker/docker/daemon/containerd" "github.com/docker/docker/daemon/internal/libcontainerd" "github.com/docker/docker/daemon/internal/metrics" "github.com/docker/docker/errdefs" "github.com/docker/docker/internal/otelutil" + "github.com/moby/moby/api/types/backend" + "github.com/moby/moby/api/types/events" "github.com/pkg/errors" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" diff --git a/daemon/stats.go b/daemon/stats.go index 3946d440a2..5003ae7804 100644 --- a/daemon/stats.go +++ b/daemon/stats.go @@ -8,10 +8,10 @@ import ( "time" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/container" "github.com/docker/docker/errdefs" + "github.com/moby/moby/api/types/backend" + containertypes "github.com/moby/moby/api/types/container" ) // ContainerStats writes information about the container to the stream diff --git a/daemon/stats/collector.go b/daemon/stats/collector.go index 5ab582406c..50e53b4826 100644 --- a/daemon/stats/collector.go +++ b/daemon/stats/collector.go @@ -4,8 +4,8 @@ import ( "sync" "time" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/container" + containertypes "github.com/moby/moby/api/types/container" "github.com/moby/pubsub" ) diff --git a/daemon/stats_unix.go b/daemon/stats_unix.go index 36732b46bf..df2d89cd2e 100644 --- a/daemon/stats_unix.go +++ b/daemon/stats_unix.go @@ -13,8 +13,8 @@ import ( statsV1 "github.com/containerd/cgroups/v3/cgroup1/stats" statsV2 "github.com/containerd/cgroups/v3/cgroup2/stats" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/container" + containertypes "github.com/moby/moby/api/types/container" "github.com/pkg/errors" ) diff --git a/daemon/stats_windows.go b/daemon/stats_windows.go index e2666e4f42..6e65a544cf 100644 --- a/daemon/stats_windows.go +++ b/daemon/stats_windows.go @@ -4,9 +4,9 @@ import ( "context" cerrdefs "github.com/containerd/errdefs" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/container" "github.com/docker/docker/internal/platform" + containertypes "github.com/moby/moby/api/types/container" ) func (daemon *Daemon) stats(c *container.Container) (*containertypes.StatsResponse, error) { diff --git a/daemon/stop.go b/daemon/stop.go index 56177acb73..442a66e454 100644 --- a/daemon/stop.go +++ b/daemon/stop.go @@ -5,10 +5,10 @@ import ( "time" "github.com/containerd/log" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/container" "github.com/docker/docker/errdefs" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" "github.com/moby/sys/signal" "github.com/pkg/errors" ) diff --git a/daemon/top_unix.go b/daemon/top_unix.go index d92313247f..b135153378 100644 --- a/daemon/top_unix.go +++ b/daemon/top_unix.go @@ -10,11 +10,11 @@ import ( "strconv" "strings" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" libcontainerdtypes "github.com/docker/docker/daemon/internal/libcontainerd/types" "github.com/docker/docker/errdefs" "github.com/docker/docker/internal/lazyregexp" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" "github.com/pkg/errors" ) diff --git a/daemon/top_windows.go b/daemon/top_windows.go index 3fc6b52a6b..8006deaccc 100644 --- a/daemon/top_windows.go +++ b/daemon/top_windows.go @@ -6,9 +6,9 @@ import ( "fmt" "time" - "github.com/docker/docker/api/types/container" libcontainerdtypes "github.com/docker/docker/daemon/internal/libcontainerd/types" "github.com/docker/go-units" + "github.com/moby/moby/api/types/container" ) // ContainerTop handles `docker top` client requests. diff --git a/daemon/unpause.go b/daemon/unpause.go index ee0aa2b7f0..357a5003e9 100644 --- a/daemon/unpause.go +++ b/daemon/unpause.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/containerd/log" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/container" + "github.com/moby/moby/api/types/events" ) // ContainerUnpause unpauses a container diff --git a/daemon/update.go b/daemon/update.go index 5909f52677..8122e43547 100644 --- a/daemon/update.go +++ b/daemon/update.go @@ -4,9 +4,9 @@ import ( "context" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/errdefs" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" "github.com/pkg/errors" ) diff --git a/daemon/update_linux.go b/daemon/update_linux.go index f580753c17..7abd2afe8e 100644 --- a/daemon/update_linux.go +++ b/daemon/update_linux.go @@ -3,8 +3,8 @@ package daemon import ( "time" - "github.com/docker/docker/api/types/container" libcontainerdtypes "github.com/docker/docker/daemon/internal/libcontainerd/types" + "github.com/moby/moby/api/types/container" "github.com/opencontainers/runtime-spec/specs-go" ) diff --git a/daemon/update_linux_test.go b/daemon/update_linux_test.go index 80706f4627..17d9d91c6f 100644 --- a/daemon/update_linux_test.go +++ b/daemon/update_linux_test.go @@ -3,7 +3,7 @@ package daemon import ( "testing" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" ) func TestToContainerdResources_Defaults(t *testing.T) { diff --git a/daemon/update_windows.go b/daemon/update_windows.go index 8410556545..e14a0d0892 100644 --- a/daemon/update_windows.go +++ b/daemon/update_windows.go @@ -1,8 +1,8 @@ package daemon import ( - "github.com/docker/docker/api/types/container" libcontainerdtypes "github.com/docker/docker/daemon/internal/libcontainerd/types" + "github.com/moby/moby/api/types/container" ) func toContainerdResources(resources container.Resources) *libcontainerdtypes.Resources { diff --git a/daemon/volume/mounts/lcow_parser.go b/daemon/volume/mounts/lcow_parser.go index 8323436adc..7413b256f3 100644 --- a/daemon/volume/mounts/lcow_parser.go +++ b/daemon/volume/mounts/lcow_parser.go @@ -6,8 +6,8 @@ import ( "path" "strings" - "github.com/docker/docker/api/types/mount" "github.com/docker/docker/internal/lazyregexp" + "github.com/moby/moby/api/types/mount" ) // NewLCOWParser creates a parser with Linux Containers on Windows semantics. diff --git a/daemon/volume/mounts/lcow_parser_test.go b/daemon/volume/mounts/lcow_parser_test.go index e961631a1f..2429c78aac 100644 --- a/daemon/volume/mounts/lcow_parser_test.go +++ b/daemon/volume/mounts/lcow_parser_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/mount" "github.com/google/go-cmp/cmp/cmpopts" + "github.com/moby/moby/api/types/mount" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/daemon/volume/mounts/linux_parser.go b/daemon/volume/mounts/linux_parser.go index de2fa4a189..1f2b322a34 100644 --- a/daemon/volume/mounts/linux_parser.go +++ b/daemon/volume/mounts/linux_parser.go @@ -7,8 +7,8 @@ import ( "path/filepath" "strings" - "github.com/docker/docker/api/types/mount" "github.com/docker/docker/daemon/volume" + "github.com/moby/moby/api/types/mount" ) // NewLinuxParser creates a parser with Linux semantics. diff --git a/daemon/volume/mounts/linux_parser_test.go b/daemon/volume/mounts/linux_parser_test.go index 58ea15f82d..4b0c9aaa15 100644 --- a/daemon/volume/mounts/linux_parser_test.go +++ b/daemon/volume/mounts/linux_parser_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/mount" "github.com/google/go-cmp/cmp/cmpopts" + "github.com/moby/moby/api/types/mount" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/daemon/volume/mounts/mounts.go b/daemon/volume/mounts/mounts.go index 276e815133..599f448c07 100644 --- a/daemon/volume/mounts/mounts.go +++ b/daemon/volume/mounts/mounts.go @@ -7,11 +7,11 @@ import ( "syscall" "github.com/containerd/log" - mounttypes "github.com/docker/docker/api/types/mount" "github.com/docker/docker/daemon/volume" "github.com/docker/docker/daemon/volume/safepath" "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/stringid" + mounttypes "github.com/moby/moby/api/types/mount" "github.com/moby/sys/user" "github.com/opencontainers/selinux/go-selinux/label" "github.com/pkg/errors" diff --git a/daemon/volume/mounts/parser.go b/daemon/volume/mounts/parser.go index 4f4c141b14..aec49548e9 100644 --- a/daemon/volume/mounts/parser.go +++ b/daemon/volume/mounts/parser.go @@ -4,7 +4,7 @@ import ( "errors" "runtime" - "github.com/docker/docker/api/types/mount" + "github.com/moby/moby/api/types/mount" ) // ErrVolumeTargetIsRoot is returned when the target destination is root. diff --git a/daemon/volume/mounts/parser_test.go b/daemon/volume/mounts/parser_test.go index 87a0f0060a..72aa638111 100644 --- a/daemon/volume/mounts/parser_test.go +++ b/daemon/volume/mounts/parser_test.go @@ -5,7 +5,7 @@ import ( "runtime" "testing" - "github.com/docker/docker/api/types/mount" + "github.com/moby/moby/api/types/mount" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/daemon/volume/mounts/validate.go b/daemon/volume/mounts/validate.go index 96b4aac3f6..51aaed9d6c 100644 --- a/daemon/volume/mounts/validate.go +++ b/daemon/volume/mounts/validate.go @@ -3,7 +3,7 @@ package mounts import ( "fmt" - "github.com/docker/docker/api/types/mount" + "github.com/moby/moby/api/types/mount" "github.com/pkg/errors" ) diff --git a/daemon/volume/mounts/validate_test.go b/daemon/volume/mounts/validate_test.go index 7e97120b6b..0902ef57a8 100644 --- a/daemon/volume/mounts/validate_test.go +++ b/daemon/volume/mounts/validate_test.go @@ -5,7 +5,7 @@ import ( "runtime" "testing" - "github.com/docker/docker/api/types/mount" + "github.com/moby/moby/api/types/mount" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/daemon/volume/mounts/windows_parser.go b/daemon/volume/mounts/windows_parser.go index 0eb2fd8ed8..ac5c525e18 100644 --- a/daemon/volume/mounts/windows_parser.go +++ b/daemon/volume/mounts/windows_parser.go @@ -7,8 +7,8 @@ import ( "path/filepath" "strings" - "github.com/docker/docker/api/types/mount" "github.com/docker/docker/internal/lazyregexp" + "github.com/moby/moby/api/types/mount" ) // NewWindowsParser creates a parser with Windows semantics. diff --git a/daemon/volume/mounts/windows_parser_test.go b/daemon/volume/mounts/windows_parser_test.go index e1f49619ec..43e4a83991 100644 --- a/daemon/volume/mounts/windows_parser_test.go +++ b/daemon/volume/mounts/windows_parser_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/mount" "github.com/google/go-cmp/cmp/cmpopts" + "github.com/moby/moby/api/types/mount" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/daemon/volume/service/by.go b/daemon/volume/service/by.go index 83dcb7c1c1..9d38cb457b 100644 --- a/daemon/volume/service/by.go +++ b/daemon/volume/service/by.go @@ -1,8 +1,8 @@ package service import ( - "github.com/docker/docker/api/types/filters" "github.com/docker/docker/daemon/volume" + "github.com/moby/moby/api/types/filters" ) // By is an interface which is used to implement filtering on volumes. diff --git a/daemon/volume/service/convert.go b/daemon/volume/service/convert.go index 9452b1a08b..c21daca138 100644 --- a/daemon/volume/service/convert.go +++ b/daemon/volume/service/convert.go @@ -7,11 +7,11 @@ import ( "time" "github.com/containerd/log" - "github.com/docker/docker/api/types/filters" - volumetypes "github.com/docker/docker/api/types/volume" "github.com/docker/docker/daemon/internal/directory" "github.com/docker/docker/daemon/volume" "github.com/docker/docker/errdefs" + "github.com/moby/moby/api/types/filters" + volumetypes "github.com/moby/moby/api/types/volume" ) // convertOpts are used to pass options to `volumeToAPI` diff --git a/daemon/volume/service/convert_test.go b/daemon/volume/service/convert_test.go index c90ef7334e..9ec7d2bcc4 100644 --- a/daemon/volume/service/convert_test.go +++ b/daemon/volume/service/convert_test.go @@ -3,7 +3,7 @@ package service import ( "testing" - "github.com/docker/docker/api/types/filters" + "github.com/moby/moby/api/types/filters" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/daemon/volume/service/service.go b/daemon/volume/service/service.go index 37467fb31f..7d119df042 100644 --- a/daemon/volume/service/service.go +++ b/daemon/volume/service/service.go @@ -6,9 +6,6 @@ import ( "sync/atomic" "github.com/containerd/log" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" - volumetypes "github.com/docker/docker/api/types/volume" "github.com/docker/docker/daemon/internal/directory" "github.com/docker/docker/daemon/volume" "github.com/docker/docker/daemon/volume/drivers" @@ -17,6 +14,9 @@ import ( "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/plugingetter" "github.com/docker/docker/pkg/stringid" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/filters" + volumetypes "github.com/moby/moby/api/types/volume" "github.com/pkg/errors" ) diff --git a/daemon/volume/service/service_test.go b/daemon/volume/service/service_test.go index acbfa56113..94ca92f9bf 100644 --- a/daemon/volume/service/service_test.go +++ b/daemon/volume/service/service_test.go @@ -5,12 +5,12 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" "github.com/docker/docker/daemon/volume" volumedrivers "github.com/docker/docker/daemon/volume/drivers" "github.com/docker/docker/daemon/volume/service/opts" "github.com/docker/docker/daemon/volume/testutils" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/filters" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/daemon/volume/service/store.go b/daemon/volume/service/store.go index f06f998950..7e290cdd23 100644 --- a/daemon/volume/service/store.go +++ b/daemon/volume/service/store.go @@ -10,13 +10,13 @@ import ( "time" "github.com/containerd/log" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/daemon/volume" "github.com/docker/docker/daemon/volume/drivers" volumemounts "github.com/docker/docker/daemon/volume/mounts" "github.com/docker/docker/daemon/volume/service/opts" "github.com/docker/docker/errdefs" "github.com/moby/locker" + "github.com/moby/moby/api/types/events" "github.com/pkg/errors" bolt "go.etcd.io/bbolt" ) diff --git a/daemon/volumes.go b/daemon/volumes.go index 361217fd86..2e82b11272 100644 --- a/daemon/volumes.go +++ b/daemon/volumes.go @@ -10,10 +10,6 @@ import ( "time" "github.com/containerd/log" - "github.com/docker/docker/api/types/backend" - containertypes "github.com/docker/docker/api/types/container" - mounttypes "github.com/docker/docker/api/types/mount" - volumetypes "github.com/docker/docker/api/types/volume" "github.com/docker/docker/daemon/container" "github.com/docker/docker/daemon/volume" volumemounts "github.com/docker/docker/daemon/volume/mounts" @@ -21,6 +17,10 @@ import ( volumeopts "github.com/docker/docker/daemon/volume/service/opts" "github.com/docker/docker/errdefs" "github.com/docker/docker/layer" + "github.com/moby/moby/api/types/backend" + containertypes "github.com/moby/moby/api/types/container" + mounttypes "github.com/moby/moby/api/types/mount" + volumetypes "github.com/moby/moby/api/types/volume" "github.com/pkg/errors" ) diff --git a/daemon/volumes_linux.go b/daemon/volumes_linux.go index 6552f5e83d..fd4c9c3717 100644 --- a/daemon/volumes_linux.go +++ b/daemon/volumes_linux.go @@ -3,8 +3,8 @@ package daemon import ( "strings" - "github.com/docker/docker/api/types/mount" "github.com/docker/docker/errdefs" + "github.com/moby/moby/api/types/mount" "github.com/pkg/errors" ) diff --git a/daemon/volumes_linux_test.go b/daemon/volumes_linux_test.go index 3abff3e454..991163a730 100644 --- a/daemon/volumes_linux_test.go +++ b/daemon/volumes_linux_test.go @@ -4,7 +4,7 @@ import ( "path/filepath" "testing" - "github.com/docker/docker/api/types/mount" + "github.com/moby/moby/api/types/mount" ) func TestBindDaemonRoot(t *testing.T) { diff --git a/daemon/volumes_unix.go b/daemon/volumes_unix.go index a90988d9b4..82ff2a059a 100644 --- a/daemon/volumes_unix.go +++ b/daemon/volumes_unix.go @@ -10,12 +10,12 @@ import ( "strings" "github.com/containerd/log" - "github.com/docker/docker/api/types/events" - mounttypes "github.com/docker/docker/api/types/mount" "github.com/docker/docker/daemon/container" volumemounts "github.com/docker/docker/daemon/volume/mounts" "github.com/docker/docker/internal/cleanups" "github.com/docker/docker/pkg/idtools" + "github.com/moby/moby/api/types/events" + mounttypes "github.com/moby/moby/api/types/mount" "github.com/pkg/errors" ) diff --git a/daemon/volumes_windows.go b/daemon/volumes_windows.go index 5aafed5193..2df79f03c1 100644 --- a/daemon/volumes_windows.go +++ b/daemon/volumes_windows.go @@ -4,11 +4,11 @@ import ( "context" "github.com/containerd/log" - "github.com/docker/docker/api/types/mount" "github.com/docker/docker/daemon/container" volumemounts "github.com/docker/docker/daemon/volume/mounts" "github.com/docker/docker/internal/cleanups" "github.com/docker/docker/pkg/idtools" + "github.com/moby/moby/api/types/mount" ) // setupMounts configures the mount points for a container by appending each diff --git a/daemon/wait.go b/daemon/wait.go index adb14b05d0..dada0f179b 100644 --- a/daemon/wait.go +++ b/daemon/wait.go @@ -3,7 +3,7 @@ package daemon import ( "context" - containertypes "github.com/docker/docker/api/types/container" + containertypes "github.com/moby/moby/api/types/container" ) // ContainerWait waits until the given container is in a certain state diff --git a/distribution/config.go b/distribution/config.go index e71495897e..066a5df73c 100644 --- a/distribution/config.go +++ b/distribution/config.go @@ -9,8 +9,6 @@ import ( "github.com/distribution/reference" "github.com/docker/distribution" "github.com/docker/distribution/manifest/schema2" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/registry" "github.com/docker/docker/distribution/metadata" "github.com/docker/docker/distribution/xfer" "github.com/docker/docker/image" @@ -18,6 +16,8 @@ import ( "github.com/docker/docker/pkg/progress" refstore "github.com/docker/docker/reference" registrypkg "github.com/docker/docker/registry" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/registry" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" diff --git a/distribution/metadata/v2_metadata_service.go b/distribution/metadata/v2_metadata_service.go index f8b0bd234c..075e3fbcc2 100644 --- a/distribution/metadata/v2_metadata_service.go +++ b/distribution/metadata/v2_metadata_service.go @@ -7,8 +7,8 @@ import ( "encoding/json" "errors" - "github.com/docker/docker/api/types/registry" "github.com/docker/docker/layer" + "github.com/moby/moby/api/types/registry" "github.com/opencontainers/go-digest" ) diff --git a/distribution/pull.go b/distribution/pull.go index 46b7641def..1826b68733 100644 --- a/distribution/pull.go +++ b/distribution/pull.go @@ -6,9 +6,9 @@ import ( "github.com/containerd/log" "github.com/distribution/reference" - "github.com/docker/docker/api/types/events" refstore "github.com/docker/docker/reference" "github.com/docker/docker/registry" + "github.com/moby/moby/api/types/events" "github.com/opencontainers/go-digest" "github.com/pkg/errors" ) diff --git a/distribution/pull_v2_test.go b/distribution/pull_v2_test.go index 447e73f164..4968d94a48 100644 --- a/distribution/pull_v2_test.go +++ b/distribution/pull_v2_test.go @@ -11,9 +11,9 @@ import ( "testing" "github.com/distribution/reference" - registrytypes "github.com/docker/docker/api/types/registry" "github.com/docker/docker/image" "github.com/docker/docker/registry" + registrytypes "github.com/moby/moby/api/types/registry" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" diff --git a/distribution/push.go b/distribution/push.go index 1d5b4b2778..f9d3320206 100644 --- a/distribution/push.go +++ b/distribution/push.go @@ -10,8 +10,8 @@ import ( "github.com/containerd/log" "github.com/distribution/reference" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/pkg/progress" + "github.com/moby/moby/api/types/events" ) const compressionBufSize = 32768 diff --git a/distribution/push_v2.go b/distribution/push_v2.go index b62c1dffb0..7b1219c53f 100644 --- a/distribution/push_v2.go +++ b/distribution/push_v2.go @@ -14,7 +14,6 @@ import ( "github.com/docker/distribution/manifest/schema2" "github.com/docker/distribution/registry/api/errcode" "github.com/docker/distribution/registry/client" - apitypes "github.com/docker/docker/api/types" "github.com/docker/docker/distribution/metadata" "github.com/docker/docker/distribution/xfer" "github.com/docker/docker/layer" @@ -22,6 +21,7 @@ import ( "github.com/docker/docker/pkg/progress" "github.com/docker/docker/pkg/stringid" "github.com/docker/docker/registry" + apitypes "github.com/moby/moby/api/types" "github.com/opencontainers/go-digest" "github.com/pkg/errors" ) diff --git a/distribution/push_v2_test.go b/distribution/push_v2_test.go index 985be9a1fc..592c4202b8 100644 --- a/distribution/push_v2_test.go +++ b/distribution/push_v2_test.go @@ -10,12 +10,12 @@ import ( "github.com/docker/distribution" "github.com/docker/distribution/manifest/schema2" "github.com/docker/distribution/registry/api/errcode" - "github.com/docker/docker/api/types/registry" "github.com/docker/docker/distribution/metadata" "github.com/docker/docker/layer" "github.com/docker/docker/pkg/progress" refstore "github.com/docker/docker/reference" registrypkg "github.com/docker/docker/registry" + "github.com/moby/moby/api/types/registry" "github.com/opencontainers/go-digest" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/distribution/registry.go b/distribution/registry.go index ef75136bdc..9a81627539 100644 --- a/distribution/registry.go +++ b/distribution/registry.go @@ -12,9 +12,9 @@ import ( "github.com/docker/distribution/manifest/schema2" "github.com/docker/distribution/registry/client" "github.com/docker/distribution/registry/client/auth" - registrytypes "github.com/docker/docker/api/types/registry" "github.com/docker/docker/dockerversion" "github.com/docker/docker/registry" + registrytypes "github.com/moby/moby/api/types/registry" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/distribution/registry_unit_test.go b/distribution/registry_unit_test.go index a3a6aa160e..5191cfec4c 100644 --- a/distribution/registry_unit_test.go +++ b/distribution/registry_unit_test.go @@ -9,8 +9,8 @@ import ( "testing" "github.com/distribution/reference" - "github.com/docker/docker/api/types/registry" registrypkg "github.com/docker/docker/registry" + "github.com/moby/moby/api/types/registry" "gotest.tools/v3/assert" ) diff --git a/image/cache/cache.go b/image/cache/cache.go index a99af07479..dc8f548ad2 100644 --- a/image/cache/cache.go +++ b/image/cache/cache.go @@ -7,11 +7,11 @@ import ( "strings" "github.com/containerd/log" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/builder" "github.com/docker/docker/dockerversion" "github.com/docker/docker/image" "github.com/docker/docker/layer" + containertypes "github.com/moby/moby/api/types/container" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" ) diff --git a/image/cache/compare.go b/image/cache/compare.go index 29a3b0fc86..39c849490f 100644 --- a/image/cache/compare.go +++ b/image/cache/compare.go @@ -4,7 +4,7 @@ import ( "strings" "github.com/containerd/platforms" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/image/cache/compare_test.go b/image/cache/compare_test.go index dafb9604a0..f046b9bc63 100644 --- a/image/cache/compare_test.go +++ b/image/cache/compare_test.go @@ -4,8 +4,8 @@ import ( "runtime" "testing" - "github.com/docker/docker/api/types/container" "github.com/docker/go-connections/nat" + "github.com/moby/moby/api/types/container" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/image/image.go b/image/image.go index 7cc3f8c934..59e46a999f 100644 --- a/image/image.go +++ b/image/image.go @@ -9,9 +9,9 @@ import ( "strings" "time" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/dockerversion" "github.com/docker/docker/layer" + "github.com/moby/moby/api/types/container" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/image/image_test.go b/image/image_test.go index 8ebf6f0354..e729a70bdb 100644 --- a/image/image_test.go +++ b/image/image_test.go @@ -7,9 +7,9 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/layer" "github.com/google/go-cmp/cmp" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/image/tarexport/load.go b/image/tarexport/load.go index 6c5d98786b..ed63dc6ee9 100644 --- a/image/tarexport/load.go +++ b/image/tarexport/load.go @@ -15,7 +15,6 @@ import ( "github.com/containerd/log" "github.com/distribution/reference" "github.com/docker/distribution" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/image" "github.com/docker/docker/internal/ioutils" "github.com/docker/docker/layer" @@ -24,6 +23,7 @@ import ( "github.com/docker/docker/pkg/stringid" "github.com/moby/go-archive/chrootarchive" "github.com/moby/go-archive/compression" + "github.com/moby/moby/api/types/events" "github.com/moby/sys/sequential" "github.com/moby/sys/symlink" "github.com/opencontainers/go-digest" diff --git a/image/tarexport/save.go b/image/tarexport/save.go index f863925a63..2a4d92c4e4 100644 --- a/image/tarexport/save.go +++ b/image/tarexport/save.go @@ -16,13 +16,13 @@ import ( "github.com/containerd/platforms" "github.com/distribution/reference" "github.com/docker/distribution" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/image" v1 "github.com/docker/docker/image/v1" "github.com/docker/docker/internal/ioutils" "github.com/docker/docker/layer" "github.com/docker/docker/pkg/system" "github.com/moby/go-archive" + "github.com/moby/moby/api/types/events" "github.com/moby/sys/sequential" "github.com/opencontainers/go-digest" "github.com/opencontainers/image-spec/specs-go" diff --git a/image/tarexport/tarexport.go b/image/tarexport/tarexport.go index 1b224cdb1c..a2e30ff8ea 100644 --- a/image/tarexport/tarexport.go +++ b/image/tarexport/tarexport.go @@ -5,10 +5,10 @@ import ( "github.com/containerd/platforms" "github.com/docker/distribution" - "github.com/docker/docker/api/types/events" "github.com/docker/docker/image" "github.com/docker/docker/layer" refstore "github.com/docker/docker/reference" + "github.com/moby/moby/api/types/events" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/integration-cli/daemon/daemon_swarm.go b/integration-cli/daemon/daemon_swarm.go index 50908a9bd9..5547ac0212 100644 --- a/integration-cli/daemon/daemon_swarm.go +++ b/integration-cli/daemon/daemon_swarm.go @@ -8,8 +8,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" ) diff --git a/integration-cli/docker_api_attach_test.go b/integration-cli/docker_api_attach_test.go index ee1f582dc6..c35831025f 100644 --- a/integration-cli/docker_api_attach_test.go +++ b/integration-cli/docker_api_attach_test.go @@ -10,14 +10,14 @@ import ( "testing" "time" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/pkg/stdcopy" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/request" "github.com/docker/go-connections/sockets" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/container" "github.com/pkg/errors" "golang.org/x/net/websocket" "gotest.tools/v3/assert" diff --git a/integration-cli/docker_api_build_test.go b/integration-cli/docker_api_build_test.go index e573a942a8..9eb6e54865 100644 --- a/integration-cli/docker_api_build_test.go +++ b/integration-cli/docker_api_build_test.go @@ -11,12 +11,12 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/image" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/fakecontext" "github.com/docker/docker/testutil/fakegit" "github.com/docker/docker/testutil/fakestorage" "github.com/docker/docker/testutil/request" + "github.com/moby/moby/api/types/image" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/integration-cli/docker_api_containers_test.go b/integration-cli/docker_api_containers_test.go index ec4f08201d..875d2dbdff 100644 --- a/integration-cli/docker_api_containers_test.go +++ b/integration-cli/docker_api_containers_test.go @@ -18,9 +18,6 @@ import ( "time" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/mount" - "github.com/docker/docker/api/types/network" "github.com/docker/docker/client" dconfig "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/volume" @@ -30,6 +27,9 @@ import ( "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/request" "github.com/docker/go-connections/nat" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/mount" + "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration-cli/docker_api_containers_windows_test.go b/integration-cli/docker_api_containers_windows_test.go index ae326c6541..5b2e79630c 100644 --- a/integration-cli/docker_api_containers_windows_test.go +++ b/integration-cli/docker_api_containers_windows_test.go @@ -10,9 +10,9 @@ import ( "testing" "github.com/Microsoft/go-winio" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/mount" "github.com/docker/docker/testutil" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/mount" "github.com/pkg/errors" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/integration-cli/docker_api_exec_test.go b/integration-cli/docker_api_exec_test.go index 21093d83f1..5378d887f6 100644 --- a/integration-cli/docker_api_exec_test.go +++ b/integration-cli/docker_api_exec_test.go @@ -12,12 +12,12 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" "github.com/docker/docker/integration-cli/checker" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/request" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration-cli/docker_api_images_test.go b/integration-cli/docker_api_images_test.go index bd57122943..465d6ee34e 100644 --- a/integration-cli/docker_api_images_test.go +++ b/integration-cli/docker_api_images_test.go @@ -6,12 +6,12 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/image" "github.com/docker/docker/client" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/integration-cli/cli/build" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/request" + "github.com/moby/moby/api/types/image" "gotest.tools/v3/assert" ) diff --git a/integration-cli/docker_api_inspect_test.go b/integration-cli/docker_api_inspect_test.go index ca78877046..09b23b1f6e 100644 --- a/integration-cli/docker_api_inspect_test.go +++ b/integration-cli/docker_api_inspect_test.go @@ -5,10 +5,10 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/testutil" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/integration-cli/docker_api_logs_test.go b/integration-cli/docker_api_logs_test.go index 8d481ef938..d7c5547b1f 100644 --- a/integration-cli/docker_api_logs_test.go +++ b/integration-cli/docker_api_logs_test.go @@ -11,12 +11,12 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/pkg/stdcopy" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/request" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" ) diff --git a/integration-cli/docker_api_network_test.go b/integration-cli/docker_api_network_test.go index ba343d1fd8..2bc54aa792 100644 --- a/integration-cli/docker_api_network_test.go +++ b/integration-cli/docker_api_network_test.go @@ -9,11 +9,11 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/network" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/request" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" ) diff --git a/integration-cli/docker_api_stats_test.go b/integration-cli/docker_api_stats_test.go index 5e23bdeecc..22cea0669c 100644 --- a/integration-cli/docker_api_stats_test.go +++ b/integration-cli/docker_api_stats_test.go @@ -11,12 +11,12 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/system" "github.com/docker/docker/client" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/request" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/system" "gotest.tools/v3/assert" "gotest.tools/v3/skip" ) diff --git a/integration-cli/docker_api_swarm_node_test.go b/integration-cli/docker_api_swarm_node_test.go index dc9f5c712d..c5420e231e 100644 --- a/integration-cli/docker_api_swarm_node_test.go +++ b/integration-cli/docker_api_swarm_node_test.go @@ -7,10 +7,10 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/integration-cli/checker" "github.com/docker/docker/integration-cli/daemon" "github.com/docker/docker/testutil" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" "gotest.tools/v3/poll" ) diff --git a/integration-cli/docker_api_swarm_service_test.go b/integration-cli/docker_api_swarm_service_test.go index 506d16d722..955f41b503 100644 --- a/integration-cli/docker_api_swarm_service_test.go +++ b/integration-cli/docker_api_swarm_service_test.go @@ -9,13 +9,13 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/integration-cli/checker" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/integration-cli/cli/build" "github.com/docker/docker/integration-cli/daemon" "github.com/docker/docker/testutil" testdaemon "github.com/docker/docker/testutil/daemon" + "github.com/moby/moby/api/types/swarm" "golang.org/x/sys/unix" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/integration-cli/docker_api_swarm_test.go b/integration-cli/docker_api_swarm_test.go index 8d613f3e2d..206521cb40 100644 --- a/integration-cli/docker_api_swarm_test.go +++ b/integration-cli/docker_api_swarm_test.go @@ -19,14 +19,14 @@ import ( "github.com/cloudflare/cfssl/helpers" "github.com/cloudflare/cfssl/initca" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/integration-cli/checker" "github.com/docker/docker/integration-cli/daemon" "github.com/docker/docker/testutil" testdaemon "github.com/docker/docker/testutil/daemon" "github.com/docker/docker/testutil/request" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" + "github.com/moby/moby/api/types/swarm" "github.com/moby/swarmkit/v2/ca" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/integration-cli/docker_api_test.go b/integration-cli/docker_api_test.go index 4c55487c7a..60785bc97b 100644 --- a/integration-cli/docker_api_test.go +++ b/integration-cli/docker_api_test.go @@ -10,9 +10,9 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/request" + "github.com/moby/moby/api/types/versions" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/integration-cli/docker_cli_build_test.go b/integration-cli/docker_cli_build_test.go index 7a03d27edf..936480ba0c 100644 --- a/integration-cli/docker_cli_build_test.go +++ b/integration-cli/docker_cli_build_test.go @@ -18,7 +18,6 @@ import ( "text/template" "time" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/integration-cli/cli/build" "github.com/docker/docker/testutil" @@ -28,6 +27,7 @@ import ( "github.com/moby/buildkit/frontend/dockerfile/command" "github.com/moby/go-archive" "github.com/moby/go-archive/compression" + "github.com/moby/moby/api/types/versions" "github.com/opencontainers/go-digest" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/integration-cli/docker_cli_build_unix_test.go b/integration-cli/docker_cli_build_unix_test.go index 3f7a9d058c..5beb9b09a2 100644 --- a/integration-cli/docker_cli_build_unix_test.go +++ b/integration-cli/docker_cli_build_unix_test.go @@ -15,10 +15,10 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/integration-cli/cli/build" "github.com/docker/docker/testutil/fakecontext" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" "gotest.tools/v3/icmd" ) diff --git a/integration-cli/docker_cli_by_digest_test.go b/integration-cli/docker_cli_by_digest_test.go index 8a517d94c6..d46527cc36 100644 --- a/integration-cli/docker_cli_by_digest_test.go +++ b/integration-cli/docker_cli_by_digest_test.go @@ -9,10 +9,10 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/image" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/integration-cli/cli/build" "github.com/docker/docker/internal/lazyregexp" + "github.com/moby/moby/api/types/image" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" diff --git a/integration-cli/docker_cli_daemon_test.go b/integration-cli/docker_cli_daemon_test.go index 6eed1e3b61..0d0ed75eb6 100644 --- a/integration-cli/docker_cli_daemon_test.go +++ b/integration-cli/docker_cli_daemon_test.go @@ -25,7 +25,6 @@ import ( "github.com/cloudflare/cfssl/helpers" "github.com/creack/pty" - "github.com/docker/docker/api/types" "github.com/docker/docker/daemon/pkg/opts" "github.com/docker/docker/integration-cli/checker" "github.com/docker/docker/integration-cli/cli" @@ -33,6 +32,7 @@ import ( "github.com/docker/docker/integration-cli/daemon" "github.com/docker/docker/testutil" testdaemon "github.com/docker/docker/testutil/daemon" + "github.com/moby/moby/api/types" "github.com/moby/sys/mount" "golang.org/x/sys/unix" "gotest.tools/v3/assert" diff --git a/integration-cli/docker_cli_events_test.go b/integration-cli/docker_cli_events_test.go index 875bf6c061..f6946f6d84 100644 --- a/integration-cli/docker_cli_events_test.go +++ b/integration-cli/docker_cli_events_test.go @@ -13,13 +13,13 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/container" - eventtypes "github.com/docker/docker/api/types/events" "github.com/docker/docker/client" eventstestutils "github.com/docker/docker/daemon/events/testutils" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/integration-cli/cli/build" "github.com/docker/docker/testutil" + "github.com/moby/moby/api/types/container" + eventtypes "github.com/moby/moby/api/types/events" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/icmd" diff --git a/integration-cli/docker_cli_external_volume_driver_test.go b/integration-cli/docker_cli_external_volume_driver_test.go index 965cbb388c..131741c626 100644 --- a/integration-cli/docker_cli_external_volume_driver_test.go +++ b/integration-cli/docker_cli_external_volume_driver_test.go @@ -15,8 +15,6 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/container" - volumetypes "github.com/docker/docker/api/types/volume" "github.com/docker/docker/daemon/volume" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/integration-cli/daemon" @@ -24,6 +22,8 @@ import ( "github.com/docker/docker/pkg/stringid" "github.com/docker/docker/testutil" testdaemon "github.com/docker/docker/testutil/daemon" + "github.com/moby/moby/api/types/container" + volumetypes "github.com/moby/moby/api/types/volume" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/integration-cli/docker_cli_health_test.go b/integration-cli/docker_cli_health_test.go index 87358d71d9..dacfc6c720 100644 --- a/integration-cli/docker_cli_health_test.go +++ b/integration-cli/docker_cli_health_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/integration-cli/cli/build" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" ) diff --git a/integration-cli/docker_cli_inspect_test.go b/integration-cli/docker_cli_inspect_test.go index 2a3758a5cb..b0864a7389 100644 --- a/integration-cli/docker_cli_inspect_test.go +++ b/integration-cli/docker_cli_inspect_test.go @@ -10,10 +10,10 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/image" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/internal/testutils/specialimage" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/image" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/icmd" diff --git a/integration-cli/docker_cli_network_unix_test.go b/integration-cli/docker_cli_network_unix_test.go index 198fc28a02..5d794b37d2 100644 --- a/integration-cli/docker_cli_network_unix_test.go +++ b/integration-cli/docker_cli_network_unix_test.go @@ -14,8 +14,6 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" "github.com/docker/docker/daemon/libnetwork/driverapi" remoteapi "github.com/docker/docker/daemon/libnetwork/drivers/remote/api" "github.com/docker/docker/daemon/libnetwork/ipamapi" @@ -28,6 +26,8 @@ import ( "github.com/docker/docker/pkg/stringid" "github.com/docker/docker/testutil" testdaemon "github.com/docker/docker/testutil/daemon" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" "github.com/vishvananda/netlink" "golang.org/x/sys/unix" "gotest.tools/v3/assert" diff --git a/integration-cli/docker_cli_plugins_test.go b/integration-cli/docker_cli_plugins_test.go index 8ebf53e0f0..53246e4fca 100644 --- a/integration-cli/docker_cli_plugins_test.go +++ b/integration-cli/docker_cli_plugins_test.go @@ -12,11 +12,11 @@ import ( "testing" "time" - "github.com/docker/docker/api/types" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/integration-cli/daemon" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/fixtures/plugin" + "github.com/moby/moby/api/types" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration-cli/docker_cli_push_test.go b/integration-cli/docker_cli_push_test.go index 4bc3011e29..2c85e800b3 100644 --- a/integration-cli/docker_cli_push_test.go +++ b/integration-cli/docker_cli_push_test.go @@ -12,9 +12,9 @@ import ( "testing" "github.com/distribution/reference" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/integration-cli/cli/build" + "github.com/moby/moby/api/types/versions" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/icmd" diff --git a/integration-cli/docker_cli_save_load_test.go b/integration-cli/docker_cli_save_load_test.go index 5371b675b7..8d8365260c 100644 --- a/integration-cli/docker_cli_save_load_test.go +++ b/integration-cli/docker_cli_save_load_test.go @@ -10,10 +10,10 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/image" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/integration-cli/cli/build" "github.com/docker/docker/internal/testutils/specialimage" + "github.com/moby/moby/api/types/image" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/icmd" diff --git a/integration-cli/docker_cli_service_create_test.go b/integration-cli/docker_cli_service_create_test.go index 927127857a..f483cd7710 100644 --- a/integration-cli/docker_cli_service_create_test.go +++ b/integration-cli/docker_cli_service_create_test.go @@ -9,11 +9,11 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/mount" - "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/integration-cli/checker" "github.com/docker/docker/testutil" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/mount" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration-cli/docker_cli_service_health_test.go b/integration-cli/docker_cli_service_health_test.go index 6b5025de4a..a1e2af8c6e 100644 --- a/integration-cli/docker_cli_service_health_test.go +++ b/integration-cli/docker_cli_service_health_test.go @@ -7,12 +7,12 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/daemon/cluster/executor/container" "github.com/docker/docker/integration-cli/checker" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/integration-cli/cli/build" "github.com/docker/docker/testutil" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" "gotest.tools/v3/icmd" "gotest.tools/v3/poll" diff --git a/integration-cli/docker_cli_swarm_test.go b/integration-cli/docker_cli_swarm_test.go index 7c2ccac786..e04d7b329c 100644 --- a/integration-cli/docker_cli_swarm_test.go +++ b/integration-cli/docker_cli_swarm_test.go @@ -19,8 +19,6 @@ import ( "time" "github.com/cloudflare/cfssl/helpers" - "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/daemon/libnetwork/driverapi" "github.com/docker/docker/daemon/libnetwork/ipamapi" remoteipam "github.com/docker/docker/daemon/libnetwork/ipams/remote/api" @@ -31,6 +29,8 @@ import ( "github.com/docker/docker/pkg/plugins" "github.com/docker/docker/testutil" testdaemon "github.com/docker/docker/testutil/daemon" + "github.com/moby/moby/api/types/swarm" + "github.com/moby/moby/api/types/versions" "github.com/moby/swarmkit/v2/ca/keyutils" "github.com/vishvananda/netlink" "gotest.tools/v3/assert" diff --git a/integration-cli/docker_cli_swarm_unix_test.go b/integration-cli/docker_cli_swarm_unix_test.go index 2e8f2aad29..00543294ce 100644 --- a/integration-cli/docker_cli_swarm_unix_test.go +++ b/integration-cli/docker_cli_swarm_unix_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/integration-cli/checker" "github.com/docker/docker/testutil" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" "gotest.tools/v3/poll" ) diff --git a/integration-cli/docker_cli_update_unix_test.go b/integration-cli/docker_cli_update_unix_test.go index 06e019784d..b619078421 100644 --- a/integration-cli/docker_cli_update_unix_test.go +++ b/integration-cli/docker_cli_update_unix_test.go @@ -12,11 +12,11 @@ import ( "time" "github.com/creack/pty" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/request" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration-cli/docker_cli_volume_test.go b/integration-cli/docker_cli_volume_test.go index 0a761eeb3a..447b3bce32 100644 --- a/integration-cli/docker_cli_volume_test.go +++ b/integration-cli/docker_cli_volume_test.go @@ -9,13 +9,13 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/mount" - "github.com/docker/docker/api/types/network" "github.com/docker/docker/client" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/integration-cli/cli/build" "github.com/docker/docker/testutil" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/mount" + "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/icmd" diff --git a/integration-cli/docker_utils_test.go b/integration-cli/docker_utils_test.go index 5e0d85114e..b8deb4d13e 100644 --- a/integration-cli/docker_utils_test.go +++ b/integration-cli/docker_utils_test.go @@ -14,14 +14,14 @@ import ( "testing" "time" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/integration-cli/daemon" "github.com/docker/docker/internal/testutils/specialimage" "github.com/docker/docker/testutil" "github.com/moby/go-archive" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/icmd" diff --git a/integration-cli/requirements_test.go b/integration-cli/requirements_test.go index a61a4cf503..6d55b8a5ae 100644 --- a/integration-cli/requirements_test.go +++ b/integration-cli/requirements_test.go @@ -11,12 +11,12 @@ import ( "time" "github.com/containerd/containerd/v2/plugins" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/integration-cli/requirement" "github.com/docker/docker/testutil/registry" + "github.com/moby/moby/api/types/network" + "github.com/moby/moby/api/types/swarm" ) func DaemonIsWindows() bool { diff --git a/integration/build/build_cgroupns_linux_test.go b/integration/build/build_cgroupns_linux_test.go index af44011db9..b3aead7f06 100644 --- a/integration/build/build_cgroupns_linux_test.go +++ b/integration/build/build_cgroupns_linux_test.go @@ -7,12 +7,12 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/build" "github.com/docker/docker/integration/internal/requirement" "github.com/docker/docker/pkg/jsonmessage" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" "github.com/docker/docker/testutil/fakecontext" + "github.com/moby/moby/api/types/build" "gotest.tools/v3/assert" "gotest.tools/v3/skip" ) diff --git a/integration/build/build_squash_test.go b/integration/build/build_squash_test.go index d9cb4b77c1..21226b4abe 100644 --- a/integration/build/build_squash_test.go +++ b/integration/build/build_squash_test.go @@ -6,14 +6,14 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/build" - containertypes "github.com/docker/docker/api/types/container" dclient "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/pkg/stdcopy" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" "github.com/docker/docker/testutil/fakecontext" + "github.com/moby/moby/api/types/build" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/build/build_test.go b/integration/build/build_test.go index d5d8463260..aaab7f7879 100644 --- a/integration/build/build_test.go +++ b/integration/build/build_test.go @@ -15,14 +15,14 @@ import ( "time" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/image" "github.com/docker/docker/pkg/jsonmessage" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/fakecontext" + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/image" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/build/build_userns_linux_test.go b/integration/build/build_userns_linux_test.go index 62e763d096..895d48817b 100644 --- a/integration/build/build_userns_linux_test.go +++ b/integration/build/build_userns_linux_test.go @@ -9,8 +9,6 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/build" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/pkg/jsonmessage" "github.com/docker/docker/pkg/stdcopy" @@ -18,6 +16,8 @@ import ( "github.com/docker/docker/testutil/daemon" "github.com/docker/docker/testutil/fakecontext" "github.com/docker/docker/testutil/fixtures/load" + "github.com/moby/moby/api/types/build" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" "gotest.tools/v3/poll" "gotest.tools/v3/skip" diff --git a/integration/capabilities/capabilities_linux_test.go b/integration/capabilities/capabilities_linux_test.go index 78400f1096..481d0feda2 100644 --- a/integration/capabilities/capabilities_linux_test.go +++ b/integration/capabilities/capabilities_linux_test.go @@ -6,12 +6,12 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/build" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/pkg/stdcopy" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/fakecontext" + "github.com/moby/moby/api/types/build" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" "gotest.tools/v3/poll" diff --git a/integration/config/config_test.go b/integration/config/config_test.go index 1804e3c842..179cab9716 100644 --- a/integration/config/config_test.go +++ b/integration/config/config_test.go @@ -9,13 +9,13 @@ import ( "time" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" - swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/swarm" "github.com/docker/docker/pkg/stdcopy" "github.com/docker/docker/testutil" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" + swarmtypes "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/container/attach_test.go b/integration/container/attach_test.go index b8e6a1a841..5cf254d702 100644 --- a/integration/container/attach_test.go +++ b/integration/container/attach_test.go @@ -4,12 +4,12 @@ import ( "testing" "time" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" systemutil "github.com/docker/docker/integration/internal/system" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/container/cdi_test.go b/integration/container/cdi_test.go index 149c29b3c9..cbbbc03a06 100644 --- a/integration/container/cdi_test.go +++ b/integration/container/cdi_test.go @@ -8,12 +8,12 @@ import ( "strings" "testing" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/system" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/pkg/stdcopy" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/system" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/container/checkpoint_test.go b/integration/container/checkpoint_test.go index b9bdfa59d9..94da85fc36 100644 --- a/integration/container/checkpoint_test.go +++ b/integration/container/checkpoint_test.go @@ -7,12 +7,12 @@ import ( "sort" "testing" - "github.com/docker/docker/api/types/checkpoint" - containertypes "github.com/docker/docker/api/types/container" - mounttypes "github.com/docker/docker/api/types/mount" "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/testutil/request" + "github.com/moby/moby/api/types/checkpoint" + containertypes "github.com/moby/moby/api/types/container" + mounttypes "github.com/moby/moby/api/types/mount" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/container/copy_test.go b/integration/container/copy_test.go index b2acd9bec7..c698a449c2 100644 --- a/integration/container/copy_test.go +++ b/integration/container/copy_test.go @@ -13,12 +13,12 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/build" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/pkg/jsonmessage" "github.com/docker/docker/testutil/fakecontext" "github.com/moby/go-archive" + "github.com/moby/moby/api/types/build" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/container/create_test.go b/integration/container/create_test.go index 0de937afd7..928142f0be 100644 --- a/integration/container/create_test.go +++ b/integration/container/create_test.go @@ -11,15 +11,15 @@ import ( containerd "github.com/containerd/containerd/v2/client" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/client" testContainer "github.com/docker/docker/integration/internal/container" net "github.com/docker/docker/integration/internal/network" "github.com/docker/docker/oci" "github.com/docker/docker/pkg/stringid" "github.com/docker/docker/testutil" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" + "github.com/moby/moby/api/types/versions" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/integration/container/daemon_linux_test.go b/integration/container/daemon_linux_test.go index 9a0a54de0c..7d8313f038 100644 --- a/integration/container/daemon_linux_test.go +++ b/integration/container/daemon_linux_test.go @@ -9,12 +9,12 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" realcontainer "github.com/docker/docker/daemon/container" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" "golang.org/x/sys/unix" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/integration/container/daemon_test.go b/integration/container/daemon_test.go index c9ab4c0394..617b3a008e 100644 --- a/integration/container/daemon_test.go +++ b/integration/container/daemon_test.go @@ -3,11 +3,11 @@ package container import ( "testing" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" "github.com/docker/go-connections/nat" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/container/devices_windows_test.go b/integration/container/devices_windows_test.go index 2deb06dffb..0a4c97b846 100644 --- a/integration/container/devices_windows_test.go +++ b/integration/container/devices_windows_test.go @@ -4,9 +4,9 @@ import ( "strings" "testing" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/testutil" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" "gotest.tools/v3/skip" ) diff --git a/integration/container/diff_test.go b/integration/container/diff_test.go index 23ea1193e3..d330ae24c8 100644 --- a/integration/container/diff_test.go +++ b/integration/container/diff_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" "gotest.tools/v3/poll" "gotest.tools/v3/skip" diff --git a/integration/container/exec_linux_test.go b/integration/container/exec_linux_test.go index 735bb3d780..ba53eebfd0 100644 --- a/integration/container/exec_linux_test.go +++ b/integration/container/exec_linux_test.go @@ -4,9 +4,9 @@ import ( "strings" "testing" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/integration/internal/container" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/versions" "gotest.tools/v3/assert" "gotest.tools/v3/skip" ) diff --git a/integration/container/exec_test.go b/integration/container/exec_test.go index 234056d1d9..f8930c0249 100644 --- a/integration/container/exec_test.go +++ b/integration/container/exec_test.go @@ -11,12 +11,12 @@ import ( "time" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/build" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/testutil/fakecontext" req "github.com/docker/docker/testutil/request" + "github.com/moby/moby/api/types" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/container/export_test.go b/integration/container/export_test.go index ec65d9e57c..a6054ae4a1 100644 --- a/integration/container/export_test.go +++ b/integration/container/export_test.go @@ -5,12 +5,12 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/image" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/pkg/jsonmessage" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/image" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/container/health_test.go b/integration/container/health_test.go index 1c73ff9800..f5011ab206 100644 --- a/integration/container/health_test.go +++ b/integration/container/health_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/container" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" "gotest.tools/v3/poll" "gotest.tools/v3/skip" diff --git a/integration/container/inspect_test.go b/integration/container/inspect_test.go index 2df8392f29..0c7cad6b87 100644 --- a/integration/container/inspect_test.go +++ b/integration/container/inspect_test.go @@ -7,10 +7,10 @@ import ( "testing" "github.com/containerd/platforms" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/testutil/request" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/container/ipcmode_linux_test.go b/integration/container/ipcmode_linux_test.go index 543eeda2f9..2f0c49da09 100644 --- a/integration/container/ipcmode_linux_test.go +++ b/integration/container/ipcmode_linux_test.go @@ -7,13 +7,13 @@ import ( "strings" "testing" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" "github.com/docker/docker/testutil/request" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/versions" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/fs" diff --git a/integration/container/kill_test.go b/integration/container/kill_test.go index f89df65386..2c41fec984 100644 --- a/integration/container/kill_test.go +++ b/integration/container/kill_test.go @@ -4,10 +4,10 @@ import ( "runtime" "testing" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/request" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/container/links_linux_test.go b/integration/container/links_linux_test.go index 8263b85755..0072191adc 100644 --- a/integration/container/links_linux_test.go +++ b/integration/container/links_linux_test.go @@ -4,9 +4,9 @@ import ( "os" "testing" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" "github.com/docker/docker/integration/internal/container" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/container/list_test.go b/integration/container/list_test.go index 0f88fbd251..957bd821c1 100644 --- a/integration/container/list_test.go +++ b/integration/container/list_test.go @@ -4,12 +4,12 @@ import ( "fmt" "testing" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/request" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/container/logs_test.go b/integration/container/logs_test.go index f62e621454..20d85e011d 100644 --- a/integration/container/logs_test.go +++ b/integration/container/logs_test.go @@ -7,12 +7,12 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/logger/jsonfilelog" "github.com/docker/docker/daemon/logger/local" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/integration/internal/termtest" "github.com/docker/docker/pkg/stdcopy" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/container/mounts_linux_test.go b/integration/container/mounts_linux_test.go index aa2edb822b..b1be727c65 100644 --- a/integration/container/mounts_linux_test.go +++ b/integration/container/mounts_linux_test.go @@ -8,16 +8,16 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api" - containertypes "github.com/docker/docker/api/types/container" - mounttypes "github.com/docker/docker/api/types/mount" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/client" "github.com/docker/docker/daemon/volume" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/pkg/parsers/kernel" "github.com/docker/docker/testutil" + "github.com/moby/moby/api" + containertypes "github.com/moby/moby/api/types/container" + mounttypes "github.com/moby/moby/api/types/mount" + "github.com/moby/moby/api/types/network" + "github.com/moby/moby/api/types/versions" "github.com/moby/sys/mount" "github.com/moby/sys/mountinfo" "gotest.tools/v3/assert" diff --git a/integration/container/nat_test.go b/integration/container/nat_test.go index ec2c8c61ed..149edd93bc 100644 --- a/integration/container/nat_test.go +++ b/integration/container/nat_test.go @@ -10,9 +10,9 @@ import ( "strings" "testing" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" "github.com/docker/go-connections/nat" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/container/overlayfs_linux_test.go b/integration/container/overlayfs_linux_test.go index 3b64ef2ef9..3e261fac48 100644 --- a/integration/container/overlayfs_linux_test.go +++ b/integration/container/overlayfs_linux_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" "github.com/moby/go-archive" + containertypes "github.com/moby/moby/api/types/container" "golang.org/x/sys/unix" "gotest.tools/v3/assert" "gotest.tools/v3/skip" diff --git a/integration/container/pause_test.go b/integration/container/pause_test.go index 6c1c1e781d..d8fd04ed58 100644 --- a/integration/container/pause_test.go +++ b/integration/container/pause_test.go @@ -6,11 +6,11 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/testutil/request" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/filters" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/container/pidmode_linux_test.go b/integration/container/pidmode_linux_test.go index e6f6e2d24c..f893002ba1 100644 --- a/integration/container/pidmode_linux_test.go +++ b/integration/container/pidmode_linux_test.go @@ -5,8 +5,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/container/remove_test.go b/integration/container/remove_test.go index 2d3cca5c90..5085d5eee4 100644 --- a/integration/container/remove_test.go +++ b/integration/container/remove_test.go @@ -5,8 +5,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/fs" diff --git a/integration/container/rename_test.go b/integration/container/rename_test.go index f68ae2b231..6f7c317abe 100644 --- a/integration/container/rename_test.go +++ b/integration/container/rename_test.go @@ -3,10 +3,10 @@ package container import ( "testing" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/pkg/stringid" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/container/resize_test.go b/integration/container/resize_test.go index a234543c45..b76307d109 100644 --- a/integration/container/resize_test.go +++ b/integration/container/resize_test.go @@ -7,10 +7,10 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" req "github.com/docker/docker/testutil/request" + "github.com/moby/moby/api/types" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/integration/container/restart_test.go b/integration/container/restart_test.go index a213c6b4a5..c67c814026 100644 --- a/integration/container/restart_test.go +++ b/integration/container/restart_test.go @@ -7,13 +7,13 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" "github.com/docker/docker/client" testContainer "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/filters" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/container/run_linux_test.go b/integration/container/run_linux_test.go index e4263f74f8..17800e7d8e 100644 --- a/integration/container/run_linux_test.go +++ b/integration/container/run_linux_test.go @@ -9,14 +9,14 @@ import ( "strings" "testing" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/container" net "github.com/docker/docker/integration/internal/network" "github.com/docker/docker/pkg/stdcopy" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/versions" "golang.org/x/sys/unix" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/integration/container/stats_test.go b/integration/container/stats_test.go index 5507f1c3c1..2cbb094cb3 100644 --- a/integration/container/stats_test.go +++ b/integration/container/stats_test.go @@ -6,8 +6,8 @@ import ( "reflect" "testing" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/container/stop_linux_test.go b/integration/container/stop_linux_test.go index 1eb357f237..a36d914464 100644 --- a/integration/container/stop_linux_test.go +++ b/integration/container/stop_linux_test.go @@ -9,10 +9,10 @@ import ( "time" cerrdefs "github.com/containerd/errdefs" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/pkg/stdcopy" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/container/stop_test.go b/integration/container/stop_test.go index 792ce3d7e2..318acf8b3d 100644 --- a/integration/container/stop_test.go +++ b/integration/container/stop_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/container/update_linux_test.go b/integration/container/update_linux_test.go index 1730c28b05..8c4b6b090a 100644 --- a/integration/container/update_linux_test.go +++ b/integration/container/update_linux_test.go @@ -7,11 +7,11 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/request" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/container/update_test.go b/integration/container/update_test.go index 5dfb57b4d3..8856ef6c74 100644 --- a/integration/container/update_test.go +++ b/integration/container/update_test.go @@ -5,8 +5,8 @@ import ( "time" cerrdefs "github.com/containerd/errdefs" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/container/wait_test.go b/integration/container/wait_test.go index c953627b13..a7d5c46fbd 100644 --- a/integration/container/wait_test.go +++ b/integration/container/wait_test.go @@ -4,10 +4,10 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/request" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/daemon/daemon_linux_test.go b/integration/daemon/daemon_linux_test.go index 78b0f03241..da68b81332 100644 --- a/integration/daemon/daemon_linux_test.go +++ b/integration/daemon/daemon_linux_test.go @@ -7,11 +7,11 @@ import ( "slices" "testing" - "github.com/docker/docker/api/types/network" "github.com/docker/docker/internal/nlwrap" "github.com/docker/docker/internal/testutils/networking" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + "github.com/moby/moby/api/types/network" "github.com/vishvananda/netlink" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/integration/daemon/daemon_test.go b/integration/daemon/daemon_test.go index 9246d6effd..cb413794d7 100644 --- a/integration/daemon/daemon_test.go +++ b/integration/daemon/daemon_test.go @@ -15,16 +15,16 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/mount" - "github.com/docker/docker/api/types/volume" "github.com/docker/docker/daemon/config" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/integration/internal/process" "github.com/docker/docker/pkg/stdcopy" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/mount" + "github.com/moby/moby/api/types/volume" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/icmd" diff --git a/integration/image/commit_test.go b/integration/image/commit_test.go index 44a7014c1a..4bc05936a8 100644 --- a/integration/image/commit_test.go +++ b/integration/image/commit_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/testutil/daemon" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/image/import_test.go b/integration/image/import_test.go index 45f4636753..9c7486b99f 100644 --- a/integration/image/import_test.go +++ b/integration/image/import_test.go @@ -11,9 +11,9 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/containerd/platforms" - imagetypes "github.com/docker/docker/api/types/image" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + imagetypes "github.com/moby/moby/api/types/image" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/image/inspect_test.go b/integration/image/inspect_test.go index f5c5e21499..48b6a2537c 100644 --- a/integration/image/inspect_test.go +++ b/integration/image/inspect_test.go @@ -5,10 +5,10 @@ import ( "encoding/json" "testing" - "github.com/docker/docker/api/types/image" "github.com/docker/docker/client" iimage "github.com/docker/docker/integration/internal/image" "github.com/docker/docker/internal/testutils/specialimage" + "github.com/moby/moby/api/types/image" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/integration/image/list_test.go b/integration/image/list_test.go index 38c8e5f904..01235d1f31 100644 --- a/integration/image/list_test.go +++ b/integration/image/list_test.go @@ -7,11 +7,6 @@ import ( "testing" "time" - "github.com/docker/docker/api" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/container" iimage "github.com/docker/docker/integration/internal/image" @@ -19,6 +14,11 @@ import ( "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" "github.com/google/go-cmp/cmp/cmpopts" + "github.com/moby/moby/api" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/versions" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/integration/image/load_test.go b/integration/image/load_test.go index 29a593a34d..fa3fe9ac4c 100644 --- a/integration/image/load_test.go +++ b/integration/image/load_test.go @@ -5,9 +5,9 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/image" iimage "github.com/docker/docker/integration/internal/image" "github.com/docker/docker/internal/testutils/specialimage" + "github.com/moby/moby/api/types/image" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/integration/image/prune_test.go b/integration/image/prune_test.go index 76c6f440c0..6f47470fc8 100644 --- a/integration/image/prune_test.go +++ b/integration/image/prune_test.go @@ -4,15 +4,15 @@ import ( "strings" "testing" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/image" "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/container" iimage "github.com/docker/docker/integration/internal/image" "github.com/docker/docker/internal/testutils/specialimage" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/image" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/image/pull_test.go b/integration/image/pull_test.go index c5458469d1..f6f59a4dd1 100644 --- a/integration/image/pull_test.go +++ b/integration/image/pull_test.go @@ -17,9 +17,9 @@ import ( "github.com/containerd/containerd/v2/plugins/content/local" cerrdefs "github.com/containerd/errdefs" "github.com/containerd/platforms" - "github.com/docker/docker/api/types/image" "github.com/docker/docker/testutil/daemon" "github.com/docker/docker/testutil/registry" + "github.com/moby/moby/api/types/image" "github.com/opencontainers/go-digest" "github.com/opencontainers/image-spec/specs-go" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/integration/image/remove_test.go b/integration/image/remove_test.go index bc0076db0d..f14d2bd624 100644 --- a/integration/image/remove_test.go +++ b/integration/image/remove_test.go @@ -7,11 +7,11 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/containerd/platforms" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/image" "github.com/docker/docker/integration/internal/container" iimage "github.com/docker/docker/integration/internal/image" "github.com/docker/docker/internal/testutils/specialimage" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/image" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/integration/image/save_test.go b/integration/image/save_test.go index 8696f25df6..f482f02411 100644 --- a/integration/image/save_test.go +++ b/integration/image/save_test.go @@ -15,8 +15,6 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/cpuguy83/tar2go" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/build" "github.com/docker/docker/integration/internal/container" @@ -25,6 +23,8 @@ import ( "github.com/docker/docker/internal/testutils/specialimage" "github.com/docker/docker/testutil/fakecontext" "github.com/moby/go-archive/compression" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/versions" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" diff --git a/integration/internal/build/build.go b/integration/internal/build/build.go index 1be988cd51..73c3957010 100644 --- a/integration/internal/build/build.go +++ b/integration/internal/build/build.go @@ -6,11 +6,11 @@ import ( "io" "testing" - "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/image" "github.com/docker/docker/client" "github.com/docker/docker/pkg/jsonmessage" "github.com/docker/docker/testutil/fakecontext" + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/image" "gotest.tools/v3/assert" ) diff --git a/integration/internal/container/container.go b/integration/internal/container/container.go index bd14264b88..cefc34eba5 100644 --- a/integration/internal/container/container.go +++ b/integration/internal/container/container.go @@ -8,11 +8,11 @@ import ( "sync" "testing" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" "github.com/docker/docker/client" "github.com/docker/docker/pkg/stdcopy" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" ) diff --git a/integration/internal/container/exec.go b/integration/internal/container/exec.go index 667ba75d6a..812a015f71 100644 --- a/integration/internal/container/exec.go +++ b/integration/internal/container/exec.go @@ -5,8 +5,8 @@ import ( "context" "testing" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" + "github.com/moby/moby/api/types/container" ) // ExecResult represents a result returned from Exec() diff --git a/integration/internal/container/ops.go b/integration/internal/container/ops.go index af136244f4..ff490da8a9 100644 --- a/integration/internal/container/ops.go +++ b/integration/internal/container/ops.go @@ -5,10 +5,10 @@ import ( "slices" "strings" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/mount" - "github.com/docker/docker/api/types/network" "github.com/docker/go-connections/nat" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/mount" + "github.com/moby/moby/api/types/network" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/integration/internal/container/states.go b/integration/internal/container/states.go index 8824bc95f8..2c1065612a 100644 --- a/integration/internal/container/states.go +++ b/integration/internal/container/states.go @@ -5,8 +5,8 @@ import ( "strings" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" + "github.com/moby/moby/api/types/container" "github.com/pkg/errors" "gotest.tools/v3/poll" ) diff --git a/integration/internal/network/network.go b/integration/internal/network/network.go index aaa184f1cb..b79dcc1e31 100644 --- a/integration/internal/network/network.go +++ b/integration/internal/network/network.go @@ -4,8 +4,8 @@ import ( "context" "testing" - "github.com/docker/docker/api/types/network" "github.com/docker/docker/client" + "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" ) diff --git a/integration/internal/network/ops.go b/integration/internal/network/ops.go index 9a479b0ab2..5482e3be91 100644 --- a/integration/internal/network/ops.go +++ b/integration/internal/network/ops.go @@ -1,7 +1,7 @@ package network import ( - "github.com/docker/docker/api/types/network" + "github.com/moby/moby/api/types/network" ) // WithDriver sets the driver of the network diff --git a/integration/internal/network/states.go b/integration/internal/network/states.go index befd63dafd..a6b36aa978 100644 --- a/integration/internal/network/states.go +++ b/integration/internal/network/states.go @@ -3,8 +3,8 @@ package network import ( "context" - "github.com/docker/docker/api/types/network" "github.com/docker/docker/client" + "github.com/moby/moby/api/types/network" "gotest.tools/v3/poll" ) diff --git a/integration/internal/swarm/service.go b/integration/internal/swarm/service.go index c573a1f8c3..97e371c350 100644 --- a/integration/internal/swarm/service.go +++ b/integration/internal/swarm/service.go @@ -6,13 +6,13 @@ import ( "testing" "time" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" - swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" "github.com/docker/docker/testutil/daemon" "github.com/docker/docker/testutil/environment" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" + swarmtypes "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" "gotest.tools/v3/poll" "gotest.tools/v3/skip" diff --git a/integration/internal/swarm/states.go b/integration/internal/swarm/states.go index 9c998cca47..dc705404a7 100644 --- a/integration/internal/swarm/states.go +++ b/integration/internal/swarm/states.go @@ -4,9 +4,9 @@ import ( "context" "fmt" - "github.com/docker/docker/api/types/filters" - swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" + "github.com/moby/moby/api/types/filters" + swarmtypes "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/poll" ) diff --git a/integration/network/bridge/bridge_linux_test.go b/integration/network/bridge/bridge_linux_test.go index 56ea17f0a7..1825800bbe 100644 --- a/integration/network/bridge/bridge_linux_test.go +++ b/integration/network/bridge/bridge_linux_test.go @@ -9,9 +9,6 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" - networktypes "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/daemon/libnetwork/drivers/bridge" "github.com/docker/docker/daemon/libnetwork/netlabel" ctr "github.com/docker/docker/integration/internal/container" @@ -21,6 +18,9 @@ import ( "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" "github.com/docker/go-connections/nat" + containertypes "github.com/moby/moby/api/types/container" + networktypes "github.com/moby/moby/api/types/network" + "github.com/moby/moby/api/types/versions" "github.com/vishvananda/netlink" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/integration/network/bridge/iptablesdoc/iptablesdoc_linux_test.go b/integration/network/bridge/iptablesdoc/iptablesdoc_linux_test.go index d43daac2c0..5a099898da 100644 --- a/integration/network/bridge/iptablesdoc/iptablesdoc_linux_test.go +++ b/integration/network/bridge/iptablesdoc/iptablesdoc_linux_test.go @@ -30,9 +30,6 @@ import ( "text/template" "time" - containertypes "github.com/docker/docker/api/types/container" - networktypes "github.com/docker/docker/api/types/network" - swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" "github.com/docker/docker/daemon/libnetwork/drivers/bridge" "github.com/docker/docker/integration/internal/container" @@ -41,6 +38,9 @@ import ( "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" "github.com/docker/go-connections/nat" + containertypes "github.com/moby/moby/api/types/container" + networktypes "github.com/moby/moby/api/types/network" + swarmtypes "github.com/moby/moby/api/types/swarm" "github.com/vishvananda/netlink" "gotest.tools/v3/assert" "gotest.tools/v3/golden" diff --git a/integration/network/bridge/nftablesdoc/nftablesdoc_linux_test.go b/integration/network/bridge/nftablesdoc/nftablesdoc_linux_test.go index ee9a4c0289..ed6aad8a76 100644 --- a/integration/network/bridge/nftablesdoc/nftablesdoc_linux_test.go +++ b/integration/network/bridge/nftablesdoc/nftablesdoc_linux_test.go @@ -27,9 +27,6 @@ import ( "testing" "text/template" - containertypes "github.com/docker/docker/api/types/container" - networktypes "github.com/docker/docker/api/types/network" - swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/daemon/libnetwork/drivers/bridge" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/integration/internal/network" @@ -37,6 +34,9 @@ import ( "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" "github.com/docker/go-connections/nat" + containertypes "github.com/moby/moby/api/types/container" + networktypes "github.com/moby/moby/api/types/network" + swarmtypes "github.com/moby/moby/api/types/swarm" "github.com/vishvananda/netlink" "gotest.tools/v3/assert" "gotest.tools/v3/golden" diff --git a/integration/network/delete_test.go b/integration/network/delete_test.go index 2abae3b506..5fa4b1f74a 100644 --- a/integration/network/delete_test.go +++ b/integration/network/delete_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - networktypes "github.com/docker/docker/api/types/network" dclient "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/network" + networktypes "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/network/dns_test.go b/integration/network/dns_test.go index f04d67cff7..882380eb90 100644 --- a/integration/network/dns_test.go +++ b/integration/network/dns_test.go @@ -3,11 +3,11 @@ package network import ( "testing" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/integration/internal/network" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/network/helpers.go b/integration/network/helpers.go index 51983fe2b2..2b66c5c4ac 100644 --- a/integration/network/helpers.go +++ b/integration/network/helpers.go @@ -7,9 +7,9 @@ import ( "fmt" "testing" - "github.com/docker/docker/api/types/network" "github.com/docker/docker/client" "github.com/docker/docker/testutil" + "github.com/moby/moby/api/types/network" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/icmd" ) diff --git a/integration/network/helpers_windows.go b/integration/network/helpers_windows.go index 71ab8bbcf0..f93ca6d826 100644 --- a/integration/network/helpers_windows.go +++ b/integration/network/helpers_windows.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/docker/docker/api/types/network" "github.com/docker/docker/client" + "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert/cmp" ) diff --git a/integration/network/inspect_test.go b/integration/network/inspect_test.go index 1495aada86..a8e4e9c1d7 100644 --- a/integration/network/inspect_test.go +++ b/integration/network/inspect_test.go @@ -3,10 +3,10 @@ package network import ( "testing" - networktypes "github.com/docker/docker/api/types/network" "github.com/docker/docker/integration/internal/network" "github.com/docker/docker/integration/internal/swarm" "github.com/docker/docker/testutil" + networktypes "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" "gotest.tools/v3/poll" "gotest.tools/v3/skip" diff --git a/integration/network/ipvlan/ipvlan_test.go b/integration/network/ipvlan/ipvlan_test.go index 70306c3877..45266a4693 100644 --- a/integration/network/ipvlan/ipvlan_test.go +++ b/integration/network/ipvlan/ipvlan_test.go @@ -9,8 +9,6 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" dclient "github.com/docker/docker/client" "github.com/docker/docker/daemon/libnetwork/netlabel" "github.com/docker/docker/integration/internal/container" @@ -18,6 +16,8 @@ import ( n "github.com/docker/docker/integration/network" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/network/macvlan/macvlan_test.go b/integration/network/macvlan/macvlan_test.go index 3e8e2ca3d9..540fd82b17 100644 --- a/integration/network/macvlan/macvlan_test.go +++ b/integration/network/macvlan/macvlan_test.go @@ -8,8 +8,6 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" "github.com/docker/docker/client" "github.com/docker/docker/daemon/libnetwork/netlabel" "github.com/docker/docker/integration/internal/container" @@ -17,6 +15,8 @@ import ( n "github.com/docker/docker/integration/network" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/icmd" diff --git a/integration/network/network_linux_test.go b/integration/network/network_linux_test.go index e520f8edc9..08f1f4de84 100644 --- a/integration/network/network_linux_test.go +++ b/integration/network/network_linux_test.go @@ -11,9 +11,6 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" - networktypes "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/versions" "github.com/docker/docker/client" "github.com/docker/docker/daemon/libnetwork/netlabel" "github.com/docker/docker/integration/internal/container" @@ -21,6 +18,9 @@ import ( "github.com/docker/docker/internal/testutils/networking" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + containertypes "github.com/moby/moby/api/types/container" + networktypes "github.com/moby/moby/api/types/network" + "github.com/moby/moby/api/types/versions" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/icmd" diff --git a/integration/network/network_test.go b/integration/network/network_test.go index 340cf969d5..6356bb9bf0 100644 --- a/integration/network/network_test.go +++ b/integration/network/network_test.go @@ -5,9 +5,9 @@ import ( "net/http" "testing" - networktypes "github.com/docker/docker/api/types/network" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/request" + networktypes "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/integration/network/overlay/overlay_test.go b/integration/network/overlay/overlay_test.go index 40117c3653..bd11962ffb 100644 --- a/integration/network/overlay/overlay_test.go +++ b/integration/network/overlay/overlay_test.go @@ -10,14 +10,14 @@ import ( "strings" "testing" - containertypes "github.com/docker/docker/api/types/container" - networktypes "github.com/docker/docker/api/types/network" - swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/daemon/libnetwork/netlabel" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/integration/internal/network" "github.com/docker/docker/integration/internal/swarm" "github.com/docker/docker/testutil/daemon" + containertypes "github.com/moby/moby/api/types/container" + networktypes "github.com/moby/moby/api/types/network" + swarmtypes "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" "gotest.tools/v3/poll" "gotest.tools/v3/skip" diff --git a/integration/network/service_test.go b/integration/network/service_test.go index 22171991bd..51c80dd22c 100644 --- a/integration/network/service_test.go +++ b/integration/network/service_test.go @@ -6,9 +6,6 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" - networktypes "github.com/docker/docker/api/types/network" - swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" "github.com/docker/docker/daemon/libnetwork/netlabel" "github.com/docker/docker/integration/internal/container" @@ -16,6 +13,9 @@ import ( "github.com/docker/docker/integration/internal/swarm" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + containertypes "github.com/moby/moby/api/types/container" + networktypes "github.com/moby/moby/api/types/network" + swarmtypes "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/icmd" diff --git a/integration/networking/bridge_linux_test.go b/integration/networking/bridge_linux_test.go index 3bd71987ae..c38181d39b 100644 --- a/integration/networking/bridge_linux_test.go +++ b/integration/networking/bridge_linux_test.go @@ -16,8 +16,6 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" - networktypes "github.com/docker/docker/api/types/network" "github.com/docker/docker/client" "github.com/docker/docker/daemon/libnetwork/drivers/bridge" "github.com/docker/docker/daemon/libnetwork/iptables" @@ -30,6 +28,8 @@ import ( "github.com/docker/docker/testutil/daemon" "github.com/docker/go-connections/nat" "github.com/google/go-cmp/cmp/cmpopts" + containertypes "github.com/moby/moby/api/types/container" + networktypes "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/networking/etchosts_test.go b/integration/networking/etchosts_test.go index 094eefd5bf..8094d91eb3 100644 --- a/integration/networking/etchosts_test.go +++ b/integration/networking/etchosts_test.go @@ -5,11 +5,11 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/integration/internal/network" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/golden" diff --git a/integration/networking/mac_addr_test.go b/integration/networking/mac_addr_test.go index cda3b4db6f..69b35f3fbb 100644 --- a/integration/networking/mac_addr_test.go +++ b/integration/networking/mac_addr_test.go @@ -3,13 +3,13 @@ package networking import ( "testing" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" "github.com/docker/docker/daemon/libnetwork/drivers/bridge" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/integration/internal/network" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/networking/nat_windows_test.go b/integration/networking/nat_windows_test.go index 1c7945eb12..41fdb04589 100644 --- a/integration/networking/nat_windows_test.go +++ b/integration/networking/nat_windows_test.go @@ -6,11 +6,11 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/integration/internal/network" "github.com/docker/docker/testutil" "github.com/docker/go-connections/nat" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/integration/networking/port_mapping_linux_test.go b/integration/networking/port_mapping_linux_test.go index a960412120..f88b0c6049 100644 --- a/integration/networking/port_mapping_linux_test.go +++ b/integration/networking/port_mapping_linux_test.go @@ -15,8 +15,6 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" - networktypes "github.com/docker/docker/api/types/network" "github.com/docker/docker/client" "github.com/docker/docker/daemon/libnetwork/drivers/bridge" "github.com/docker/docker/integration/internal/container" @@ -26,6 +24,8 @@ import ( "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" "github.com/docker/go-connections/nat" + containertypes "github.com/moby/moby/api/types/container" + networktypes "github.com/moby/moby/api/types/network" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/golden" diff --git a/integration/networking/resolvconf_test.go b/integration/networking/resolvconf_test.go index c8e24fb095..b869b2cee9 100644 --- a/integration/networking/resolvconf_test.go +++ b/integration/networking/resolvconf_test.go @@ -8,11 +8,11 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/mount" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/integration/internal/network" "github.com/docker/docker/testutil/daemon" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/mount" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/plugin/authz/authz_plugin_test.go b/integration/plugin/authz/authz_plugin_test.go index b77b2de31a..95a8f3f607 100644 --- a/integration/plugin/authz/authz_plugin_test.go +++ b/integration/plugin/authz/authz_plugin_test.go @@ -17,15 +17,15 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" - eventtypes "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/image" "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/pkg/authorization" "github.com/docker/docker/testutil/environment" "github.com/docker/go-connections/sockets" "github.com/moby/go-archive" + containertypes "github.com/moby/moby/api/types/container" + eventtypes "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/image" "gotest.tools/v3/assert" "gotest.tools/v3/skip" ) diff --git a/integration/plugin/authz/authz_plugin_v2_test.go b/integration/plugin/authz/authz_plugin_v2_test.go index 642554dc89..085c69962e 100644 --- a/integration/plugin/authz/authz_plugin_v2_test.go +++ b/integration/plugin/authz/authz_plugin_v2_test.go @@ -8,12 +8,12 @@ import ( "io" "testing" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/volume" "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/integration/internal/requirement" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/volume" "gotest.tools/v3/assert" "gotest.tools/v3/skip" ) diff --git a/integration/plugin/common/plugin_test.go b/integration/plugin/common/plugin_test.go index ba8ac53f65..696932788f 100644 --- a/integration/plugin/common/plugin_test.go +++ b/integration/plugin/common/plugin_test.go @@ -15,15 +15,15 @@ import ( c8dimages "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/remotes/docker" - "github.com/docker/docker/api/types" - registrytypes "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/api/types/system" "github.com/docker/docker/pkg/jsonmessage" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" "github.com/docker/docker/testutil/fixtures/plugin" "github.com/docker/docker/testutil/registry" "github.com/docker/docker/testutil/request" + "github.com/moby/moby/api/types" + registrytypes "github.com/moby/moby/api/types/registry" + "github.com/moby/moby/api/types/system" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/integration/plugin/logging/helpers_test.go b/integration/plugin/logging/helpers_test.go index 8920e93a6a..e23dec5f18 100644 --- a/integration/plugin/logging/helpers_test.go +++ b/integration/plugin/logging/helpers_test.go @@ -7,9 +7,9 @@ import ( "path/filepath" "testing" - "github.com/docker/docker/api/types" "github.com/docker/docker/testutil/fixtures/plugin" "github.com/moby/locker" + "github.com/moby/moby/api/types" "github.com/pkg/errors" "gotest.tools/v3/assert" ) diff --git a/integration/plugin/logging/logging_linux_test.go b/integration/plugin/logging/logging_linux_test.go index 0cb96c4bd1..bc36f9f267 100644 --- a/integration/plugin/logging/logging_linux_test.go +++ b/integration/plugin/logging/logging_linux_test.go @@ -8,11 +8,11 @@ import ( "testing" "time" - "github.com/docker/docker/api/types" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + "github.com/moby/moby/api/types" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" "gotest.tools/v3/skip" ) diff --git a/integration/plugin/logging/read_test.go b/integration/plugin/logging/read_test.go index ff3d620572..8b0366d24a 100644 --- a/integration/plugin/logging/read_test.go +++ b/integration/plugin/logging/read_test.go @@ -7,12 +7,12 @@ import ( "testing" "time" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/container" testContainer "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/pkg/stdcopy" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" "gotest.tools/v3/poll" ) diff --git a/integration/plugin/logging/validation_test.go b/integration/plugin/logging/validation_test.go index 2525083ada..66227a5dfb 100644 --- a/integration/plugin/logging/validation_test.go +++ b/integration/plugin/logging/validation_test.go @@ -5,9 +5,9 @@ package logging import ( "testing" - "github.com/docker/docker/api/types" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + "github.com/moby/moby/api/types" "gotest.tools/v3/assert" "gotest.tools/v3/skip" ) diff --git a/integration/plugin/volumes/helpers_test.go b/integration/plugin/volumes/helpers_test.go index 667034ba8f..aff74e4019 100644 --- a/integration/plugin/volumes/helpers_test.go +++ b/integration/plugin/volumes/helpers_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" - "github.com/docker/docker/api/types" "github.com/docker/docker/testutil/fixtures/plugin" "github.com/moby/locker" + "github.com/moby/moby/api/types" "github.com/pkg/errors" "gotest.tools/v3/assert" ) diff --git a/integration/plugin/volumes/mounts_test.go b/integration/plugin/volumes/mounts_test.go index d877382948..4b101f5c93 100644 --- a/integration/plugin/volumes/mounts_test.go +++ b/integration/plugin/volumes/mounts_test.go @@ -4,10 +4,10 @@ import ( "os" "testing" - "github.com/docker/docker/api/types" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" "github.com/docker/docker/testutil/fixtures/plugin" + "github.com/moby/moby/api/types" "gotest.tools/v3/assert" "gotest.tools/v3/skip" ) diff --git a/integration/secret/secret_test.go b/integration/secret/secret_test.go index 2149678fd2..86d48a80d5 100644 --- a/integration/secret/secret_test.go +++ b/integration/secret/secret_test.go @@ -9,13 +9,13 @@ import ( "time" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" - swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/swarm" "github.com/docker/docker/pkg/stdcopy" "github.com/docker/docker/testutil" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" + swarmtypes "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/service/create_test.go b/integration/service/create_test.go index 05cc406ca8..cd55ceaa66 100644 --- a/integration/service/create_test.go +++ b/integration/service/create_test.go @@ -8,14 +8,14 @@ import ( "time" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" - swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/network" "github.com/docker/docker/integration/internal/swarm" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" + swarmtypes "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/service/inspect_test.go b/integration/service/inspect_test.go index 691565848d..bd20d500be 100644 --- a/integration/service/inspect_test.go +++ b/integration/service/inspect_test.go @@ -4,10 +4,10 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/container" - swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/integration/internal/swarm" "github.com/google/go-cmp/cmp" + "github.com/moby/moby/api/types/container" + swarmtypes "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/service/jobs_test.go b/integration/service/jobs_test.go index c4382594fe..5664222a09 100644 --- a/integration/service/jobs_test.go +++ b/integration/service/jobs_test.go @@ -3,8 +3,8 @@ package service import ( "testing" - swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/integration/internal/swarm" + swarmtypes "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" "gotest.tools/v3/poll" "gotest.tools/v3/skip" diff --git a/integration/service/list_test.go b/integration/service/list_test.go index 52c966dc14..5b2414f920 100644 --- a/integration/service/list_test.go +++ b/integration/service/list_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" - "github.com/docker/docker/api/types/filters" - swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/integration/internal/swarm" + "github.com/moby/moby/api/types/filters" + swarmtypes "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/service/network_linux_test.go b/integration/service/network_linux_test.go index d1f27f0261..5b2e146cd7 100644 --- a/integration/service/network_linux_test.go +++ b/integration/service/network_linux_test.go @@ -7,9 +7,6 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" - swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" "github.com/docker/docker/daemon/libnetwork/scope" "github.com/docker/docker/integration/internal/container" @@ -17,6 +14,9 @@ import ( "github.com/docker/docker/integration/internal/swarm" "github.com/docker/docker/internal/testutils/networking" "github.com/docker/docker/testutil/daemon" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" + swarmtypes "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/golden" diff --git a/integration/service/plugin_test.go b/integration/service/plugin_test.go index 47f2ef7c00..4dd2ebec1b 100644 --- a/integration/service/plugin_test.go +++ b/integration/service/plugin_test.go @@ -6,14 +6,14 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/filters" - swarmtypes "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/api/types/swarm/runtime" "github.com/docker/docker/integration/internal/swarm" "github.com/docker/docker/testutil/daemon" "github.com/docker/docker/testutil/fixtures/plugin" "github.com/docker/docker/testutil/registry" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/filters" + swarmtypes "github.com/moby/moby/api/types/swarm" + "github.com/moby/moby/api/types/swarm/runtime" "gotest.tools/v3/assert" "gotest.tools/v3/poll" "gotest.tools/v3/skip" diff --git a/integration/service/update_test.go b/integration/service/update_test.go index 83ffb3d274..9cdd4e5839 100644 --- a/integration/service/update_test.go +++ b/integration/service/update_test.go @@ -4,14 +4,14 @@ import ( "context" "testing" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" - networktypes "github.com/docker/docker/api/types/network" - swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/network" "github.com/docker/docker/integration/internal/swarm" "github.com/docker/docker/testutil" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" + networktypes "github.com/moby/moby/api/types/network" + swarmtypes "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/poll" diff --git a/integration/system/cgroupdriver_systemd_test.go b/integration/system/cgroupdriver_systemd_test.go index 3991533e6e..23a4b6aa47 100644 --- a/integration/system/cgroupdriver_systemd_test.go +++ b/integration/system/cgroupdriver_systemd_test.go @@ -4,10 +4,10 @@ import ( "os" "testing" - containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + containertypes "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" "gotest.tools/v3/skip" diff --git a/integration/system/disk_usage_test.go b/integration/system/disk_usage_test.go index 322b763955..2fdcb93b92 100644 --- a/integration/system/disk_usage_test.go +++ b/integration/system/disk_usage_test.go @@ -3,14 +3,14 @@ package system import ( "testing" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/build" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/volume" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/build" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/volume" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/system/event_test.go b/integration/system/event_test.go index 0d2970acd5..c7648ca02c 100644 --- a/integration/system/event_test.go +++ b/integration/system/event_test.go @@ -11,14 +11,14 @@ import ( "testing" "time" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/mount" - "github.com/docker/docker/api/types/volume" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/pkg/jsonmessage" "github.com/docker/docker/testutil/request" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/mount" + "github.com/moby/moby/api/types/volume" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/system/info_test.go b/integration/system/info_test.go index 0fbf6281cc..2049b139d9 100644 --- a/integration/system/info_test.go +++ b/integration/system/info_test.go @@ -5,9 +5,9 @@ import ( "sort" "testing" - "github.com/docker/docker/api/types/registry" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" + "github.com/moby/moby/api/types/registry" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/system/login_test.go b/integration/system/login_test.go index d78437bcdc..95878d5733 100644 --- a/integration/system/login_test.go +++ b/integration/system/login_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" - "github.com/docker/docker/api/types/registry" "github.com/docker/docker/integration/internal/requirement" registrypkg "github.com/docker/docker/registry" + "github.com/moby/moby/api/types/registry" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/system/ping_test.go b/integration/system/ping_test.go index f1f92eddd8..d57ab1255b 100644 --- a/integration/system/ping_test.go +++ b/integration/system/ping_test.go @@ -8,11 +8,11 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/build" - "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/daemon" "github.com/docker/docker/testutil/request" + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" "gotest.tools/v3/skip" ) diff --git a/integration/volume/mount_test.go b/integration/volume/mount_test.go index f14ea10909..de7af81366 100644 --- a/integration/volume/mount_test.go +++ b/integration/volume/mount_test.go @@ -9,17 +9,17 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/build" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/mount" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/versions" - "github.com/docker/docker/api/types/volume" "github.com/docker/docker/client" "github.com/docker/docker/daemon/volume/safepath" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/testutil/fakecontext" + "github.com/moby/moby/api/types/build" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/mount" + "github.com/moby/moby/api/types/network" + "github.com/moby/moby/api/types/versions" + "github.com/moby/moby/api/types/volume" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/integration/volume/volume_test.go b/integration/volume/volume_test.go index dd4ddc1d96..8aae912cea 100644 --- a/integration/volume/volume_test.go +++ b/integration/volume/volume_test.go @@ -9,9 +9,6 @@ import ( "time" cerrdefs "github.com/containerd/errdefs" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/volume" clientpkg "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/build" "github.com/docker/docker/integration/internal/container" @@ -20,6 +17,9 @@ import ( "github.com/docker/docker/testutil/fakecontext" "github.com/docker/docker/testutil/request" "github.com/google/go-cmp/cmp/cmpopts" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/volume" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/registry/auth.go b/registry/auth.go index 1b0eeeed0b..56f5b78474 100644 --- a/registry/auth.go +++ b/registry/auth.go @@ -11,7 +11,7 @@ import ( "github.com/docker/distribution/registry/client/auth" "github.com/docker/distribution/registry/client/auth/challenge" "github.com/docker/distribution/registry/client/transport" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/registry" "github.com/pkg/errors" ) diff --git a/registry/auth_test.go b/registry/auth_test.go index 927254177d..39a29d9080 100644 --- a/registry/auth_test.go +++ b/registry/auth_test.go @@ -3,7 +3,7 @@ package registry import ( "testing" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/registry" "gotest.tools/v3/assert" ) diff --git a/registry/config.go b/registry/config.go index 31872307be..b087d1e190 100644 --- a/registry/config.go +++ b/registry/config.go @@ -12,8 +12,8 @@ import ( "github.com/containerd/log" "github.com/distribution/reference" - "github.com/docker/docker/api/types/registry" "github.com/docker/docker/internal/lazyregexp" + "github.com/moby/moby/api/types/registry" ) // ServiceOptions holds command line options. diff --git a/registry/registry_mock_test.go b/registry/registry_mock_test.go index 9f2f611d9a..44d2581fba 100644 --- a/registry/registry_mock_test.go +++ b/registry/registry_mock_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/containerd/log" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/registry" "gotest.tools/v3/assert" ) diff --git a/registry/registry_test.go b/registry/registry_test.go index a6ac23e842..0523feee0b 100644 --- a/registry/registry_test.go +++ b/registry/registry_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/distribution/reference" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/registry" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/registry/search.go b/registry/search.go index 26a14298ac..24dc91ab02 100644 --- a/registry/search.go +++ b/registry/search.go @@ -8,8 +8,8 @@ import ( "github.com/containerd/log" "github.com/docker/distribution/registry/client/auth" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/registry" "github.com/pkg/errors" ) diff --git a/registry/search_endpoint_v1.go b/registry/search_endpoint_v1.go index 2ac3cee829..6e58166d79 100644 --- a/registry/search_endpoint_v1.go +++ b/registry/search_endpoint_v1.go @@ -11,7 +11,7 @@ import ( "github.com/containerd/log" "github.com/docker/distribution/registry/client/transport" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/registry" ) // v1PingResult contains the information returned when pinging a registry. It diff --git a/registry/search_endpoint_v1_test.go b/registry/search_endpoint_v1_test.go index a430f34cc1..137e2a60fc 100644 --- a/registry/search_endpoint_v1_test.go +++ b/registry/search_endpoint_v1_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/registry" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/registry/search_session.go b/registry/search_session.go index f2886b7d38..2bc20acead 100644 --- a/registry/search_session.go +++ b/registry/search_session.go @@ -14,7 +14,7 @@ import ( "sync" "github.com/containerd/log" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/registry" "github.com/pkg/errors" ) diff --git a/registry/search_test.go b/registry/search_test.go index 751c79ce8b..c4169e4513 100644 --- a/registry/search_test.go +++ b/registry/search_test.go @@ -10,8 +10,8 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/docker/distribution/registry/client/transport" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/registry" "gotest.tools/v3/assert" ) diff --git a/registry/service.go b/registry/service.go index 73c9edfcd1..50291798b3 100644 --- a/registry/service.go +++ b/registry/service.go @@ -11,7 +11,7 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/distribution/reference" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/registry" ) // Service is a registry service. It tracks configuration data such as a list diff --git a/registry/types.go b/registry/types.go index bb081d5638..b030072cdb 100644 --- a/registry/types.go +++ b/registry/types.go @@ -2,7 +2,7 @@ package registry import ( "github.com/distribution/reference" - "github.com/docker/docker/api/types/registry" + "github.com/moby/moby/api/types/registry" ) // RepositoryInfo describes a repository diff --git a/runconfig/config.go b/runconfig/config.go index 937a3d4def..ba40a5935c 100644 --- a/runconfig/config.go +++ b/runconfig/config.go @@ -5,9 +5,9 @@ import ( "io" "runtime" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" "github.com/docker/docker/pkg/sysinfo" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" ) // ContainerDecoder implements httputils.ContainerDecoder diff --git a/runconfig/config_test.go b/runconfig/config_test.go index c247e06170..3f97219af4 100644 --- a/runconfig/config_test.go +++ b/runconfig/config_test.go @@ -8,8 +8,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/pkg/sysinfo" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/runconfig/hostconfig.go b/runconfig/hostconfig.go index eb5dcf24c1..37b98e499e 100644 --- a/runconfig/hostconfig.go +++ b/runconfig/hostconfig.go @@ -1,7 +1,7 @@ package runconfig import ( - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" ) // validateNetContainerMode ensures that the various combinations of requested diff --git a/runconfig/hostconfig_test.go b/runconfig/hostconfig_test.go index 61fa035016..9776d920fa 100644 --- a/runconfig/hostconfig_test.go +++ b/runconfig/hostconfig_test.go @@ -6,8 +6,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/pkg/sysinfo" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/runconfig/hostconfig_unix.go b/runconfig/hostconfig_unix.go index 8ea794ea97..9951619f7e 100644 --- a/runconfig/hostconfig_unix.go +++ b/runconfig/hostconfig_unix.go @@ -6,8 +6,8 @@ import ( "fmt" "runtime" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/pkg/sysinfo" + "github.com/moby/moby/api/types/container" ) // validateNetMode ensures that the various combinations of requested diff --git a/runconfig/hostconfig_windows.go b/runconfig/hostconfig_windows.go index 773c10d93a..91bf8c9b09 100644 --- a/runconfig/hostconfig_windows.go +++ b/runconfig/hostconfig_windows.go @@ -3,8 +3,8 @@ package runconfig import ( "fmt" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/pkg/sysinfo" + "github.com/moby/moby/api/types/container" ) // validateNetMode ensures that the various combinations of requested diff --git a/testutil/daemon/config.go b/testutil/daemon/config.go index 9f0609c5a8..a82dee4777 100644 --- a/testutil/daemon/config.go +++ b/testutil/daemon/config.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" ) diff --git a/testutil/daemon/container.go b/testutil/daemon/container.go index 3dccfc5898..33a2febad1 100644 --- a/testutil/daemon/container.go +++ b/testutil/daemon/container.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/docker/docker/api/types/container" + "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" ) diff --git a/testutil/daemon/daemon.go b/testutil/daemon/daemon.go index 1b2f7e4b5c..0186d73b0d 100644 --- a/testutil/daemon/daemon.go +++ b/testutil/daemon/daemon.go @@ -21,8 +21,6 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/system" "github.com/docker/docker/client" "github.com/docker/docker/daemon/container" "github.com/docker/docker/pkg/ioutils" @@ -31,6 +29,8 @@ import ( "github.com/docker/docker/testutil/request" "github.com/docker/go-connections/sockets" "github.com/docker/go-connections/tlsconfig" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/system" "github.com/pkg/errors" "gotest.tools/v3/assert" "gotest.tools/v3/poll" diff --git a/testutil/daemon/node.go b/testutil/daemon/node.go index 32c3227a4f..6a3fe6ffad 100644 --- a/testutil/daemon/node.go +++ b/testutil/daemon/node.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" ) diff --git a/testutil/daemon/plugin.go b/testutil/daemon/plugin.go index db378ae734..48e849e373 100644 --- a/testutil/daemon/plugin.go +++ b/testutil/daemon/plugin.go @@ -5,8 +5,8 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types" "github.com/docker/docker/client" + "github.com/moby/moby/api/types" "gotest.tools/v3/poll" ) diff --git a/testutil/daemon/secret.go b/testutil/daemon/secret.go index e7f0344a51..63884d83b1 100644 --- a/testutil/daemon/secret.go +++ b/testutil/daemon/secret.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" ) diff --git a/testutil/daemon/service.go b/testutil/daemon/service.go index 5d6f4f108d..0ab51ac122 100644 --- a/testutil/daemon/service.go +++ b/testutil/daemon/service.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/swarm" "gotest.tools/v3/assert" ) diff --git a/testutil/daemon/swarm.go b/testutil/daemon/swarm.go index 4d43aa1a3b..aa8e649744 100644 --- a/testutil/daemon/swarm.go +++ b/testutil/daemon/swarm.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/docker/docker/api/types/swarm" + "github.com/moby/moby/api/types/swarm" "github.com/pkg/errors" "gotest.tools/v3/assert" ) diff --git a/testutil/environment/clean.go b/testutil/environment/clean.go index 7007ed7037..761e97888d 100644 --- a/testutil/environment/clean.go +++ b/testutil/environment/clean.go @@ -6,14 +6,14 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/volume" "github.com/docker/docker/client" "github.com/docker/docker/internal/lazyregexp" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/network" + "github.com/moby/moby/api/types/volume" "go.opentelemetry.io/otel" "gotest.tools/v3/assert" ) diff --git a/testutil/environment/environment.go b/testutil/environment/environment.go index 3dbca241fc..9d74221043 100644 --- a/testutil/environment/environment.go +++ b/testutil/environment/environment.go @@ -8,12 +8,12 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/system" "github.com/docker/docker/client" "github.com/docker/docker/testutil/fixtures/load" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/system" "github.com/pkg/errors" "gotest.tools/v3/assert" ) diff --git a/testutil/environment/protect.go b/testutil/environment/protect.go index fd5aedfa6e..c16caec8fe 100644 --- a/testutil/environment/protect.go +++ b/testutil/environment/protect.go @@ -5,12 +5,12 @@ import ( "testing" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/image" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/volume" "github.com/docker/docker/testutil" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/network" + "github.com/moby/moby/api/types/volume" "go.opentelemetry.io/otel" "gotest.tools/v3/assert" ) diff --git a/testutil/fakestorage/fixtures.go b/testutil/fakestorage/fixtures.go index a40f24fc17..2d718de5d6 100644 --- a/testutil/fakestorage/fixtures.go +++ b/testutil/fakestorage/fixtures.go @@ -9,8 +9,8 @@ import ( "sync" "testing" - "github.com/docker/docker/api/types/build" "github.com/moby/go-archive" + "github.com/moby/moby/api/types/build" "gotest.tools/v3/assert" ) diff --git a/testutil/fakestorage/storage.go b/testutil/fakestorage/storage.go index 901115229c..e09159cb23 100644 --- a/testutil/fakestorage/storage.go +++ b/testutil/fakestorage/storage.go @@ -11,15 +11,15 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types/build" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/image" "github.com/docker/docker/client" "github.com/docker/docker/testutil" "github.com/docker/docker/testutil/environment" "github.com/docker/docker/testutil/fakecontext" "github.com/docker/docker/testutil/request" "github.com/docker/go-connections/nat" + "github.com/moby/moby/api/types/build" + containertypes "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/image" "gotest.tools/v3/assert" ) diff --git a/testutil/fixtures/load/frozen.go b/testutil/fixtures/load/frozen.go index 7ed7f55bff..c78368216c 100644 --- a/testutil/fixtures/load/frozen.go +++ b/testutil/fixtures/load/frozen.go @@ -10,9 +10,9 @@ import ( "strings" "sync" - "github.com/docker/docker/api/types/image" "github.com/docker/docker/client" "github.com/docker/docker/pkg/jsonmessage" + "github.com/moby/moby/api/types/image" "github.com/moby/term" "github.com/pkg/errors" "go.opentelemetry.io/otel" diff --git a/testutil/fixtures/plugin/plugin.go b/testutil/fixtures/plugin/plugin.go index 2556943b40..ba1779bce5 100644 --- a/testutil/fixtures/plugin/plugin.go +++ b/testutil/fixtures/plugin/plugin.go @@ -9,12 +9,12 @@ import ( "path/filepath" "time" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/registry" "github.com/docker/docker/daemon/pkg/plugin" registrypkg "github.com/docker/docker/registry" "github.com/moby/go-archive" + "github.com/moby/moby/api/types" + "github.com/moby/moby/api/types/events" + "github.com/moby/moby/api/types/registry" "github.com/pkg/errors" ) diff --git a/vendor.mod b/vendor.mod index f54907e478..d9ec4025ea 100644 --- a/vendor.mod +++ b/vendor.mod @@ -190,6 +190,7 @@ require ( github.com/klauspost/compress v1.18.0 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/moby/moby/api v0.0.0 github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/opencontainers/runtime-tools v0.9.1-0.20221107090550-2e043c6bd626 // indirect github.com/package-url/packageurl-go v0.1.1 // indirect @@ -261,3 +262,5 @@ exclude ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 ) + +replace github.com/moby/moby/api => ./api diff --git a/vendor/github.com/moby/moby/api/README.md b/vendor/github.com/moby/moby/api/README.md new file mode 100644 index 0000000000..381f19881f --- /dev/null +++ b/vendor/github.com/moby/moby/api/README.md @@ -0,0 +1,42 @@ +# Working on the Engine API + +The Engine API is an HTTP API used by the command-line client to communicate with the daemon. It can also be used by third-party software to control the daemon. + +It consists of various components in this repository: + +- `api/swagger.yaml` A Swagger definition of the API. +- `api/types/` Types shared by both the client and server, representing various objects, options, responses, etc. Most are written manually, but some are automatically generated from the Swagger definition. See [#27919](https://github.com/docker/docker/issues/27919) for progress on this. +- `cli/` The command-line client. +- `client/` The Go client used by the command-line client. It can also be used by third-party Go programs. +- `daemon/` The daemon, which serves the API. + +## Swagger definition + +The API is defined by the [Swagger](http://swagger.io/specification/) definition in `api/swagger.yaml`. This definition can be used to: + +1. Automatically generate documentation. +2. Automatically generate the Go server and client. (A work-in-progress.) +3. Provide a machine readable version of the API for introspecting what it can do, automatically generating clients for other languages, etc. + +## Updating the API documentation + +The API documentation is generated entirely from `api/swagger.yaml`. If you make updates to the API, edit this file to represent the change in the documentation. + +The file is split into two main sections: + +- `definitions`, which defines re-usable objects used in requests and responses +- `paths`, which defines the API endpoints (and some inline objects which don't need to be reusable) + +To make an edit, first look for the endpoint you want to edit under `paths`, then make the required edits. Endpoints may reference reusable objects with `$ref`, which can be found in the `definitions` section. + +There is hopefully enough example material in the file for you to copy a similar pattern from elsewhere in the file (e.g. adding new fields or endpoints), but for the full reference, see the [Swagger specification](https://github.com/docker/docker/issues/27919). + +`swagger.yaml` is validated by `hack/validate/swagger` to ensure it is a valid Swagger definition. This is useful when making edits to ensure you are doing the right thing. + +## Viewing the API documentation + +When you make edits to `swagger.yaml`, you may want to check the generated API documentation to ensure it renders correctly. + +Run `make swagger-docs` and a preview will be running at `http://localhost:9000`. Some of the styling may be incorrect, but you'll be able to ensure that it is generating the correct documentation. + +The production documentation is generated by vendoring `swagger.yaml` into [docker/docker.github.io](https://github.com/docker/docker.github.io). diff --git a/vendor/github.com/moby/moby/api/common.go b/vendor/github.com/moby/moby/api/common.go new file mode 100644 index 0000000000..705641935a --- /dev/null +++ b/vendor/github.com/moby/moby/api/common.go @@ -0,0 +1,22 @@ +package api + +// Common constants for daemon and client. +const ( + // DefaultVersion of the current REST API. + DefaultVersion = "1.52" + + // MinSupportedAPIVersion is the minimum API version that can be supported + // by the API server, specified as "major.minor". Note that the daemon + // may be configured with a different minimum API version, as returned + // in [github.com/docker/docker/api/types.Version.MinAPIVersion]. + // + // API requests for API versions lower than the configured version produce + // an error. + MinSupportedAPIVersion = "1.24" + + // NoBaseImageSpecifier is the symbol used by the FROM + // command to specify that no base image is to be used. + // + // Deprecated: this const is no longer used and will be removed in the next release. + NoBaseImageSpecifier = "scratch" +) diff --git a/vendor/github.com/moby/moby/api/swagger-gen.yaml b/vendor/github.com/moby/moby/api/swagger-gen.yaml new file mode 100644 index 0000000000..f07a02737f --- /dev/null +++ b/vendor/github.com/moby/moby/api/swagger-gen.yaml @@ -0,0 +1,12 @@ + +layout: + models: + - name: definition + source: asset:model + target: "{{ joinFilePath .Target .ModelPackage }}" + file_name: "{{ (snakize (pascalize .Name)) }}.go" + operations: + - name: handler + source: asset:serverOperation + target: "{{ joinFilePath .Target .APIPackage .Package }}" + file_name: "{{ (snakize (pascalize .Name)) }}.go" diff --git a/vendor/github.com/moby/moby/api/swagger.yaml b/vendor/github.com/moby/moby/api/swagger.yaml new file mode 100644 index 0000000000..6bc486be5a --- /dev/null +++ b/vendor/github.com/moby/moby/api/swagger.yaml @@ -0,0 +1,13431 @@ +# A Swagger 2.0 (a.k.a. OpenAPI) definition of the Engine API. +# +# This is used for generating API documentation and the types used by the +# client/server. See api/README.md for more information. +# +# Some style notes: +# - This file is used by ReDoc, which allows GitHub Flavored Markdown in +# descriptions. +# - There is no maximum line length, for ease of editing and pretty diffs. +# - operationIds are in the format "NounVerb", with a singular noun. + +swagger: "2.0" +schemes: + - "http" + - "https" +produces: + - "application/json" + - "text/plain" +consumes: + - "application/json" + - "text/plain" +basePath: "/v1.52" +info: + title: "Docker Engine API" + version: "1.52" + x-logo: + url: "https://docs.docker.com/assets/images/logo-docker-main.png" + description: | + The Engine API is an HTTP API served by Docker Engine. It is the API the + Docker client uses to communicate with the Engine, so everything the Docker + client can do can be done with the API. + + Most of the client's commands map directly to API endpoints (e.g. `docker ps` + is `GET /containers/json`). The notable exception is running containers, + which consists of several API calls. + + # Errors + + The API uses standard HTTP status codes to indicate the success or failure + of the API call. The body of the response will be JSON in the following + format: + + ``` + { + "message": "page not found" + } + ``` + + # Versioning + + The API is usually changed in each release, so API calls are versioned to + ensure that clients don't break. To lock to a specific version of the API, + you prefix the URL with its version, for example, call `/v1.30/info` to use + the v1.30 version of the `/info` endpoint. If the API version specified in + the URL is not supported by the daemon, a HTTP `400 Bad Request` error message + is returned. + + If you omit the version-prefix, the current version of the API (v1.50) is used. + For example, calling `/info` is the same as calling `/v1.52/info`. Using the + API without a version-prefix is deprecated and will be removed in a future release. + + Engine releases in the near future should support this version of the API, + so your client will continue to work even if it is talking to a newer Engine. + + The API uses an open schema model, which means the server may add extra properties + to responses. Likewise, the server will ignore any extra query parameters and + request body properties. When you write clients, you need to ignore additional + properties in responses to ensure they do not break when talking to newer + daemons. + + + # Authentication + + Authentication for registries is handled client side. The client has to send + authentication details to various endpoints that need to communicate with + registries, such as `POST /images/(name)/push`. These are sent as + `X-Registry-Auth` header as a [base64url encoded](https://tools.ietf.org/html/rfc4648#section-5) + (JSON) string with the following structure: + + ``` + { + "username": "string", + "password": "string", + "email": "string", + "serveraddress": "string" + } + ``` + + The `serveraddress` is a domain/IP without a protocol. Throughout this + structure, double quotes are required. + + If you have already got an identity token from the [`/auth` endpoint](#operation/SystemAuth), + you can just pass this instead of credentials: + + ``` + { + "identitytoken": "9cbaf023786cd7..." + } + ``` + +# The tags on paths define the menu sections in the ReDoc documentation, so +# the usage of tags must make sense for that: +# - They should be singular, not plural. +# - There should not be too many tags, or the menu becomes unwieldy. For +# example, it is preferable to add a path to the "System" tag instead of +# creating a tag with a single path in it. +# - The order of tags in this list defines the order in the menu. +tags: + # Primary objects + - name: "Container" + x-displayName: "Containers" + description: | + Create and manage containers. + - name: "Image" + x-displayName: "Images" + - name: "Network" + x-displayName: "Networks" + description: | + Networks are user-defined networks that containers can be attached to. + See the [networking documentation](https://docs.docker.com/network/) + for more information. + - name: "Volume" + x-displayName: "Volumes" + description: | + Create and manage persistent storage that can be attached to containers. + - name: "Exec" + x-displayName: "Exec" + description: | + Run new commands inside running containers. Refer to the + [command-line reference](https://docs.docker.com/engine/reference/commandline/exec/) + for more information. + + To exec a command in a container, you first need to create an exec instance, + then start it. These two API endpoints are wrapped up in a single command-line + command, `docker exec`. + + # Swarm things + - name: "Swarm" + x-displayName: "Swarm" + description: | + Engines can be clustered together in a swarm. Refer to the + [swarm mode documentation](https://docs.docker.com/engine/swarm/) + for more information. + - name: "Node" + x-displayName: "Nodes" + description: | + Nodes are instances of the Engine participating in a swarm. Swarm mode + must be enabled for these endpoints to work. + - name: "Service" + x-displayName: "Services" + description: | + Services are the definitions of tasks to run on a swarm. Swarm mode must + be enabled for these endpoints to work. + - name: "Task" + x-displayName: "Tasks" + description: | + A task is a container running on a swarm. It is the atomic scheduling unit + of swarm. Swarm mode must be enabled for these endpoints to work. + - name: "Secret" + x-displayName: "Secrets" + description: | + Secrets are sensitive data that can be used by services. Swarm mode must + be enabled for these endpoints to work. + - name: "Config" + x-displayName: "Configs" + description: | + Configs are application configurations that can be used by services. Swarm + mode must be enabled for these endpoints to work. + # System things + - name: "Plugin" + x-displayName: "Plugins" + - name: "System" + x-displayName: "System" + +definitions: + Port: + type: "object" + description: "An open port on a container" + required: [PrivatePort, Type] + properties: + IP: + type: "string" + format: "ip-address" + description: "Host IP address that the container's port is mapped to" + PrivatePort: + type: "integer" + format: "uint16" + x-nullable: false + description: "Port on the container" + PublicPort: + type: "integer" + format: "uint16" + description: "Port exposed on the host" + Type: + type: "string" + x-nullable: false + enum: ["tcp", "udp", "sctp"] + example: + PrivatePort: 8080 + PublicPort: 80 + Type: "tcp" + + MountPoint: + type: "object" + description: | + MountPoint represents a mount point configuration inside the container. + This is used for reporting the mountpoints in use by a container. + properties: + Type: + description: | + The mount type: + + - `bind` a mount of a file or directory from the host into the container. + - `volume` a docker volume with the given `Name`. + - `image` a docker image + - `tmpfs` a `tmpfs`. + - `npipe` a named pipe from the host into the container. + - `cluster` a Swarm cluster volume + type: "string" + enum: + - "bind" + - "volume" + - "image" + - "tmpfs" + - "npipe" + - "cluster" + example: "volume" + Name: + description: | + Name is the name reference to the underlying data defined by `Source` + e.g., the volume name. + type: "string" + example: "myvolume" + Source: + description: | + Source location of the mount. + + For volumes, this contains the storage location of the volume (within + `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains + the source (host) part of the bind-mount. For `tmpfs` mount points, this + field is empty. + type: "string" + example: "/var/lib/docker/volumes/myvolume/_data" + Destination: + description: | + Destination is the path relative to the container root (`/`) where + the `Source` is mounted inside the container. + type: "string" + example: "/usr/share/nginx/html/" + Driver: + description: | + Driver is the volume driver used to create the volume (if it is a volume). + type: "string" + example: "local" + Mode: + description: | + Mode is a comma separated list of options supplied by the user when + creating the bind/volume mount. + + The default is platform-specific (`"z"` on Linux, empty on Windows). + type: "string" + example: "z" + RW: + description: | + Whether the mount is mounted writable (read-write). + type: "boolean" + example: true + Propagation: + description: | + Propagation describes how mounts are propagated from the host into the + mount point, and vice-versa. Refer to the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt) + for details. This field is not used on Windows. + type: "string" + example: "" + + DeviceMapping: + type: "object" + description: "A device mapping between the host and container" + properties: + PathOnHost: + type: "string" + PathInContainer: + type: "string" + CgroupPermissions: + type: "string" + example: + PathOnHost: "/dev/deviceName" + PathInContainer: "/dev/deviceName" + CgroupPermissions: "mrw" + + DeviceRequest: + type: "object" + description: "A request for devices to be sent to device drivers" + properties: + Driver: + type: "string" + example: "nvidia" + Count: + type: "integer" + example: -1 + DeviceIDs: + type: "array" + items: + type: "string" + example: + - "0" + - "1" + - "GPU-fef8089b-4820-abfc-e83e-94318197576e" + Capabilities: + description: | + A list of capabilities; an OR list of AND lists of capabilities. + type: "array" + items: + type: "array" + items: + type: "string" + example: + # gpu AND nvidia AND compute + - ["gpu", "nvidia", "compute"] + Options: + description: | + Driver-specific options, specified as a key/value pairs. These options + are passed directly to the driver. + type: "object" + additionalProperties: + type: "string" + + ThrottleDevice: + type: "object" + properties: + Path: + description: "Device path" + type: "string" + Rate: + description: "Rate" + type: "integer" + format: "int64" + minimum: 0 + + Mount: + type: "object" + properties: + Target: + description: "Container path." + type: "string" + Source: + description: "Mount source (e.g. a volume name, a host path)." + type: "string" + Type: + description: | + The mount type. Available types: + + - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. + - `image` Mounts an image. + - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. + - `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container. + - `cluster` a Swarm cluster volume + type: "string" + enum: + - "bind" + - "volume" + - "image" + - "tmpfs" + - "npipe" + - "cluster" + ReadOnly: + description: "Whether the mount should be read-only." + type: "boolean" + Consistency: + description: "The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`." + type: "string" + BindOptions: + description: "Optional configuration for the `bind` type." + type: "object" + properties: + Propagation: + description: "A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`." + type: "string" + enum: + - "private" + - "rprivate" + - "shared" + - "rshared" + - "slave" + - "rslave" + NonRecursive: + description: "Disable recursive bind mount." + type: "boolean" + default: false + CreateMountpoint: + description: "Create mount point on host if missing" + type: "boolean" + default: false + ReadOnlyNonRecursive: + description: | + Make the mount non-recursively read-only, but still leave the mount recursive + (unless NonRecursive is set to `true` in conjunction). + + Added in v1.44, before that version all read-only mounts were + non-recursive by default. To match the previous behaviour this + will default to `true` for clients on versions prior to v1.44. + type: "boolean" + default: false + ReadOnlyForceRecursive: + description: "Raise an error if the mount cannot be made recursively read-only." + type: "boolean" + default: false + VolumeOptions: + description: "Optional configuration for the `volume` type." + type: "object" + properties: + NoCopy: + description: "Populate volume with data from the target." + type: "boolean" + default: false + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + DriverConfig: + description: "Map of driver specific options" + type: "object" + properties: + Name: + description: "Name of the driver to use to create the volume." + type: "string" + Options: + description: "key/value map of driver specific options." + type: "object" + additionalProperties: + type: "string" + Subpath: + description: "Source path inside the volume. Must be relative without any back traversals." + type: "string" + example: "dir-inside-volume/subdirectory" + ImageOptions: + description: "Optional configuration for the `image` type." + type: "object" + properties: + Subpath: + description: "Source path inside the image. Must be relative without any back traversals." + type: "string" + example: "dir-inside-image/subdirectory" + TmpfsOptions: + description: "Optional configuration for the `tmpfs` type." + type: "object" + properties: + SizeBytes: + description: "The size for the tmpfs mount in bytes." + type: "integer" + format: "int64" + Mode: + description: "The permission mode for the tmpfs mount in an integer." + type: "integer" + Options: + description: | + The options to be passed to the tmpfs mount. An array of arrays. + Flag options should be provided as 1-length arrays. Other types + should be provided as as 2-length arrays, where the first item is + the key and the second the value. + type: "array" + items: + type: "array" + minItems: 1 + maxItems: 2 + items: + type: "string" + example: + [["noexec"]] + + RestartPolicy: + description: | + The behavior to apply when the container exits. The default is not to + restart. + + An ever increasing delay (double the previous delay, starting at 100ms) is + added before each restart to prevent flooding the server. + type: "object" + properties: + Name: + type: "string" + description: | + - Empty string means not to restart + - `no` Do not automatically restart + - `always` Always restart + - `unless-stopped` Restart always except when the user has manually stopped the container + - `on-failure` Restart only when the container exit code is non-zero + enum: + - "" + - "no" + - "always" + - "unless-stopped" + - "on-failure" + MaximumRetryCount: + type: "integer" + description: | + If `on-failure` is used, the number of times to retry before giving up. + + Resources: + description: "A container's resources (cgroups config, ulimits, etc)" + type: "object" + properties: + # Applicable to all platforms + CpuShares: + description: | + An integer value representing this container's relative CPU weight + versus other containers. + type: "integer" + Memory: + description: "Memory limit in bytes." + type: "integer" + format: "int64" + default: 0 + # Applicable to UNIX platforms + CgroupParent: + description: | + Path to `cgroups` under which the container's `cgroup` is created. If + the path is not absolute, the path is considered to be relative to the + `cgroups` path of the init process. Cgroups are created if they do not + already exist. + type: "string" + BlkioWeight: + description: "Block IO weight (relative weight)." + type: "integer" + minimum: 0 + maximum: 1000 + BlkioWeightDevice: + description: | + Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + type: "array" + items: + type: "object" + properties: + Path: + type: "string" + Weight: + type: "integer" + minimum: 0 + BlkioDeviceReadBps: + description: | + Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceWriteBps: + description: | + Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceReadIOps: + description: | + Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceWriteIOps: + description: | + Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + CpuPeriod: + description: "The length of a CPU period in microseconds." + type: "integer" + format: "int64" + CpuQuota: + description: | + Microseconds of CPU time that the container can get in a CPU period. + type: "integer" + format: "int64" + CpuRealtimePeriod: + description: | + The length of a CPU real-time period in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + type: "integer" + format: "int64" + CpuRealtimeRuntime: + description: | + The length of a CPU real-time runtime in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + type: "integer" + format: "int64" + CpusetCpus: + description: | + CPUs in which to allow execution (e.g., `0-3`, `0,1`). + type: "string" + example: "0-3" + CpusetMems: + description: | + Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + effective on NUMA systems. + type: "string" + Devices: + description: "A list of devices to add to the container." + type: "array" + items: + $ref: "#/definitions/DeviceMapping" + DeviceCgroupRules: + description: "a list of cgroup rules to apply to the container" + type: "array" + items: + type: "string" + example: "c 13:* rwm" + DeviceRequests: + description: | + A list of requests for devices to be sent to device drivers. + type: "array" + items: + $ref: "#/definitions/DeviceRequest" + KernelMemoryTCP: + description: | + Hard limit for kernel TCP buffer memory (in bytes). Depending on the + OCI runtime in use, this option may be ignored. It is no longer supported + by the default (runc) runtime. + + This field is omitted when empty. + type: "integer" + format: "int64" + MemoryReservation: + description: "Memory soft limit in bytes." + type: "integer" + format: "int64" + MemorySwap: + description: | + Total memory limit (memory + swap). Set as `-1` to enable unlimited + swap. + type: "integer" + format: "int64" + MemorySwappiness: + description: | + Tune a container's memory swappiness behavior. Accepts an integer + between 0 and 100. + type: "integer" + format: "int64" + minimum: 0 + maximum: 100 + NanoCpus: + description: "CPU quota in units of 10-9 CPUs." + type: "integer" + format: "int64" + OomKillDisable: + description: "Disable OOM Killer for the container." + type: "boolean" + Init: + description: | + Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + type: "boolean" + x-nullable: true + PidsLimit: + description: | + Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + to not change. + type: "integer" + format: "int64" + x-nullable: true + Ulimits: + description: | + A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + type: "array" + items: + type: "object" + properties: + Name: + description: "Name of ulimit" + type: "string" + Soft: + description: "Soft limit" + type: "integer" + Hard: + description: "Hard limit" + type: "integer" + # Applicable to Windows + CpuCount: + description: | + The number of usable CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + type: "integer" + format: "int64" + CpuPercent: + description: | + The usable percentage of the available CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + type: "integer" + format: "int64" + IOMaximumIOps: + description: "Maximum IOps for the container system drive (Windows only)" + type: "integer" + format: "int64" + IOMaximumBandwidth: + description: | + Maximum IO in bytes per second for the container system drive + (Windows only). + type: "integer" + format: "int64" + + Limit: + description: | + An object describing a limit on resources which can be requested by a task. + type: "object" + properties: + NanoCPUs: + type: "integer" + format: "int64" + example: 4000000000 + MemoryBytes: + type: "integer" + format: "int64" + example: 8272408576 + Pids: + description: | + Limits the maximum number of PIDs in the container. Set `0` for unlimited. + type: "integer" + format: "int64" + default: 0 + example: 100 + + ResourceObject: + description: | + An object describing the resources which can be advertised by a node and + requested by a task. + type: "object" + properties: + NanoCPUs: + type: "integer" + format: "int64" + example: 4000000000 + MemoryBytes: + type: "integer" + format: "int64" + example: 8272408576 + GenericResources: + $ref: "#/definitions/GenericResources" + + GenericResources: + description: | + User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + type: "array" + items: + type: "object" + properties: + NamedResourceSpec: + type: "object" + properties: + Kind: + type: "string" + Value: + type: "string" + DiscreteResourceSpec: + type: "object" + properties: + Kind: + type: "string" + Value: + type: "integer" + format: "int64" + example: + - DiscreteResourceSpec: + Kind: "SSD" + Value: 3 + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID1" + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID2" + + HealthConfig: + description: "A test to perform to check that the container is healthy." + type: "object" + properties: + Test: + description: | + The test to perform. Possible values are: + + - `[]` inherit healthcheck from image or parent image + - `["NONE"]` disable healthcheck + - `["CMD", args...]` exec arguments directly + - `["CMD-SHELL", command]` run command with system's default shell + type: "array" + items: + type: "string" + Interval: + description: | + The time to wait between checks in nanoseconds. It should be 0 or at + least 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + Timeout: + description: | + The time to wait before considering the check to have hung. It should + be 0 or at least 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + Retries: + description: | + The number of consecutive failures needed to consider a container as + unhealthy. 0 means inherit. + type: "integer" + StartPeriod: + description: | + Start period for the container to initialize before starting + health-retries countdown in nanoseconds. It should be 0 or at least + 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + StartInterval: + description: | + The time to wait between checks in nanoseconds during the start period. + It should be 0 or at least 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + + Health: + description: | + Health stores information about the container's healthcheck results. + type: "object" + x-nullable: true + properties: + Status: + description: | + Status is one of `none`, `starting`, `healthy` or `unhealthy` + + - "none" Indicates there is no healthcheck + - "starting" Starting indicates that the container is not yet ready + - "healthy" Healthy indicates that the container is running correctly + - "unhealthy" Unhealthy indicates that the container has a problem + type: "string" + enum: + - "none" + - "starting" + - "healthy" + - "unhealthy" + example: "healthy" + FailingStreak: + description: "FailingStreak is the number of consecutive failures" + type: "integer" + example: 0 + Log: + type: "array" + description: | + Log contains the last few results (oldest first) + items: + $ref: "#/definitions/HealthcheckResult" + + HealthcheckResult: + description: | + HealthcheckResult stores information about a single run of a healthcheck probe + type: "object" + x-nullable: true + properties: + Start: + description: | + Date and time at which this check started in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "date-time" + example: "2020-01-04T10:44:24.496525531Z" + End: + description: | + Date and time at which this check ended in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2020-01-04T10:45:21.364524523Z" + ExitCode: + description: | + ExitCode meanings: + + - `0` healthy + - `1` unhealthy + - `2` reserved (considered unhealthy) + - other values: error running probe + type: "integer" + example: 0 + Output: + description: "Output from last check" + type: "string" + + HostConfig: + description: "Container configuration that depends on the host we are running on" + allOf: + - $ref: "#/definitions/Resources" + - type: "object" + properties: + # Applicable to all platforms + Binds: + type: "array" + description: | + A list of volume bindings for this container. Each volume binding + is a string in one of these forms: + + - `host-src:container-dest[:options]` to bind-mount a host path + into the container. Both `host-src`, and `container-dest` must + be an _absolute_ path. + - `volume-name:container-dest[:options]` to bind-mount a volume + managed by a volume driver into the container. `container-dest` + must be an _absolute_ path. + + `options` is an optional, comma-delimited list of: + + - `nocopy` disables automatic copying of data from the container + path to the volume. The `nocopy` flag only applies to named volumes. + - `[ro|rw]` mounts a volume read-only or read-write, respectively. + If omitted or set to `rw`, volumes are mounted read-write. + - `[z|Z]` applies SELinux labels to allow or deny multiple containers + to read and write to the same volume. + - `z`: a _shared_ content label is applied to the content. This + label indicates that multiple containers can share the volume + content, for both reading and writing. + - `Z`: a _private unshared_ label is applied to the content. + This label indicates that only the current container can use + a private volume. Labeling systems such as SELinux require + proper labels to be placed on volume content that is mounted + into a container. Without a label, the security system can + prevent a container's processes from using the content. By + default, the labels set by the host operating system are not + modified. + - `[[r]shared|[r]slave|[r]private]` specifies mount + [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). + This only applies to bind-mounted volumes, not internal volumes + or named volumes. Mount propagation requires the source mount + point (the location where the source directory is mounted in the + host operating system) to have the correct propagation properties. + For shared volumes, the source mount point must be set to `shared`. + For slave volumes, the mount must be set to either `shared` or + `slave`. + items: + type: "string" + ContainerIDFile: + type: "string" + description: "Path to a file where the container ID is written" + example: "" + LogConfig: + type: "object" + description: "The logging configuration for this container" + properties: + Type: + description: |- + Name of the logging driver used for the container or "none" + if logging is disabled. + type: "string" + enum: + - "local" + - "json-file" + - "syslog" + - "journald" + - "gelf" + - "fluentd" + - "awslogs" + - "splunk" + - "etwlogs" + - "none" + Config: + description: |- + Driver-specific configuration options for the logging driver. + type: "object" + additionalProperties: + type: "string" + example: + "max-file": "5" + "max-size": "10m" + NetworkMode: + type: "string" + description: | + Network mode to use for this container. Supported standard values + are: `bridge`, `host`, `none`, and `container:`. Any + other value is taken as a custom network's name to which this + container should connect to. + PortBindings: + $ref: "#/definitions/PortMap" + RestartPolicy: + $ref: "#/definitions/RestartPolicy" + AutoRemove: + type: "boolean" + description: | + Automatically remove the container when the container's process + exits. This has no effect if `RestartPolicy` is set. + VolumeDriver: + type: "string" + description: "Driver that this container uses to mount volumes." + VolumesFrom: + type: "array" + description: | + A list of volumes to inherit from another container, specified in + the form `[:]`. + items: + type: "string" + Mounts: + description: | + Specification for mounts to be added to the container. + type: "array" + items: + $ref: "#/definitions/Mount" + ConsoleSize: + type: "array" + description: | + Initial console size, as an `[height, width]` array. + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + Annotations: + type: "object" + description: | + Arbitrary non-identifying metadata attached to container and + provided to the runtime when the container is started. + additionalProperties: + type: "string" + + # Applicable to UNIX platforms + CapAdd: + type: "array" + description: | + A list of kernel capabilities to add to the container. Conflicts + with option 'Capabilities'. + items: + type: "string" + CapDrop: + type: "array" + description: | + A list of kernel capabilities to drop from the container. Conflicts + with option 'Capabilities'. + items: + type: "string" + CgroupnsMode: + type: "string" + enum: + - "private" + - "host" + description: | + cgroup namespace mode for the container. Possible values are: + + - `"private"`: the container runs in its own private cgroup namespace + - `"host"`: use the host system's cgroup namespace + + If not specified, the daemon default is used, which can either be `"private"` + or `"host"`, depending on daemon version, kernel support and configuration. + Dns: + type: "array" + description: "A list of DNS servers for the container to use." + items: + type: "string" + DnsOptions: + type: "array" + description: "A list of DNS options." + items: + type: "string" + DnsSearch: + type: "array" + description: "A list of DNS search domains." + items: + type: "string" + ExtraHosts: + type: "array" + description: | + A list of hostnames/IP mappings to add to the container's `/etc/hosts` + file. Specified in the form `["hostname:IP"]`. + items: + type: "string" + GroupAdd: + type: "array" + description: | + A list of additional groups that the container process will run as. + items: + type: "string" + IpcMode: + type: "string" + description: | + IPC sharing mode for the container. Possible values are: + + - `"none"`: own private IPC namespace, with /dev/shm not mounted + - `"private"`: own private IPC namespace + - `"shareable"`: own private IPC namespace, with a possibility to share it with other containers + - `"container:"`: join another (shareable) container's IPC namespace + - `"host"`: use the host system's IPC namespace + + If not specified, daemon default is used, which can either be `"private"` + or `"shareable"`, depending on daemon version and configuration. + Cgroup: + type: "string" + description: "Cgroup to use for the container." + Links: + type: "array" + description: | + A list of links for the container in the form `container_name:alias`. + items: + type: "string" + OomScoreAdj: + type: "integer" + description: | + An integer value containing the score given to the container in + order to tune OOM killer preferences. + example: 500 + PidMode: + type: "string" + description: | + Set the PID (Process) Namespace mode for the container. It can be + either: + + - `"container:"`: joins another container's PID namespace + - `"host"`: use the host's PID namespace inside the container + Privileged: + type: "boolean" + description: |- + Gives the container full access to the host. + PublishAllPorts: + type: "boolean" + description: | + Allocates an ephemeral host port for all of a container's + exposed ports. + + Ports are de-allocated when the container stops and allocated when + the container starts. The allocated port might be changed when + restarting the container. + + The port is selected from the ephemeral port range that depends on + the kernel. For example, on Linux the range is defined by + `/proc/sys/net/ipv4/ip_local_port_range`. + ReadonlyRootfs: + type: "boolean" + description: "Mount the container's root filesystem as read only." + SecurityOpt: + type: "array" + description: | + A list of string values to customize labels for MLS systems, such + as SELinux. + items: + type: "string" + StorageOpt: + type: "object" + description: | + Storage driver options for this container, in the form `{"size": "120G"}`. + additionalProperties: + type: "string" + Tmpfs: + type: "object" + description: | + A map of container directories which should be replaced by tmpfs + mounts, and their corresponding mount options. For example: + + ``` + { "/run": "rw,noexec,nosuid,size=65536k" } + ``` + additionalProperties: + type: "string" + UTSMode: + type: "string" + description: "UTS namespace to use for the container." + UsernsMode: + type: "string" + description: | + Sets the usernamespace mode for the container when usernamespace + remapping option is enabled. + ShmSize: + type: "integer" + format: "int64" + description: | + Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. + minimum: 0 + Sysctls: + type: "object" + x-nullable: true + description: |- + A list of kernel parameters (sysctls) to set in the container. + + This field is omitted if not set. + additionalProperties: + type: "string" + example: + "net.ipv4.ip_forward": "1" + Runtime: + type: "string" + x-nullable: true + description: |- + Runtime to use with this container. + # Applicable to Windows + Isolation: + type: "string" + description: | + Isolation technology of the container. (Windows only) + enum: + - "default" + - "process" + - "hyperv" + - "" + MaskedPaths: + type: "array" + description: | + The list of paths to be masked inside the container (this overrides + the default set of paths). + items: + type: "string" + example: + - "/proc/asound" + - "/proc/acpi" + - "/proc/kcore" + - "/proc/keys" + - "/proc/latency_stats" + - "/proc/timer_list" + - "/proc/timer_stats" + - "/proc/sched_debug" + - "/proc/scsi" + - "/sys/firmware" + - "/sys/devices/virtual/powercap" + ReadonlyPaths: + type: "array" + description: | + The list of paths to be set as read-only inside the container + (this overrides the default set of paths). + items: + type: "string" + example: + - "/proc/bus" + - "/proc/fs" + - "/proc/irq" + - "/proc/sys" + - "/proc/sysrq-trigger" + + ContainerConfig: + description: | + Configuration for a container that is portable between hosts. + type: "object" + properties: + Hostname: + description: | + The hostname to use for the container, as a valid RFC 1123 hostname. + type: "string" + example: "439f4e91bd1d" + Domainname: + description: | + The domain name to use for the container. + type: "string" + User: + description: |- + Commands run as this user inside the container. If omitted, commands + run as the user specified in the image the container was started from. + + Can be either user-name or UID, and optional group-name or GID, + separated by a colon (`[<:group-name|GID>]`). + type: "string" + example: "123:456" + AttachStdin: + description: "Whether to attach to `stdin`." + type: "boolean" + default: false + AttachStdout: + description: "Whether to attach to `stdout`." + type: "boolean" + default: true + AttachStderr: + description: "Whether to attach to `stderr`." + type: "boolean" + default: true + ExposedPorts: + description: | + An object mapping ports to an empty object in the form: + + `{"/": {}}` + type: "object" + x-nullable: true + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: { + "80/tcp": {}, + "443/tcp": {} + } + Tty: + description: | + Attach standard streams to a TTY, including `stdin` if it is not closed. + type: "boolean" + default: false + OpenStdin: + description: "Open `stdin`" + type: "boolean" + default: false + StdinOnce: + description: "Close `stdin` after one attached client disconnects" + type: "boolean" + default: false + Env: + description: | + A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + type: "array" + items: + type: "string" + example: + - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + Cmd: + description: | + Command to run specified as a string or an array of strings. + type: "array" + items: + type: "string" + example: ["/bin/sh"] + Healthcheck: + $ref: "#/definitions/HealthConfig" + ArgsEscaped: + description: "Command is already escaped (Windows only)" + type: "boolean" + default: false + example: false + x-nullable: true + Image: + description: | + The name (or reference) of the image to use when creating the container, + or which was used when the container was created. + type: "string" + example: "example-image:1.0" + Volumes: + description: | + An object mapping mount point paths inside the container to empty + objects. + type: "object" + additionalProperties: + type: "object" + enum: + - {} + default: {} + WorkingDir: + description: "The working directory for commands to run in." + type: "string" + example: "/public/" + Entrypoint: + description: | + The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + type: "array" + items: + type: "string" + example: [] + NetworkDisabled: + description: "Disable networking for the container." + type: "boolean" + x-nullable: true + MacAddress: + description: | + MAC address of the container. + + Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. + type: "string" + x-nullable: true + OnBuild: + description: | + `ONBUILD` metadata that were defined in the image's `Dockerfile`. + type: "array" + x-nullable: true + items: + type: "string" + example: [] + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + StopSignal: + description: | + Signal to stop a container as a string or unsigned integer. + type: "string" + example: "SIGTERM" + x-nullable: true + StopTimeout: + description: "Timeout to stop a container in seconds." + type: "integer" + default: 10 + x-nullable: true + Shell: + description: | + Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + type: "array" + x-nullable: true + items: + type: "string" + example: ["/bin/sh", "-c"] + + ImageConfig: + description: | + Configuration of the image. These fields are used as defaults + when starting a container from the image. + type: "object" + properties: + User: + description: "The user that commands are run as inside the container." + type: "string" + example: "web:web" + ExposedPorts: + description: | + An object mapping ports to an empty object in the form: + + `{"/": {}}` + type: "object" + x-nullable: true + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: { + "80/tcp": {}, + "443/tcp": {} + } + Env: + description: | + A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + type: "array" + items: + type: "string" + example: + - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + Cmd: + description: | + Command to run specified as a string or an array of strings. + type: "array" + items: + type: "string" + example: ["/bin/sh"] + Healthcheck: + $ref: "#/definitions/HealthConfig" + ArgsEscaped: + description: "Command is already escaped (Windows only)" + type: "boolean" + default: false + example: false + x-nullable: true + Volumes: + description: | + An object mapping mount point paths inside the container to empty + objects. + type: "object" + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: + "/app/data": {} + "/app/config": {} + WorkingDir: + description: "The working directory for commands to run in." + type: "string" + example: "/public/" + Entrypoint: + description: | + The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + type: "array" + items: + type: "string" + example: [] + OnBuild: + description: | + `ONBUILD` metadata that were defined in the image's `Dockerfile`. + type: "array" + x-nullable: true + items: + type: "string" + example: [] + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + StopSignal: + description: | + Signal to stop a container as a string or unsigned integer. + type: "string" + example: "SIGTERM" + x-nullable: true + Shell: + description: | + Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + type: "array" + x-nullable: true + items: + type: "string" + example: ["/bin/sh", "-c"] + # FIXME(thaJeztah): temporarily using a full example to remove some "omitempty" fields. Remove once the fields are removed. + example: + "User": "web:web" + "ExposedPorts": { + "80/tcp": {}, + "443/tcp": {} + } + "Env": ["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"] + "Cmd": ["/bin/sh"] + "Healthcheck": { + "Test": ["string"], + "Interval": 0, + "Timeout": 0, + "Retries": 0, + "StartPeriod": 0, + "StartInterval": 0 + } + "ArgsEscaped": true + "Volumes": { + "/app/data": {}, + "/app/config": {} + } + "WorkingDir": "/public/" + "Entrypoint": [] + "OnBuild": [] + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + "StopSignal": "SIGTERM" + "Shell": ["/bin/sh", "-c"] + + NetworkingConfig: + description: | + NetworkingConfig represents the container's networking configuration for + each of its interfaces. + It is used for the networking configs specified in the `docker create` + and `docker network connect` commands. + type: "object" + properties: + EndpointsConfig: + description: | + A mapping of network name to endpoint configuration for that network. + The endpoint configuration can be left empty to connect to that + network with no particular endpoint configuration. + type: "object" + additionalProperties: + $ref: "#/definitions/EndpointSettings" + example: + # putting an example here, instead of using the example values from + # /definitions/EndpointSettings, because EndpointSettings contains + # operational data returned when inspecting a container that we don't + # accept here. + EndpointsConfig: + isolated_nw: + IPAMConfig: + IPv4Address: "172.20.30.33" + IPv6Address: "2001:db8:abcd::3033" + LinkLocalIPs: + - "169.254.34.68" + - "fe80::3468" + MacAddress: "02:42:ac:12:05:02" + Links: + - "container_1" + - "container_2" + Aliases: + - "server_x" + - "server_y" + database_nw: {} + + NetworkSettings: + description: "NetworkSettings exposes the network settings in the API" + type: "object" + properties: + Bridge: + description: | + Name of the default bridge interface when dockerd's --bridge flag is set. + type: "string" + example: "docker0" + SandboxID: + description: SandboxID uniquely represents a container's network stack. + type: "string" + example: "9d12daf2c33f5959c8bf90aa513e4f65b561738661003029ec84830cd503a0c3" + HairpinMode: + description: | + Indicates if hairpin NAT should be enabled on the virtual interface. + + Deprecated: This field is never set and will be removed in a future release. + type: "boolean" + example: false + LinkLocalIPv6Address: + description: | + IPv6 unicast address using the link-local prefix. + + Deprecated: This field is never set and will be removed in a future release. + type: "string" + example: "" + LinkLocalIPv6PrefixLen: + description: | + Prefix length of the IPv6 unicast address. + + Deprecated: This field is never set and will be removed in a future release. + type: "integer" + example: "" + Ports: + $ref: "#/definitions/PortMap" + SandboxKey: + description: SandboxKey is the full path of the netns handle + type: "string" + example: "/var/run/docker/netns/8ab54b426c38" + + SecondaryIPAddresses: + description: "Deprecated: This field is never set and will be removed in a future release." + type: "array" + items: + $ref: "#/definitions/Address" + x-nullable: true + + SecondaryIPv6Addresses: + description: "Deprecated: This field is never set and will be removed in a future release." + type: "array" + items: + $ref: "#/definitions/Address" + x-nullable: true + + # TODO properties below are part of DefaultNetworkSettings, which is + # marked as deprecated since Docker 1.9 and to be removed in Docker v17.12 + EndpointID: + description: | + EndpointID uniquely represents a service endpoint in a Sandbox. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + Gateway: + description: | + Gateway address for the default "bridge" network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "172.17.0.1" + GlobalIPv6Address: + description: | + Global IPv6 address for the default "bridge" network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "2001:db8::5689" + GlobalIPv6PrefixLen: + description: | + Mask length of the global IPv6 address. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "integer" + example: 64 + IPAddress: + description: | + IPv4 address for the default "bridge" network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "172.17.0.4" + IPPrefixLen: + description: | + Mask length of the IPv4 address. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "integer" + example: 16 + IPv6Gateway: + description: | + IPv6 gateway address for this network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "2001:db8:2::100" + MacAddress: + description: | + MAC address for the container on the default "bridge" network. + +


+ + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "02:42:ac:11:00:04" + Networks: + description: | + Information about all networks that the container is connected to. + type: "object" + additionalProperties: + $ref: "#/definitions/EndpointSettings" + + Address: + description: Address represents an IPv4 or IPv6 IP address. + type: "object" + properties: + Addr: + description: IP address. + type: "string" + PrefixLen: + description: Mask length of the IP address. + type: "integer" + + PortMap: + description: | + PortMap describes the mapping of container ports to host ports, using the + container's port-number and protocol as key in the format `/`, + for example, `80/udp`. + + If a container's port is mapped for multiple protocols, separate entries + are added to the mapping table. + type: "object" + additionalProperties: + type: "array" + x-nullable: true + items: + $ref: "#/definitions/PortBinding" + example: + "443/tcp": + - HostIp: "127.0.0.1" + HostPort: "4443" + "80/tcp": + - HostIp: "0.0.0.0" + HostPort: "80" + - HostIp: "0.0.0.0" + HostPort: "8080" + "80/udp": + - HostIp: "0.0.0.0" + HostPort: "80" + "53/udp": + - HostIp: "0.0.0.0" + HostPort: "53" + "2377/tcp": null + + PortBinding: + description: | + PortBinding represents a binding between a host IP address and a host + port. + type: "object" + properties: + HostIp: + description: "Host IP address that the container's port is mapped to." + type: "string" + example: "127.0.0.1" + HostPort: + description: "Host port number that the container's port is mapped to." + type: "string" + example: "4443" + + DriverData: + description: | + Information about the storage driver used to store the container's and + image's filesystem. + type: "object" + required: [Name, Data] + properties: + Name: + description: "Name of the storage driver." + type: "string" + x-nullable: false + example: "overlay2" + Data: + description: | + Low-level storage metadata, provided as key/value pairs. + + This information is driver-specific, and depends on the storage-driver + in use, and should be used for informational purposes only. + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: { + "MergedDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/merged", + "UpperDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/diff", + "WorkDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/work" + } + + FilesystemChange: + description: | + Change in the container's filesystem. + type: "object" + required: [Path, Kind] + properties: + Path: + description: | + Path to file or directory that has changed. + type: "string" + x-nullable: false + Kind: + $ref: "#/definitions/ChangeType" + + ChangeType: + description: | + Kind of change + + Can be one of: + + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") + type: "integer" + format: "uint8" + enum: [0, 1, 2] + x-nullable: false + + ImageInspect: + description: | + Information about an image in the local image cache. + type: "object" + properties: + Id: + description: | + ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + type: "string" + x-nullable: false + example: "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + Descriptor: + description: | + Descriptor is an OCI descriptor of the image target. + In case of a multi-platform image, this descriptor points to the OCI index + or a manifest list. + + This field is only present if the daemon provides a multi-platform image store. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + x-nullable: true + $ref: "#/definitions/OCIDescriptor" + Manifests: + description: | + Manifests is a list of image manifests available in this image. It + provides a more detailed view of the platform-specific image manifests or + other image-attached data like build attestations. + + Only available if the daemon provides a multi-platform image store + and the `manifests` option is set in the inspect request. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + type: "array" + x-nullable: true + items: + $ref: "#/definitions/ImageManifestSummary" + RepoTags: + description: | + List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + type: "array" + items: + type: "string" + example: + - "example:1.0" + - "example:latest" + - "example:stable" + - "internal.registry.example.com:5000/example:1.0" + RepoDigests: + description: | + List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + type: "array" + items: + type: "string" + example: + - "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb" + - "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + Parent: + description: | + ID of the parent image. + + Depending on how the image was created, this field may be empty and + is only set for images that were built/created locally. This field + is empty if the image was pulled from an image registry. + type: "string" + x-nullable: false + example: "" + Comment: + description: | + Optional message that was set when committing or importing the image. + type: "string" + x-nullable: false + example: "" + Created: + description: | + Date and time at which the image was created, formatted in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if present in the image, + and omitted otherwise. + type: "string" + format: "dateTime" + x-nullable: true + example: "2022-02-04T21:20:12.497794809Z" + DockerVersion: + description: | + The version of Docker that was used to build the image. + + Depending on how the image was created, this field may be empty. + type: "string" + x-nullable: false + example: "27.0.1" + Author: + description: | + Name of the author that was specified when committing the image, or as + specified through MAINTAINER (deprecated) in the Dockerfile. + type: "string" + x-nullable: false + example: "" + Config: + $ref: "#/definitions/ImageConfig" + Architecture: + description: | + Hardware CPU architecture that the image runs on. + type: "string" + x-nullable: false + example: "arm" + Variant: + description: | + CPU architecture variant (presently ARM-only). + type: "string" + x-nullable: true + example: "v7" + Os: + description: | + Operating System the image is built to run on. + type: "string" + x-nullable: false + example: "linux" + OsVersion: + description: | + Operating System version the image is built to run on (especially + for Windows). + type: "string" + example: "" + x-nullable: true + Size: + description: | + Total size of the image including all layers it is composed of. + type: "integer" + format: "int64" + x-nullable: false + example: 1239828 + VirtualSize: + description: | + Total size of the image including all layers it is composed of. + + Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. + type: "integer" + format: "int64" + example: 1239828 + GraphDriver: + $ref: "#/definitions/DriverData" + RootFS: + description: | + Information about the image's RootFS, including the layer IDs. + type: "object" + required: [Type] + properties: + Type: + type: "string" + x-nullable: false + example: "layers" + Layers: + type: "array" + items: + type: "string" + example: + - "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6" + - "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" + Metadata: + description: | + Additional metadata of the image in the local cache. This information + is local to the daemon, and not part of the image itself. + type: "object" + properties: + LastTagTime: + description: | + Date and time at which the image was last tagged in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if the image was tagged locally, + and omitted otherwise. + type: "string" + format: "dateTime" + example: "2022-02-28T14:40:02.623929178Z" + x-nullable: true + + ImageSummary: + type: "object" + x-go-name: "Summary" + required: + - Id + - ParentId + - RepoTags + - RepoDigests + - Created + - Size + - SharedSize + - Labels + - Containers + properties: + Id: + description: | + ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + type: "string" + x-nullable: false + example: "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + ParentId: + description: | + ID of the parent image. + + Depending on how the image was created, this field may be empty and + is only set for images that were built/created locally. This field + is empty if the image was pulled from an image registry. + type: "string" + x-nullable: false + example: "" + RepoTags: + description: | + List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + type: "array" + x-nullable: false + items: + type: "string" + example: + - "example:1.0" + - "example:latest" + - "example:stable" + - "internal.registry.example.com:5000/example:1.0" + RepoDigests: + description: | + List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + type: "array" + x-nullable: false + items: + type: "string" + example: + - "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb" + - "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + Created: + description: | + Date and time at which the image was created as a Unix timestamp + (number of seconds since EPOCH). + type: "integer" + x-nullable: false + example: "1644009612" + Size: + description: | + Total size of the image including all layers it is composed of. + type: "integer" + format: "int64" + x-nullable: false + example: 172064416 + SharedSize: + description: | + Total size of image layers that are shared between this image and other + images. + + This size is not calculated by default. `-1` indicates that the value + has not been set / calculated. + type: "integer" + format: "int64" + x-nullable: false + example: 1239828 + VirtualSize: + description: |- + Total size of the image including all layers it is composed of. + + Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. + type: "integer" + format: "int64" + example: 172064416 + Labels: + description: "User-defined key/value metadata." + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Containers: + description: | + Number of containers using this image. Includes both stopped and running + containers. + + `-1` indicates that the value has not been set / calculated. + x-nullable: false + type: "integer" + example: 2 + Manifests: + description: | + Manifests is a list of manifests available in this image. + It provides a more detailed view of the platform-specific image manifests + or other image-attached data like build attestations. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + type: "array" + x-nullable: false + x-omitempty: true + items: + $ref: "#/definitions/ImageManifestSummary" + Descriptor: + description: | + Descriptor is an OCI descriptor of the image target. + In case of a multi-platform image, this descriptor points to the OCI index + or a manifest list. + + This field is only present if the daemon provides a multi-platform image store. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + x-nullable: true + $ref: "#/definitions/OCIDescriptor" + + AuthConfig: + type: "object" + properties: + username: + type: "string" + password: + type: "string" + email: + type: "string" + serveraddress: + type: "string" + example: + username: "hannibal" + password: "xxxx" + serveraddress: "https://index.docker.io/v1/" + + ProcessConfig: + type: "object" + properties: + privileged: + type: "boolean" + user: + type: "string" + tty: + type: "boolean" + entrypoint: + type: "string" + arguments: + type: "array" + items: + type: "string" + + Volume: + type: "object" + required: [Name, Driver, Mountpoint, Labels, Scope, Options] + properties: + Name: + type: "string" + description: "Name of the volume." + x-nullable: false + example: "tardis" + Driver: + type: "string" + description: "Name of the volume driver used by the volume." + x-nullable: false + example: "custom" + Mountpoint: + type: "string" + description: "Mount path of the volume on the host." + x-nullable: false + example: "/var/lib/docker/volumes/tardis" + CreatedAt: + type: "string" + format: "dateTime" + description: "Date/Time the volume was created." + example: "2016-06-07T20:31:11.853781916Z" + Status: + type: "object" + description: | + Low-level details about the volume, provided by the volume driver. + Details are returned as a map with key/value pairs: + `{"key":"value","key2":"value2"}`. + + The `Status` field is optional, and is omitted if the volume driver + does not support this feature. + additionalProperties: + type: "object" + example: + hello: "world" + Labels: + type: "object" + description: "User-defined key/value metadata." + x-nullable: false + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Scope: + type: "string" + description: | + The level at which the volume exists. Either `global` for cluster-wide, + or `local` for machine level. + default: "local" + x-nullable: false + enum: ["local", "global"] + example: "local" + ClusterVolume: + $ref: "#/definitions/ClusterVolume" + Options: + type: "object" + description: | + The driver specific options used when creating the volume. + additionalProperties: + type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" + UsageData: + type: "object" + x-nullable: true + x-go-name: "UsageData" + required: [Size, RefCount] + description: | + Usage details about the volume. This information is used by the + `GET /system/df` endpoint, and omitted in other endpoints. + properties: + Size: + type: "integer" + format: "int64" + default: -1 + description: | + Amount of disk space used by the volume (in bytes). This information + is only available for volumes created with the `"local"` volume + driver. For volumes created with other volume drivers, this field + is set to `-1` ("not available") + x-nullable: false + RefCount: + type: "integer" + format: "int64" + default: -1 + description: | + The number of containers referencing this volume. This field + is set to `-1` if the reference-count is not available. + x-nullable: false + + VolumeCreateOptions: + description: "Volume configuration" + type: "object" + title: "VolumeConfig" + x-go-name: "CreateOptions" + properties: + Name: + description: | + The new volume's name. If not specified, Docker generates a name. + type: "string" + x-nullable: false + example: "tardis" + Driver: + description: "Name of the volume driver to use." + type: "string" + default: "local" + x-nullable: false + example: "custom" + DriverOpts: + description: | + A mapping of driver options and values. These options are + passed directly to the driver and are driver specific. + type: "object" + additionalProperties: + type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + ClusterVolumeSpec: + $ref: "#/definitions/ClusterVolumeSpec" + + VolumeListResponse: + type: "object" + title: "VolumeListResponse" + x-go-name: "ListResponse" + description: "Volume list response" + properties: + Volumes: + type: "array" + description: "List of volumes" + items: + $ref: "#/definitions/Volume" + Warnings: + type: "array" + description: | + Warnings that occurred when fetching the list of volumes. + items: + type: "string" + example: [] + + Network: + type: "object" + properties: + Name: + description: | + Name of the network. + type: "string" + example: "my_network" + Id: + description: | + ID that uniquely identifies a network on a single machine. + type: "string" + example: "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99" + Created: + description: | + Date and time at which the network was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-10-19T04:33:30.360899459Z" + Scope: + description: | + The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level) + type: "string" + example: "local" + Driver: + description: | + The name of the driver used to create the network (e.g. `bridge`, + `overlay`). + type: "string" + example: "overlay" + EnableIPv4: + description: | + Whether the network was created with IPv4 enabled. + type: "boolean" + example: true + EnableIPv6: + description: | + Whether the network was created with IPv6 enabled. + type: "boolean" + example: false + IPAM: + $ref: "#/definitions/IPAM" + Internal: + description: | + Whether the network is created to only allow internal networking + connectivity. + type: "boolean" + default: false + example: false + Attachable: + description: | + Whether a global / swarm scope network is manually attachable by regular + containers from workers in swarm mode. + type: "boolean" + default: false + example: false + Ingress: + description: | + Whether the network is providing the routing-mesh for the swarm cluster. + type: "boolean" + default: false + example: false + ConfigFrom: + $ref: "#/definitions/ConfigReference" + ConfigOnly: + description: | + Whether the network is a config-only network. Config-only networks are + placeholder networks for network configurations to be used by other + networks. Config-only networks cannot be used directly to run containers + or services. + type: "boolean" + default: false + Containers: + description: | + Contains endpoints attached to the network. + type: "object" + additionalProperties: + $ref: "#/definitions/NetworkContainer" + example: + 19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c: + Name: "test" + EndpointID: "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a" + MacAddress: "02:42:ac:13:00:02" + IPv4Address: "172.19.0.2/16" + IPv6Address: "" + Options: + description: | + Network-specific options uses when creating the network. + type: "object" + additionalProperties: + type: "string" + example: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Peers: + description: | + List of peer nodes for an overlay network. This field is only present + for overlay networks, and omitted for other network types. + type: "array" + items: + $ref: "#/definitions/PeerInfo" + x-nullable: true + # TODO: Add Services (only present when "verbose" is set). + + ConfigReference: + description: | + The config-only network source to provide the configuration for + this network. + type: "object" + properties: + Network: + description: | + The name of the config-only network that provides the network's + configuration. The specified network must be an existing config-only + network. Only network names are allowed, not network IDs. + type: "string" + example: "config_only_network_01" + + IPAM: + type: "object" + properties: + Driver: + description: "Name of the IPAM driver to use." + type: "string" + default: "default" + example: "default" + Config: + description: | + List of IPAM configuration options, specified as a map: + + ``` + {"Subnet": , "IPRange": , "Gateway": , "AuxAddress": } + ``` + type: "array" + items: + $ref: "#/definitions/IPAMConfig" + Options: + description: "Driver-specific options, specified as a map." + type: "object" + additionalProperties: + type: "string" + example: + foo: "bar" + + IPAMConfig: + type: "object" + properties: + Subnet: + type: "string" + example: "172.20.0.0/16" + IPRange: + type: "string" + example: "172.20.10.0/24" + Gateway: + type: "string" + example: "172.20.10.11" + AuxiliaryAddresses: + type: "object" + additionalProperties: + type: "string" + + NetworkContainer: + type: "object" + properties: + Name: + type: "string" + example: "container_1" + EndpointID: + type: "string" + example: "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a" + MacAddress: + type: "string" + example: "02:42:ac:13:00:02" + IPv4Address: + type: "string" + example: "172.19.0.2/16" + IPv6Address: + type: "string" + example: "" + + PeerInfo: + description: | + PeerInfo represents one peer of an overlay network. + type: "object" + properties: + Name: + description: + ID of the peer-node in the Swarm cluster. + type: "string" + example: "6869d7c1732b" + IP: + description: + IP-address of the peer-node in the Swarm cluster. + type: "string" + example: "10.133.77.91" + + NetworkCreateResponse: + description: "OK response to NetworkCreate operation" + type: "object" + title: "NetworkCreateResponse" + x-go-name: "CreateResponse" + required: [Id, Warning] + properties: + Id: + description: "The ID of the created network." + type: "string" + x-nullable: false + example: "b5c4fc71e8022147cd25de22b22173de4e3b170134117172eb595cb91b4e7e5d" + Warning: + description: "Warnings encountered when creating the container" + type: "string" + x-nullable: false + example: "" + + BuildInfo: + type: "object" + properties: + id: + type: "string" + stream: + type: "string" + error: + type: "string" + x-nullable: true + description: |- + errors encountered during the operation. + + + > **Deprecated**: This field is deprecated since API v1.4, and will be omitted in a future API version. Use the information in errorDetail instead. + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progress: + type: "string" + x-nullable: true + description: |- + Progress is a pre-formatted presentation of progressDetail. + + + > **Deprecated**: This field is deprecated since API v1.8, and will be omitted in a future API version. Use the information in progressDetail instead. + progressDetail: + $ref: "#/definitions/ProgressDetail" + aux: + $ref: "#/definitions/ImageID" + + BuildCache: + type: "object" + description: | + BuildCache contains information about a build cache record. + properties: + ID: + type: "string" + description: | + Unique ID of the build cache record. + example: "ndlpt0hhvkqcdfkputsk4cq9c" + Parent: + description: | + ID of the parent build cache record. + + > **Deprecated**: This field is deprecated, and omitted if empty. + type: "string" + x-nullable: true + example: "" + Parents: + description: | + List of parent build cache record IDs. + type: "array" + items: + type: "string" + x-nullable: true + example: ["hw53o5aio51xtltp5xjp8v7fx"] + Type: + type: "string" + description: | + Cache record type. + example: "regular" + # see https://github.com/moby/buildkit/blob/fce4a32258dc9d9664f71a4831d5de10f0670677/client/diskusage.go#L75-L84 + enum: + - "internal" + - "frontend" + - "source.local" + - "source.git.checkout" + - "exec.cachemount" + - "regular" + Description: + type: "string" + description: | + Description of the build-step that produced the build cache. + example: "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache" + InUse: + type: "boolean" + description: | + Indicates if the build cache is in use. + example: false + Shared: + type: "boolean" + description: | + Indicates if the build cache is shared. + example: true + Size: + description: | + Amount of disk space used by the build cache (in bytes). + type: "integer" + example: 51 + CreatedAt: + description: | + Date and time at which the build cache was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + LastUsedAt: + description: | + Date and time at which the build cache was last used in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + x-nullable: true + example: "2017-08-09T07:09:37.632105588Z" + UsageCount: + type: "integer" + example: 26 + + ImageID: + type: "object" + description: "Image ID or Digest" + properties: + ID: + type: "string" + example: + ID: "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c" + + CreateImageInfo: + type: "object" + properties: + id: + type: "string" + error: + type: "string" + x-nullable: true + description: |- + errors encountered during the operation. + + + > **Deprecated**: This field is deprecated since API v1.4, and will be omitted in a future API version. Use the information in errorDetail instead. + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progress: + type: "string" + x-nullable: true + description: |- + Progress is a pre-formatted presentation of progressDetail. + + + > **Deprecated**: This field is deprecated since API v1.8, and will be omitted in a future API version. Use the information in progressDetail instead. + progressDetail: + $ref: "#/definitions/ProgressDetail" + + PushImageInfo: + type: "object" + properties: + error: + type: "string" + x-nullable: true + description: |- + errors encountered during the operation. + + + > **Deprecated**: This field is deprecated since API v1.4, and will be omitted in a future API version. Use the information in errorDetail instead. + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progress: + type: "string" + x-nullable: true + description: |- + Progress is a pre-formatted presentation of progressDetail. + + + > **Deprecated**: This field is deprecated since API v1.8, and will be omitted in a future API version. Use the information in progressDetail instead. + progressDetail: + $ref: "#/definitions/ProgressDetail" + + DeviceInfo: + type: "object" + description: | + DeviceInfo represents a device that can be used by a container. + properties: + Source: + type: "string" + example: "cdi" + description: | + The origin device driver. + ID: + type: "string" + example: "vendor.com/gpu=0" + description: | + The unique identifier for the device within its source driver. + For CDI devices, this would be an FQDN like "vendor.com/gpu=0". + + ErrorDetail: + type: "object" + properties: + code: + type: "integer" + message: + type: "string" + + ProgressDetail: + type: "object" + properties: + current: + type: "integer" + total: + type: "integer" + + ErrorResponse: + description: "Represents an error." + type: "object" + required: ["message"] + properties: + message: + description: "The error message." + type: "string" + x-nullable: false + example: + message: "Something went wrong." + + IDResponse: + description: "Response to an API call that returns just an Id" + type: "object" + x-go-name: "IDResponse" + required: ["Id"] + properties: + Id: + description: "The id of the newly created object." + type: "string" + x-nullable: false + + EndpointSettings: + description: "Configuration for a network endpoint." + type: "object" + properties: + # Configurations + IPAMConfig: + $ref: "#/definitions/EndpointIPAMConfig" + Links: + type: "array" + items: + type: "string" + example: + - "container_1" + - "container_2" + MacAddress: + description: | + MAC address for the endpoint on this network. The network driver might ignore this parameter. + type: "string" + example: "02:42:ac:11:00:04" + Aliases: + type: "array" + items: + type: "string" + example: + - "server_x" + - "server_y" + DriverOpts: + description: | + DriverOpts is a mapping of driver options and values. These options + are passed directly to the driver and are driver specific. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + GwPriority: + description: | + This property determines which endpoint will provide the default + gateway for a container. The endpoint with the highest priority will + be used. If multiple endpoints have the same priority, endpoints are + lexicographically sorted based on their network name, and the one + that sorts first is picked. + type: "integer" + format: "int64" + example: + - 10 + + # Operational data + NetworkID: + description: | + Unique ID of the network. + type: "string" + example: "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a" + EndpointID: + description: | + Unique ID for the service endpoint in a Sandbox. + type: "string" + example: "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + Gateway: + description: | + Gateway address for this network. + type: "string" + example: "172.17.0.1" + IPAddress: + description: | + IPv4 address. + type: "string" + example: "172.17.0.4" + IPPrefixLen: + description: | + Mask length of the IPv4 address. + type: "integer" + example: 16 + IPv6Gateway: + description: | + IPv6 gateway address. + type: "string" + example: "2001:db8:2::100" + GlobalIPv6Address: + description: | + Global IPv6 address. + type: "string" + example: "2001:db8::5689" + GlobalIPv6PrefixLen: + description: | + Mask length of the global IPv6 address. + type: "integer" + format: "int64" + example: 64 + DNSNames: + description: | + List of all DNS names an endpoint has on a specific network. This + list is based on the container name, network aliases, container short + ID, and hostname. + + These DNS names are non-fully qualified but can contain several dots. + You can get fully qualified DNS names by appending `.`. + For instance, if container name is `my.ctr` and the network is named + `testnet`, `DNSNames` will contain `my.ctr` and the FQDN will be + `my.ctr.testnet`. + type: array + items: + type: string + example: ["foobar", "server_x", "server_y", "my.ctr"] + + EndpointIPAMConfig: + description: | + EndpointIPAMConfig represents an endpoint's IPAM configuration. + type: "object" + x-nullable: true + properties: + IPv4Address: + type: "string" + example: "172.20.30.33" + IPv6Address: + type: "string" + example: "2001:db8:abcd::3033" + LinkLocalIPs: + type: "array" + items: + type: "string" + example: + - "169.254.34.68" + - "fe80::3468" + + PluginMount: + type: "object" + x-nullable: false + required: [Name, Description, Settable, Source, Destination, Type, Options] + properties: + Name: + type: "string" + x-nullable: false + example: "some-mount" + Description: + type: "string" + x-nullable: false + example: "This is a mount that's used by the plugin." + Settable: + type: "array" + items: + type: "string" + Source: + type: "string" + example: "/var/lib/docker/plugins/" + Destination: + type: "string" + x-nullable: false + example: "/mnt/state" + Type: + type: "string" + x-nullable: false + example: "bind" + Options: + type: "array" + items: + type: "string" + example: + - "rbind" + - "rw" + + PluginDevice: + type: "object" + required: [Name, Description, Settable, Path] + x-nullable: false + properties: + Name: + type: "string" + x-nullable: false + Description: + type: "string" + x-nullable: false + Settable: + type: "array" + items: + type: "string" + Path: + type: "string" + example: "/dev/fuse" + + PluginEnv: + type: "object" + x-nullable: false + required: [Name, Description, Settable, Value] + properties: + Name: + x-nullable: false + type: "string" + Description: + x-nullable: false + type: "string" + Settable: + type: "array" + items: + type: "string" + Value: + type: "string" + + PluginInterfaceType: + type: "object" + x-nullable: false + required: [Prefix, Capability, Version] + properties: + Prefix: + type: "string" + x-nullable: false + Capability: + type: "string" + x-nullable: false + Version: + type: "string" + x-nullable: false + + PluginPrivilege: + description: | + Describes a permission the user has to accept upon installing + the plugin. + type: "object" + x-go-name: "PluginPrivilege" + properties: + Name: + type: "string" + example: "network" + Description: + type: "string" + Value: + type: "array" + items: + type: "string" + example: + - "host" + + Plugin: + description: "A plugin for the Engine API" + type: "object" + required: [Settings, Enabled, Config, Name] + properties: + Id: + type: "string" + example: "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078" + Name: + type: "string" + x-nullable: false + example: "tiborvass/sample-volume-plugin" + Enabled: + description: + True if the plugin is running. False if the plugin is not running, + only installed. + type: "boolean" + x-nullable: false + example: true + Settings: + description: "Settings that can be modified by users." + type: "object" + x-nullable: false + required: [Args, Devices, Env, Mounts] + properties: + Mounts: + type: "array" + items: + $ref: "#/definitions/PluginMount" + Env: + type: "array" + items: + type: "string" + example: + - "DEBUG=0" + Args: + type: "array" + items: + type: "string" + Devices: + type: "array" + items: + $ref: "#/definitions/PluginDevice" + PluginReference: + description: "plugin remote reference used to push/pull the plugin" + type: "string" + x-nullable: false + example: "localhost:5000/tiborvass/sample-volume-plugin:latest" + Config: + description: "The config of a plugin." + type: "object" + x-nullable: false + required: + - Description + - Documentation + - Interface + - Entrypoint + - WorkDir + - Network + - Linux + - PidHost + - PropagatedMount + - IpcHost + - Mounts + - Env + - Args + properties: + DockerVersion: + description: "Docker Version used to create the plugin" + type: "string" + x-nullable: false + example: "17.06.0-ce" + Description: + type: "string" + x-nullable: false + example: "A sample volume plugin for Docker" + Documentation: + type: "string" + x-nullable: false + example: "https://docs.docker.com/engine/extend/plugins/" + Interface: + description: "The interface between Docker and the plugin" + x-nullable: false + type: "object" + required: [Types, Socket] + properties: + Types: + type: "array" + items: + $ref: "#/definitions/PluginInterfaceType" + example: + - "docker.volumedriver/1.0" + Socket: + type: "string" + x-nullable: false + example: "plugins.sock" + ProtocolScheme: + type: "string" + example: "some.protocol/v1.0" + description: "Protocol to use for clients connecting to the plugin." + enum: + - "" + - "moby.plugins.http/v1" + Entrypoint: + type: "array" + items: + type: "string" + example: + - "/usr/bin/sample-volume-plugin" + - "/data" + WorkDir: + type: "string" + x-nullable: false + example: "/bin/" + User: + type: "object" + x-nullable: false + properties: + UID: + type: "integer" + format: "uint32" + example: 1000 + GID: + type: "integer" + format: "uint32" + example: 1000 + Network: + type: "object" + x-nullable: false + required: [Type] + properties: + Type: + x-nullable: false + type: "string" + example: "host" + Linux: + type: "object" + x-nullable: false + required: [Capabilities, AllowAllDevices, Devices] + properties: + Capabilities: + type: "array" + items: + type: "string" + example: + - "CAP_SYS_ADMIN" + - "CAP_SYSLOG" + AllowAllDevices: + type: "boolean" + x-nullable: false + example: false + Devices: + type: "array" + items: + $ref: "#/definitions/PluginDevice" + PropagatedMount: + type: "string" + x-nullable: false + example: "/mnt/volumes" + IpcHost: + type: "boolean" + x-nullable: false + example: false + PidHost: + type: "boolean" + x-nullable: false + example: false + Mounts: + type: "array" + items: + $ref: "#/definitions/PluginMount" + Env: + type: "array" + items: + $ref: "#/definitions/PluginEnv" + example: + - Name: "DEBUG" + Description: "If set, prints debug messages" + Settable: null + Value: "0" + Args: + type: "object" + x-nullable: false + required: [Name, Description, Settable, Value] + properties: + Name: + x-nullable: false + type: "string" + example: "args" + Description: + x-nullable: false + type: "string" + example: "command line arguments" + Settable: + type: "array" + items: + type: "string" + Value: + type: "array" + items: + type: "string" + rootfs: + type: "object" + properties: + type: + type: "string" + example: "layers" + diff_ids: + type: "array" + items: + type: "string" + example: + - "sha256:675532206fbf3030b8458f88d6e26d4eb1577688a25efec97154c94e8b6b4887" + - "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8" + + ObjectVersion: + description: | + The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + type: "object" + properties: + Index: + type: "integer" + format: "uint64" + example: 373531 + + NodeSpec: + type: "object" + properties: + Name: + description: "Name for the node." + type: "string" + example: "my-node" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Role: + description: "Role of the node." + type: "string" + enum: + - "worker" + - "manager" + example: "manager" + Availability: + description: "Availability of the node." + type: "string" + enum: + - "active" + - "pause" + - "drain" + example: "active" + example: + Availability: "active" + Name: "node-name" + Role: "manager" + Labels: + foo: "bar" + + Node: + type: "object" + properties: + ID: + type: "string" + example: "24ifsmvkjbyhk" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + description: | + Date and time at which the node was added to the swarm in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + UpdatedAt: + description: | + Date and time at which the node was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2017-08-09T07:09:37.632105588Z" + Spec: + $ref: "#/definitions/NodeSpec" + Description: + $ref: "#/definitions/NodeDescription" + Status: + $ref: "#/definitions/NodeStatus" + ManagerStatus: + $ref: "#/definitions/ManagerStatus" + + NodeDescription: + description: | + NodeDescription encapsulates the properties of the Node as reported by the + agent. + type: "object" + properties: + Hostname: + type: "string" + example: "bf3067039e47" + Platform: + $ref: "#/definitions/Platform" + Resources: + $ref: "#/definitions/ResourceObject" + Engine: + $ref: "#/definitions/EngineDescription" + TLSInfo: + $ref: "#/definitions/TLSInfo" + + Platform: + description: | + Platform represents the platform (Arch/OS). + type: "object" + properties: + Architecture: + description: | + Architecture represents the hardware architecture (for example, + `x86_64`). + type: "string" + example: "x86_64" + OS: + description: | + OS represents the Operating System (for example, `linux` or `windows`). + type: "string" + example: "linux" + + EngineDescription: + description: "EngineDescription provides information about an engine." + type: "object" + properties: + EngineVersion: + type: "string" + example: "17.06.0" + Labels: + type: "object" + additionalProperties: + type: "string" + example: + foo: "bar" + Plugins: + type: "array" + items: + type: "object" + properties: + Type: + type: "string" + Name: + type: "string" + example: + - Type: "Log" + Name: "awslogs" + - Type: "Log" + Name: "fluentd" + - Type: "Log" + Name: "gcplogs" + - Type: "Log" + Name: "gelf" + - Type: "Log" + Name: "journald" + - Type: "Log" + Name: "json-file" + - Type: "Log" + Name: "splunk" + - Type: "Log" + Name: "syslog" + - Type: "Network" + Name: "bridge" + - Type: "Network" + Name: "host" + - Type: "Network" + Name: "ipvlan" + - Type: "Network" + Name: "macvlan" + - Type: "Network" + Name: "null" + - Type: "Network" + Name: "overlay" + - Type: "Volume" + Name: "local" + - Type: "Volume" + Name: "localhost:5000/vieux/sshfs:latest" + - Type: "Volume" + Name: "vieux/sshfs:latest" + + TLSInfo: + description: | + Information about the issuer of leaf TLS certificates and the trusted root + CA certificate. + type: "object" + properties: + TrustRoot: + description: | + The root CA certificate(s) that are used to validate leaf TLS + certificates. + type: "string" + CertIssuerSubject: + description: + The base64-url-safe-encoded raw subject bytes of the issuer. + type: "string" + CertIssuerPublicKey: + description: | + The base64-url-safe-encoded raw public key bytes of the issuer. + type: "string" + example: + TrustRoot: | + -----BEGIN CERTIFICATE----- + MIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw + EzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0 + MzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH + A0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf + 3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB + Af8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO + PQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz + pxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H + -----END CERTIFICATE----- + CertIssuerSubject: "MBMxETAPBgNVBAMTCHN3YXJtLWNh" + CertIssuerPublicKey: "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A==" + + NodeStatus: + description: | + NodeStatus represents the status of a node. + + It provides the current status of the node, as seen by the manager. + type: "object" + properties: + State: + $ref: "#/definitions/NodeState" + Message: + type: "string" + example: "" + Addr: + description: "IP address of the node." + type: "string" + example: "172.17.0.2" + + NodeState: + description: "NodeState represents the state of a node." + type: "string" + enum: + - "unknown" + - "down" + - "ready" + - "disconnected" + example: "ready" + + ManagerStatus: + description: | + ManagerStatus represents the status of a manager. + + It provides the current status of a node's manager component, if the node + is a manager. + x-nullable: true + type: "object" + properties: + Leader: + type: "boolean" + default: false + example: true + Reachability: + $ref: "#/definitions/Reachability" + Addr: + description: | + The IP address and port at which the manager is reachable. + type: "string" + example: "10.0.0.46:2377" + + Reachability: + description: "Reachability represents the reachability of a node." + type: "string" + enum: + - "unknown" + - "unreachable" + - "reachable" + example: "reachable" + + SwarmSpec: + description: "User modifiable swarm configuration." + type: "object" + properties: + Name: + description: "Name of the swarm." + type: "string" + example: "default" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.corp.type: "production" + com.example.corp.department: "engineering" + Orchestration: + description: "Orchestration configuration." + type: "object" + x-nullable: true + properties: + TaskHistoryRetentionLimit: + description: | + The number of historic tasks to keep per instance or node. If + negative, never remove completed or failed tasks. + type: "integer" + format: "int64" + example: 10 + Raft: + description: "Raft configuration." + type: "object" + properties: + SnapshotInterval: + description: "The number of log entries between snapshots." + type: "integer" + format: "uint64" + example: 10000 + KeepOldSnapshots: + description: | + The number of snapshots to keep beyond the current snapshot. + type: "integer" + format: "uint64" + LogEntriesForSlowFollowers: + description: | + The number of log entries to keep around to sync up slow followers + after a snapshot is created. + type: "integer" + format: "uint64" + example: 500 + ElectionTick: + description: | + The number of ticks that a follower will wait for a message from + the leader before becoming a candidate and starting an election. + `ElectionTick` must be greater than `HeartbeatTick`. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + type: "integer" + example: 3 + HeartbeatTick: + description: | + The number of ticks between heartbeats. Every HeartbeatTick ticks, + the leader will send a heartbeat to the followers. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + type: "integer" + example: 1 + Dispatcher: + description: "Dispatcher configuration." + type: "object" + x-nullable: true + properties: + HeartbeatPeriod: + description: | + The delay for an agent to send a heartbeat to the dispatcher. + type: "integer" + format: "int64" + example: 5000000000 + CAConfig: + description: "CA configuration." + type: "object" + x-nullable: true + properties: + NodeCertExpiry: + description: "The duration node certificates are issued for." + type: "integer" + format: "int64" + example: 7776000000000000 + ExternalCAs: + description: | + Configuration for forwarding signing requests to an external + certificate authority. + type: "array" + items: + type: "object" + properties: + Protocol: + description: | + Protocol for communication with the external CA (currently + only `cfssl` is supported). + type: "string" + enum: + - "cfssl" + default: "cfssl" + URL: + description: | + URL where certificate signing requests should be sent. + type: "string" + Options: + description: | + An object with key/value pairs that are interpreted as + protocol-specific options for the external CA driver. + type: "object" + additionalProperties: + type: "string" + CACert: + description: | + The root CA certificate (in PEM format) this external CA uses + to issue TLS certificates (assumed to be to the current swarm + root CA certificate if not provided). + type: "string" + SigningCACert: + description: | + The desired signing CA certificate for all swarm node TLS leaf + certificates, in PEM format. + type: "string" + SigningCAKey: + description: | + The desired signing CA key for all swarm node TLS leaf certificates, + in PEM format. + type: "string" + ForceRotate: + description: | + An integer whose purpose is to force swarm to generate a new + signing CA certificate and key, if none have been specified in + `SigningCACert` and `SigningCAKey` + format: "uint64" + type: "integer" + EncryptionConfig: + description: "Parameters related to encryption-at-rest." + type: "object" + properties: + AutoLockManagers: + description: | + If set, generate a key and use it to lock data stored on the + managers. + type: "boolean" + example: false + TaskDefaults: + description: "Defaults for creating tasks in this cluster." + type: "object" + properties: + LogDriver: + description: | + The log driver to use for tasks created in the orchestrator if + unspecified by a service. + + Updating this value only affects new tasks. Existing tasks continue + to use their previously configured log driver until recreated. + type: "object" + properties: + Name: + description: | + The log driver to use as a default for new tasks. + type: "string" + example: "json-file" + Options: + description: | + Driver-specific options for the selected log driver, specified + as key/value pairs. + type: "object" + additionalProperties: + type: "string" + example: + "max-file": "10" + "max-size": "100m" + + # The Swarm information for `GET /info`. It is the same as `GET /swarm`, but + # without `JoinTokens`. + ClusterInfo: + description: | + ClusterInfo represents information about the swarm as is returned by the + "/info" endpoint. Join-tokens are not included. + x-nullable: true + type: "object" + properties: + ID: + description: "The ID of the swarm." + type: "string" + example: "abajmipo7b4xz5ip2nrla6b11" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + description: | + Date and time at which the swarm was initialised in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + UpdatedAt: + description: | + Date and time at which the swarm was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2017-08-09T07:09:37.632105588Z" + Spec: + $ref: "#/definitions/SwarmSpec" + TLSInfo: + $ref: "#/definitions/TLSInfo" + RootRotationInProgress: + description: | + Whether there is currently a root CA rotation in progress for the swarm + type: "boolean" + example: false + DataPathPort: + description: | + DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + If no port is set or is set to 0, the default port (4789) is used. + type: "integer" + format: "uint32" + default: 4789 + example: 4789 + DefaultAddrPool: + description: | + Default Address Pool specifies default subnet pools for global scope + networks. + type: "array" + items: + type: "string" + format: "CIDR" + example: ["10.10.0.0/16", "20.20.0.0/16"] + SubnetSize: + description: | + SubnetSize specifies the subnet size of the networks created from the + default subnet pool. + type: "integer" + format: "uint32" + maximum: 29 + default: 24 + example: 24 + + JoinTokens: + description: | + JoinTokens contains the tokens workers and managers need to join the swarm. + type: "object" + properties: + Worker: + description: | + The token workers can use to join the swarm. + type: "string" + example: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx" + Manager: + description: | + The token managers can use to join the swarm. + type: "string" + example: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + + Swarm: + type: "object" + allOf: + - $ref: "#/definitions/ClusterInfo" + - type: "object" + properties: + JoinTokens: + $ref: "#/definitions/JoinTokens" + + TaskSpec: + description: "User modifiable task configuration." + type: "object" + properties: + PluginSpec: + type: "object" + description: | + Plugin spec for the service. *(Experimental release only.)* + +


+ + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + properties: + Name: + description: "The name or 'alias' to use for the plugin." + type: "string" + Remote: + description: "The plugin image reference to use." + type: "string" + Disabled: + description: "Disable the plugin once scheduled." + type: "boolean" + PluginPrivilege: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + ContainerSpec: + type: "object" + description: | + Container spec for the service. + +


+ + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + properties: + Image: + description: "The image name to use for the container" + type: "string" + Labels: + description: "User-defined key/value data." + type: "object" + additionalProperties: + type: "string" + Command: + description: "The command to be run in the image." + type: "array" + items: + type: "string" + Args: + description: "Arguments to the command." + type: "array" + items: + type: "string" + Hostname: + description: | + The hostname to use for the container, as a valid + [RFC 1123](https://tools.ietf.org/html/rfc1123) hostname. + type: "string" + Env: + description: | + A list of environment variables in the form `VAR=value`. + type: "array" + items: + type: "string" + Dir: + description: "The working directory for commands to run in." + type: "string" + User: + description: "The user inside the container." + type: "string" + Groups: + type: "array" + description: | + A list of additional groups that the container process will run as. + items: + type: "string" + Privileges: + type: "object" + description: "Security options for the container" + properties: + CredentialSpec: + type: "object" + description: "CredentialSpec for managed service account (Windows only)" + properties: + Config: + type: "string" + example: "0bt9dmxjvjiqermk6xrop3ekq" + description: | + Load credential spec from a Swarm Config with the given ID. + The specified config must also be present in the Configs + field with the Runtime property set. + +


+ + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + File: + type: "string" + example: "spec.json" + description: | + Load credential spec from this file. The file is read by + the daemon, and must be present in the `CredentialSpecs` + subdirectory in the docker data directory, which defaults + to `C:\ProgramData\Docker\` on Windows. + + For example, specifying `spec.json` loads + `C:\ProgramData\Docker\CredentialSpecs\spec.json`. + +


+ + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + Registry: + type: "string" + description: | + Load credential spec from this value in the Windows + registry. The specified registry value must be located in: + + `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs` + +


+ + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + SELinuxContext: + type: "object" + description: "SELinux labels of the container" + properties: + Disable: + type: "boolean" + description: "Disable SELinux" + User: + type: "string" + description: "SELinux user label" + Role: + type: "string" + description: "SELinux role label" + Type: + type: "string" + description: "SELinux type label" + Level: + type: "string" + description: "SELinux level label" + Seccomp: + type: "object" + description: "Options for configuring seccomp on the container" + properties: + Mode: + type: "string" + enum: + - "default" + - "unconfined" + - "custom" + Profile: + description: "The custom seccomp profile as a json object" + type: "string" + AppArmor: + type: "object" + description: "Options for configuring AppArmor on the container" + properties: + Mode: + type: "string" + enum: + - "default" + - "disabled" + NoNewPrivileges: + type: "boolean" + description: "Configuration of the no_new_privs bit in the container" + + TTY: + description: "Whether a pseudo-TTY should be allocated." + type: "boolean" + OpenStdin: + description: "Open `stdin`" + type: "boolean" + ReadOnly: + description: "Mount the container's root filesystem as read only." + type: "boolean" + Mounts: + description: | + Specification for mounts to be added to containers created as part + of the service. + type: "array" + items: + $ref: "#/definitions/Mount" + StopSignal: + description: "Signal to stop the container." + type: "string" + StopGracePeriod: + description: | + Amount of time to wait for the container to terminate before + forcefully killing it. + type: "integer" + format: "int64" + HealthCheck: + $ref: "#/definitions/HealthConfig" + Hosts: + type: "array" + description: | + A list of hostname/IP mappings to add to the container's `hosts` + file. The format of extra hosts is specified in the + [hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html) + man page: + + IP_address canonical_hostname [aliases...] + items: + type: "string" + DNSConfig: + description: | + Specification for DNS related configurations in resolver configuration + file (`resolv.conf`). + type: "object" + properties: + Nameservers: + description: "The IP addresses of the name servers." + type: "array" + items: + type: "string" + Search: + description: "A search list for host-name lookup." + type: "array" + items: + type: "string" + Options: + description: | + A list of internal resolver variables to be modified (e.g., + `debug`, `ndots:3`, etc.). + type: "array" + items: + type: "string" + Secrets: + description: | + Secrets contains references to zero or more secrets that will be + exposed to the service. + type: "array" + items: + type: "object" + properties: + File: + description: | + File represents a specific target that is backed by a file. + type: "object" + properties: + Name: + description: | + Name represents the final filename in the filesystem. + type: "string" + UID: + description: "UID represents the file UID." + type: "string" + GID: + description: "GID represents the file GID." + type: "string" + Mode: + description: "Mode represents the FileMode of the file." + type: "integer" + format: "uint32" + SecretID: + description: | + SecretID represents the ID of the specific secret that we're + referencing. + type: "string" + SecretName: + description: | + SecretName is the name of the secret that this references, + but this is just provided for lookup/display purposes. The + secret in the reference will be identified by its ID. + type: "string" + OomScoreAdj: + type: "integer" + format: "int64" + description: | + An integer value containing the score given to the container in + order to tune OOM killer preferences. + example: 0 + Configs: + description: | + Configs contains references to zero or more configs that will be + exposed to the service. + type: "array" + items: + type: "object" + properties: + File: + description: | + File represents a specific target that is backed by a file. + +


+ + > **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive + type: "object" + properties: + Name: + description: | + Name represents the final filename in the filesystem. + type: "string" + UID: + description: "UID represents the file UID." + type: "string" + GID: + description: "GID represents the file GID." + type: "string" + Mode: + description: "Mode represents the FileMode of the file." + type: "integer" + format: "uint32" + Runtime: + description: | + Runtime represents a target that is not mounted into the + container but is used by the task + +


+ + > **Note**: `Configs.File` and `Configs.Runtime` are mutually + > exclusive + type: "object" + ConfigID: + description: | + ConfigID represents the ID of the specific config that we're + referencing. + type: "string" + ConfigName: + description: | + ConfigName is the name of the config that this references, + but this is just provided for lookup/display purposes. The + config in the reference will be identified by its ID. + type: "string" + Isolation: + type: "string" + description: | + Isolation technology of the containers running the service. + (Windows only) + enum: + - "default" + - "process" + - "hyperv" + - "" + Init: + description: | + Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + type: "boolean" + x-nullable: true + Sysctls: + description: | + Set kernel namedspaced parameters (sysctls) in the container. + The Sysctls option on services accepts the same sysctls as the + are supported on containers. Note that while the same sysctls are + supported, no guarantees or checks are made about their + suitability for a clustered environment, and it's up to the user + to determine whether a given sysctl will work properly in a + Service. + type: "object" + additionalProperties: + type: "string" + # This option is not used by Windows containers + CapabilityAdd: + type: "array" + description: | + A list of kernel capabilities to add to the default set + for the container. + items: + type: "string" + example: + - "CAP_NET_RAW" + - "CAP_SYS_ADMIN" + - "CAP_SYS_CHROOT" + - "CAP_SYSLOG" + CapabilityDrop: + type: "array" + description: | + A list of kernel capabilities to drop from the default set + for the container. + items: + type: "string" + example: + - "CAP_NET_RAW" + Ulimits: + description: | + A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`" + type: "array" + items: + type: "object" + properties: + Name: + description: "Name of ulimit" + type: "string" + Soft: + description: "Soft limit" + type: "integer" + Hard: + description: "Hard limit" + type: "integer" + NetworkAttachmentSpec: + description: | + Read-only spec type for non-swarm containers attached to swarm overlay + networks. + +


+ + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + type: "object" + properties: + ContainerID: + description: "ID of the container represented by this task" + type: "string" + Resources: + description: | + Resource requirements which apply to each individual container created + as part of the service. + type: "object" + properties: + Limits: + description: "Define resources limits." + $ref: "#/definitions/Limit" + Reservations: + description: "Define resources reservation." + $ref: "#/definitions/ResourceObject" + RestartPolicy: + description: | + Specification for the restart policy which applies to containers + created as part of this service. + type: "object" + properties: + Condition: + description: "Condition for restart." + type: "string" + enum: + - "none" + - "on-failure" + - "any" + Delay: + description: "Delay between restart attempts." + type: "integer" + format: "int64" + MaxAttempts: + description: | + Maximum attempts to restart a given container before giving up + (default value is 0, which is ignored). + type: "integer" + format: "int64" + default: 0 + Window: + description: | + Windows is the time window used to evaluate the restart policy + (default value is 0, which is unbounded). + type: "integer" + format: "int64" + default: 0 + Placement: + type: "object" + properties: + Constraints: + description: | + An array of constraint expressions to limit the set of nodes where + a task can be scheduled. Constraint expressions can either use a + _match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find + nodes that satisfy every expression (AND match). Constraints can + match node or Docker Engine labels as follows: + + node attribute | matches | example + ---------------------|--------------------------------|----------------------------------------------- + `node.id` | Node ID | `node.id==2ivku8v2gvtg4` + `node.hostname` | Node hostname | `node.hostname!=node-2` + `node.role` | Node role (`manager`/`worker`) | `node.role==manager` + `node.platform.os` | Node operating system | `node.platform.os==windows` + `node.platform.arch` | Node architecture | `node.platform.arch==x86_64` + `node.labels` | User-defined node labels | `node.labels.security==high` + `engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-24.04` + + `engine.labels` apply to Docker Engine labels like operating system, + drivers, etc. Swarm administrators add `node.labels` for operational + purposes by using the [`node update endpoint`](#operation/NodeUpdate). + + type: "array" + items: + type: "string" + example: + - "node.hostname!=node3.corp.example.com" + - "node.role!=manager" + - "node.labels.type==production" + - "node.platform.os==linux" + - "node.platform.arch==x86_64" + Preferences: + description: | + Preferences provide a way to make the scheduler aware of factors + such as topology. They are provided in order from highest to + lowest precedence. + type: "array" + items: + type: "object" + properties: + Spread: + type: "object" + properties: + SpreadDescriptor: + description: | + label descriptor, such as `engine.labels.az`. + type: "string" + example: + - Spread: + SpreadDescriptor: "node.labels.datacenter" + - Spread: + SpreadDescriptor: "node.labels.rack" + MaxReplicas: + description: | + Maximum number of replicas for per node (default value is 0, which + is unlimited) + type: "integer" + format: "int64" + default: 0 + Platforms: + description: | + Platforms stores all the platforms that the service's image can + run on. This field is used in the platform filter for scheduling. + If empty, then the platform filter is off, meaning there are no + scheduling restrictions. + type: "array" + items: + $ref: "#/definitions/Platform" + ForceUpdate: + description: | + A counter that triggers an update even if no relevant parameters have + been changed. + type: "integer" + Runtime: + description: | + Runtime is the type of runtime specified for the task executor. + type: "string" + Networks: + description: "Specifies which networks the service should attach to." + type: "array" + items: + $ref: "#/definitions/NetworkAttachmentConfig" + LogDriver: + description: | + Specifies the log driver to use for tasks created from this spec. If + not present, the default one for the swarm will be used, finally + falling back to the engine default if not specified. + type: "object" + properties: + Name: + type: "string" + Options: + type: "object" + additionalProperties: + type: "string" + + TaskState: + type: "string" + enum: + - "new" + - "allocated" + - "pending" + - "assigned" + - "accepted" + - "preparing" + - "ready" + - "starting" + - "running" + - "complete" + - "shutdown" + - "failed" + - "rejected" + - "remove" + - "orphaned" + + ContainerStatus: + type: "object" + description: "represents the status of a container." + properties: + ContainerID: + type: "string" + PID: + type: "integer" + ExitCode: + type: "integer" + + PortStatus: + type: "object" + description: "represents the port status of a task's host ports whose service has published host ports" + properties: + Ports: + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + + TaskStatus: + type: "object" + description: "represents the status of a task." + properties: + Timestamp: + type: "string" + format: "dateTime" + State: + $ref: "#/definitions/TaskState" + Message: + type: "string" + Err: + type: "string" + ContainerStatus: + $ref: "#/definitions/ContainerStatus" + PortStatus: + $ref: "#/definitions/PortStatus" + + Task: + type: "object" + properties: + ID: + description: "The ID of the task." + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Name: + description: "Name of the task." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Spec: + $ref: "#/definitions/TaskSpec" + ServiceID: + description: "The ID of the service this task is part of." + type: "string" + Slot: + type: "integer" + NodeID: + description: "The ID of the node that this task is on." + type: "string" + AssignedGenericResources: + $ref: "#/definitions/GenericResources" + Status: + $ref: "#/definitions/TaskStatus" + DesiredState: + $ref: "#/definitions/TaskState" + JobIteration: + description: | + If the Service this Task belongs to is a job-mode service, contains + the JobIteration of the Service this Task was created for. Absent if + the Task was created for a Replicated or Global Service. + $ref: "#/definitions/ObjectVersion" + example: + ID: "0kzzo1i0y4jz6027t0k7aezc7" + Version: + Index: 71 + CreatedAt: "2016-06-07T21:07:31.171892745Z" + UpdatedAt: "2016-06-07T21:07:31.376370513Z" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:31.290032978Z" + State: "running" + Message: "started" + ContainerStatus: + ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035" + PID: 677 + DesiredState: "running" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.10/16" + AssignedGenericResources: + - DiscreteResourceSpec: + Kind: "SSD" + Value: 3 + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID1" + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID2" + + ServiceSpec: + description: "User modifiable configuration for a service." + type: object + properties: + Name: + description: "Name of the service." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + TaskTemplate: + $ref: "#/definitions/TaskSpec" + Mode: + description: "Scheduling mode for the service." + type: "object" + properties: + Replicated: + type: "object" + properties: + Replicas: + type: "integer" + format: "int64" + Global: + type: "object" + ReplicatedJob: + description: | + The mode used for services with a finite number of tasks that run + to a completed state. + type: "object" + properties: + MaxConcurrent: + description: | + The maximum number of replicas to run simultaneously. + type: "integer" + format: "int64" + default: 1 + TotalCompletions: + description: | + The total number of replicas desired to reach the Completed + state. If unset, will default to the value of `MaxConcurrent` + type: "integer" + format: "int64" + GlobalJob: + description: | + The mode used for services which run a task to the completed state + on each valid node. + type: "object" + UpdateConfig: + description: "Specification for the update strategy of the service." + type: "object" + properties: + Parallelism: + description: | + Maximum number of tasks to be updated in one iteration (0 means + unlimited parallelism). + type: "integer" + format: "int64" + Delay: + description: "Amount of time between updates, in nanoseconds." + type: "integer" + format: "int64" + FailureAction: + description: | + Action to take if an updated task fails to run, or stops running + during the update. + type: "string" + enum: + - "continue" + - "pause" + - "rollback" + Monitor: + description: | + Amount of time to monitor each updated task for failures, in + nanoseconds. + type: "integer" + format: "int64" + MaxFailureRatio: + description: | + The fraction of tasks that may fail during an update before the + failure action is invoked, specified as a floating point number + between 0 and 1. + type: "number" + default: 0 + Order: + description: | + The order of operations when rolling out an updated task. Either + the old task is shut down before the new task is started, or the + new task is started before the old task is shut down. + type: "string" + enum: + - "stop-first" + - "start-first" + RollbackConfig: + description: "Specification for the rollback strategy of the service." + type: "object" + properties: + Parallelism: + description: | + Maximum number of tasks to be rolled back in one iteration (0 means + unlimited parallelism). + type: "integer" + format: "int64" + Delay: + description: | + Amount of time between rollback iterations, in nanoseconds. + type: "integer" + format: "int64" + FailureAction: + description: | + Action to take if an rolled back task fails to run, or stops + running during the rollback. + type: "string" + enum: + - "continue" + - "pause" + Monitor: + description: | + Amount of time to monitor each rolled back task for failures, in + nanoseconds. + type: "integer" + format: "int64" + MaxFailureRatio: + description: | + The fraction of tasks that may fail during a rollback before the + failure action is invoked, specified as a floating point number + between 0 and 1. + type: "number" + default: 0 + Order: + description: | + The order of operations when rolling back a task. Either the old + task is shut down before the new task is started, or the new task + is started before the old task is shut down. + type: "string" + enum: + - "stop-first" + - "start-first" + Networks: + description: | + Specifies which networks the service should attach to. + + Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. + type: "array" + items: + $ref: "#/definitions/NetworkAttachmentConfig" + + EndpointSpec: + $ref: "#/definitions/EndpointSpec" + + EndpointPortConfig: + type: "object" + properties: + Name: + type: "string" + Protocol: + type: "string" + enum: + - "tcp" + - "udp" + - "sctp" + TargetPort: + description: "The port inside the container." + type: "integer" + PublishedPort: + description: "The port on the swarm hosts." + type: "integer" + PublishMode: + description: | + The mode in which port is published. + +


+ + - "ingress" makes the target port accessible on every node, + regardless of whether there is a task for the service running on + that node or not. + - "host" bypasses the routing mesh and publish the port directly on + the swarm node where that service is running. + + type: "string" + enum: + - "ingress" + - "host" + default: "ingress" + example: "ingress" + + EndpointSpec: + description: "Properties that can be configured to access and load balance a service." + type: "object" + properties: + Mode: + description: | + The mode of resolution to use for internal load balancing between tasks. + type: "string" + enum: + - "vip" + - "dnsrr" + default: "vip" + Ports: + description: | + List of exposed ports that this service is accessible on from the + outside. Ports can only be provided if `vip` resolution mode is used. + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + + Service: + type: "object" + properties: + ID: + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ServiceSpec" + Endpoint: + type: "object" + properties: + Spec: + $ref: "#/definitions/EndpointSpec" + Ports: + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + VirtualIPs: + type: "array" + items: + type: "object" + properties: + NetworkID: + type: "string" + Addr: + type: "string" + UpdateStatus: + description: "The status of a service update." + type: "object" + properties: + State: + type: "string" + enum: + - "updating" + - "paused" + - "completed" + StartedAt: + type: "string" + format: "dateTime" + CompletedAt: + type: "string" + format: "dateTime" + Message: + type: "string" + ServiceStatus: + description: | + The status of the service's tasks. Provided only when requested as + part of a ServiceList operation. + type: "object" + properties: + RunningTasks: + description: | + The number of tasks for the service currently in the Running state. + type: "integer" + format: "uint64" + example: 7 + DesiredTasks: + description: | + The number of tasks for the service desired to be running. + For replicated services, this is the replica count from the + service spec. For global services, this is computed by taking + count of all tasks for the service with a Desired State other + than Shutdown. + type: "integer" + format: "uint64" + example: 10 + CompletedTasks: + description: | + The number of tasks for a job that are in the Completed state. + This field must be cross-referenced with the service type, as the + value of 0 may mean the service is not in a job mode, or it may + mean the job-mode service has no tasks yet Completed. + type: "integer" + format: "uint64" + JobStatus: + description: | + The status of the service when it is in one of ReplicatedJob or + GlobalJob modes. Absent on Replicated and Global mode services. The + JobIteration is an ObjectVersion, but unlike the Service's version, + does not need to be sent with an update request. + type: "object" + properties: + JobIteration: + description: | + JobIteration is a value increased each time a Job is executed, + successfully or otherwise. "Executed", in this case, means the + job as a whole has been started, not that an individual Task has + been launched. A job is "Executed" when its ServiceSpec is + updated. JobIteration can be used to disambiguate Tasks belonging + to different executions of a job. Though JobIteration will + increase with each subsequent execution, it may not necessarily + increase by 1, and so JobIteration should not be used to + $ref: "#/definitions/ObjectVersion" + LastExecution: + description: | + The last time, as observed by the server, that this job was + started. + type: "string" + format: "dateTime" + example: + ID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Version: + Index: 19 + CreatedAt: "2016-06-07T21:05:51.880065305Z" + UpdatedAt: "2016-06-07T21:07:29.962229872Z" + Spec: + Name: "hopeful_cori" + TaskTemplate: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ForceUpdate: 0 + Mode: + Replicated: + Replicas: 1 + UpdateConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Mode: "vip" + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + Endpoint: + Spec: + Mode: "vip" + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + VirtualIPs: + - + NetworkID: "4qvuz4ko70xaltuqbt8956gd1" + Addr: "10.255.0.2/16" + - + NetworkID: "4qvuz4ko70xaltuqbt8956gd1" + Addr: "10.255.0.3/16" + + ImageDeleteResponseItem: + type: "object" + x-go-name: "DeleteResponse" + properties: + Untagged: + description: "The image ID of an image that was untagged" + type: "string" + Deleted: + description: "The image ID of an image that was deleted" + type: "string" + + ServiceCreateResponse: + type: "object" + description: | + contains the information returned to a client on the + creation of a new service. + properties: + ID: + description: "The ID of the created service." + type: "string" + x-nullable: false + example: "ak7w3gjqoa3kuz8xcpnyy0pvl" + Warnings: + description: | + Optional warning message. + + FIXME(thaJeztah): this should have "omitempty" in the generated type. + type: "array" + x-nullable: true + items: + type: "string" + example: + - "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + + ServiceUpdateResponse: + type: "object" + properties: + Warnings: + description: "Optional warning messages" + type: "array" + items: + type: "string" + example: + Warnings: + - "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + + ContainerInspectResponse: + type: "object" + title: "ContainerInspectResponse" + x-go-name: "InspectResponse" + properties: + Id: + description: |- + The ID of this container as a 128-bit (64-character) hexadecimal string (32 bytes). + type: "string" + x-go-name: "ID" + minLength: 64 + maxLength: 64 + pattern: "^[0-9a-fA-F]{64}$" + example: "aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf" + Created: + description: |- + Date and time at which the container was created, formatted in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + x-nullable: true + example: "2025-02-17T17:43:39.64001363Z" + Path: + description: |- + The path to the command being run + type: "string" + example: "/bin/sh" + Args: + description: "The arguments to the command being run" + type: "array" + items: + type: "string" + example: + - "-c" + - "exit 9" + State: + $ref: "#/definitions/ContainerState" + Image: + description: |- + The ID (digest) of the image that this container was created from. + type: "string" + example: "sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782" + ResolvConfPath: + description: |- + Location of the `/etc/resolv.conf` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/resolv.conf" + HostnamePath: + description: |- + Location of the `/etc/hostname` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/hostname" + HostsPath: + description: |- + Location of the `/etc/hosts` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/hosts" + LogPath: + description: |- + Location of the file used to buffer the container's logs. Depending on + the logging-driver used for the container, this field may be omitted. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + x-nullable: true + example: "/var/lib/docker/containers/5b7c7e2b992aa426584ce6c47452756066be0e503a08b4516a433a54d2f69e59/5b7c7e2b992aa426584ce6c47452756066be0e503a08b4516a433a54d2f69e59-json.log" + Name: + description: |- + The name associated with this container. + + For historic reasons, the name may be prefixed with a forward-slash (`/`). + type: "string" + example: "/funny_chatelet" + RestartCount: + description: |- + Number of times the container was restarted since it was created, + or since daemon was started. + type: "integer" + example: 0 + Driver: + description: |- + The storage-driver used for the container's filesystem (graph-driver + or snapshotter). + type: "string" + example: "overlayfs" + Platform: + description: |- + The platform (operating system) for which the container was created. + + This field was introduced for the experimental "LCOW" (Linux Containers + On Windows) features, which has been removed. In most cases, this field + is equal to the host's operating system (`linux` or `windows`). + type: "string" + example: "linux" + ImageManifestDescriptor: + $ref: "#/definitions/OCIDescriptor" + description: |- + OCI descriptor of the platform-specific manifest of the image + the container was created from. + + Note: Only available if the daemon provides a multi-platform + image store. + MountLabel: + description: |- + SELinux mount label set for the container. + type: "string" + example: "" + ProcessLabel: + description: |- + SELinux process label set for the container. + type: "string" + example: "" + AppArmorProfile: + description: |- + The AppArmor profile set for the container. + type: "string" + example: "" + ExecIDs: + description: |- + IDs of exec instances that are running in the container. + type: "array" + items: + type: "string" + x-nullable: true + example: + - "b35395de42bc8abd327f9dd65d913b9ba28c74d2f0734eeeae84fa1c616a0fca" + - "3fc1232e5cd20c8de182ed81178503dc6437f4e7ef12b52cc5e8de020652f1c4" + HostConfig: + $ref: "#/definitions/HostConfig" + GraphDriver: + $ref: "#/definitions/DriverData" + SizeRw: + description: |- + The size of files that have been created or changed by this container. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "122880" + SizeRootFs: + description: |- + The total size of all files in the read-only layers from the image + that the container uses. These layers can be shared between containers. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "1653948416" + Mounts: + description: |- + List of mounts used by the container. + type: "array" + items: + $ref: "#/definitions/MountPoint" + Config: + $ref: "#/definitions/ContainerConfig" + NetworkSettings: + $ref: "#/definitions/NetworkSettings" + + ContainerSummary: + type: "object" + properties: + Id: + description: |- + The ID of this container as a 128-bit (64-character) hexadecimal string (32 bytes). + type: "string" + x-go-name: "ID" + minLength: 64 + maxLength: 64 + pattern: "^[0-9a-fA-F]{64}$" + example: "aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf" + Names: + description: |- + The names associated with this container. Most containers have a single + name, but when using legacy "links", the container can have multiple + names. + + For historic reasons, names are prefixed with a forward-slash (`/`). + type: "array" + items: + type: "string" + example: + - "/funny_chatelet" + Image: + description: |- + The name or ID of the image used to create the container. + + This field shows the image reference as was specified when creating the container, + which can be in its canonical form (e.g., `docker.io/library/ubuntu:latest` + or `docker.io/library/ubuntu@sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782`), + short form (e.g., `ubuntu:latest`)), or the ID(-prefix) of the image (e.g., `72297848456d`). + + The content of this field can be updated at runtime if the image used to + create the container is untagged, in which case the field is updated to + contain the the image ID (digest) it was resolved to in its canonical, + non-truncated form (e.g., `sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782`). + type: "string" + example: "docker.io/library/ubuntu:latest" + ImageID: + description: |- + The ID (digest) of the image that this container was created from. + type: "string" + example: "sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782" + ImageManifestDescriptor: + $ref: "#/definitions/OCIDescriptor" + x-nullable: true + description: | + OCI descriptor of the platform-specific manifest of the image + the container was created from. + + Note: Only available if the daemon provides a multi-platform + image store. + + This field is not populated in the `GET /system/df` endpoint. + Command: + description: "Command to run when starting the container" + type: "string" + example: "/bin/bash" + Created: + description: |- + Date and time at which the container was created as a Unix timestamp + (number of seconds since EPOCH). + type: "integer" + format: "int64" + example: "1739811096" + Ports: + description: |- + Port-mappings for the container. + type: "array" + items: + $ref: "#/definitions/Port" + SizeRw: + description: |- + The size of files that have been created or changed by this container. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "122880" + SizeRootFs: + description: |- + The total size of all files in the read-only layers from the image + that the container uses. These layers can be shared between containers. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "1653948416" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.vendor: "Acme" + com.example.license: "GPL" + com.example.version: "1.0" + State: + description: | + The state of this container. + type: "string" + enum: + - "created" + - "running" + - "paused" + - "restarting" + - "exited" + - "removing" + - "dead" + example: "running" + Status: + description: |- + Additional human-readable status of this container (e.g. `Exit 0`) + type: "string" + example: "Up 4 days" + HostConfig: + type: "object" + description: |- + Summary of host-specific runtime information of the container. This + is a reduced set of information in the container's "HostConfig" as + available in the container "inspect" response. + properties: + NetworkMode: + description: |- + Networking mode (`host`, `none`, `container:`) or name of the + primary network the container is using. + + This field is primarily for backward compatibility. The container + can be connected to multiple networks for which information can be + found in the `NetworkSettings.Networks` field, which enumerates + settings per network. + type: "string" + example: "mynetwork" + Annotations: + description: |- + Arbitrary key-value metadata attached to the container. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + io.kubernetes.docker.type: "container" + io.kubernetes.sandbox.id: "3befe639bed0fd6afdd65fd1fa84506756f59360ec4adc270b0fdac9be22b4d3" + NetworkSettings: + description: |- + Summary of the container's network settings + type: "object" + properties: + Networks: + type: "object" + description: |- + Summary of network-settings for each network the container is + attached to. + additionalProperties: + $ref: "#/definitions/EndpointSettings" + Mounts: + type: "array" + description: |- + List of mounts used by the container. + items: + $ref: "#/definitions/MountPoint" + + Driver: + description: "Driver represents a driver (network, logging, secrets)." + type: "object" + required: [Name] + properties: + Name: + description: "Name of the driver." + type: "string" + x-nullable: false + example: "some-driver" + Options: + description: "Key/value map of driver-specific options." + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: + OptionA: "value for driver-specific option A" + OptionB: "value for driver-specific option B" + + SecretSpec: + type: "object" + properties: + Name: + description: "User-defined name of the secret." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Data: + description: | + Data is the data to store as a secret, formatted as a Base64-url-safe-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + It must be empty if the Driver field is set, in which case the data is + loaded from an external secret store. The maximum allowed size is 500KB, + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize). + + This field is only used to _create_ a secret, and is not returned by + other endpoints. + type: "string" + example: "" + Driver: + description: | + Name of the secrets driver used to fetch the secret's value from an + external secret store. + $ref: "#/definitions/Driver" + Templating: + description: | + Templating driver, if applicable + + Templating controls whether and how to evaluate the config payload as + a template. If no driver is set, no templating is used. + $ref: "#/definitions/Driver" + + Secret: + type: "object" + properties: + ID: + type: "string" + example: "blt1owaxmitz71s9v5zh81zun" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + example: "2017-07-20T13:55:28.678958722Z" + UpdatedAt: + type: "string" + format: "dateTime" + example: "2017-07-20T13:55:28.678958722Z" + Spec: + $ref: "#/definitions/SecretSpec" + + ConfigSpec: + type: "object" + properties: + Name: + description: "User-defined name of the config." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Data: + description: | + Data is the data to store as a config, formatted as a Base64-url-safe-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). + type: "string" + Templating: + description: | + Templating driver, if applicable + + Templating controls whether and how to evaluate the config payload as + a template. If no driver is set, no templating is used. + $ref: "#/definitions/Driver" + + Config: + type: "object" + properties: + ID: + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ConfigSpec" + + ContainerState: + description: | + ContainerState stores container's running state. It's part of ContainerJSONBase + and will be returned by the "inspect" command. + type: "object" + x-nullable: true + properties: + Status: + description: | + String representation of the container state. Can be one of "created", + "running", "paused", "restarting", "removing", "exited", or "dead". + type: "string" + enum: ["created", "running", "paused", "restarting", "removing", "exited", "dead"] + example: "running" + Running: + description: | + Whether this container is running. + + Note that a running container can be _paused_. The `Running` and `Paused` + booleans are not mutually exclusive: + + When pausing a container (on Linux), the freezer cgroup is used to suspend + all processes in the container. Freezing the process requires the process to + be running. As a result, paused containers are both `Running` _and_ `Paused`. + + Use the `Status` field instead to determine if a container's state is "running". + type: "boolean" + example: true + Paused: + description: "Whether this container is paused." + type: "boolean" + example: false + Restarting: + description: "Whether this container is restarting." + type: "boolean" + example: false + OOMKilled: + description: | + Whether a process within this container has been killed because it ran + out of memory since the container was last started. + type: "boolean" + example: false + Dead: + type: "boolean" + example: false + Pid: + description: "The process ID of this container" + type: "integer" + example: 1234 + ExitCode: + description: "The last exit code of this container" + type: "integer" + example: 0 + Error: + type: "string" + StartedAt: + description: "The time when this container was last started." + type: "string" + example: "2020-01-06T09:06:59.461876391Z" + FinishedAt: + description: "The time when this container last exited." + type: "string" + example: "2020-01-06T09:07:59.461876391Z" + Health: + $ref: "#/definitions/Health" + + ContainerCreateResponse: + description: "OK response to ContainerCreate operation" + type: "object" + title: "ContainerCreateResponse" + x-go-name: "CreateResponse" + required: [Id, Warnings] + properties: + Id: + description: "The ID of the created container" + type: "string" + x-nullable: false + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + Warnings: + description: "Warnings encountered when creating the container" + type: "array" + x-nullable: false + items: + type: "string" + example: [] + + ContainerUpdateResponse: + type: "object" + title: "ContainerUpdateResponse" + x-go-name: "UpdateResponse" + description: |- + Response for a successful container-update. + properties: + Warnings: + type: "array" + description: |- + Warnings encountered when updating the container. + items: + type: "string" + example: ["Published ports are discarded when using host network mode"] + + ContainerStatsResponse: + description: | + Statistics sample for a container. + type: "object" + x-go-name: "StatsResponse" + title: "ContainerStatsResponse" + properties: + name: + description: "Name of the container" + type: "string" + x-nullable: true + example: "boring_wozniak" + id: + description: "ID of the container" + type: "string" + x-nullable: true + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + read: + description: | + Date and time at which this sample was collected. + The value is formatted as [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + with nano-seconds. + type: "string" + format: "date-time" + example: "2025-01-16T13:55:22.165243637Z" + preread: + description: | + Date and time at which this first sample was collected. This field + is not propagated if the "one-shot" option is set. If the "one-shot" + option is set, this field may be omitted, empty, or set to a default + date (`0001-01-01T00:00:00Z`). + + The value is formatted as [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + with nano-seconds. + type: "string" + format: "date-time" + example: "2025-01-16T13:55:21.160452595Z" + pids_stats: + $ref: "#/definitions/ContainerPidsStats" + blkio_stats: + $ref: "#/definitions/ContainerBlkioStats" + num_procs: + description: | + The number of processors on the system. + + This field is Windows-specific and always zero for Linux containers. + type: "integer" + format: "uint32" + example: 16 + storage_stats: + $ref: "#/definitions/ContainerStorageStats" + cpu_stats: + $ref: "#/definitions/ContainerCPUStats" + precpu_stats: + $ref: "#/definitions/ContainerCPUStats" + memory_stats: + $ref: "#/definitions/ContainerMemoryStats" + networks: + description: | + Network statistics for the container per interface. + + This field is omitted if the container has no networking enabled. + x-nullable: true + additionalProperties: + $ref: "#/definitions/ContainerNetworkStats" + example: + eth0: + rx_bytes: 5338 + rx_dropped: 0 + rx_errors: 0 + rx_packets: 36 + tx_bytes: 648 + tx_dropped: 0 + tx_errors: 0 + tx_packets: 8 + eth5: + rx_bytes: 4641 + rx_dropped: 0 + rx_errors: 0 + rx_packets: 26 + tx_bytes: 690 + tx_dropped: 0 + tx_errors: 0 + tx_packets: 9 + + ContainerBlkioStats: + description: | + BlkioStats stores all IO service stats for data read and write. + + This type is Linux-specific and holds many fields that are specific to cgroups v1. + On a cgroup v2 host, all fields other than `io_service_bytes_recursive` + are omitted or `null`. + + This type is only populated on Linux and omitted for Windows containers. + type: "object" + x-go-name: "BlkioStats" + x-nullable: true + properties: + io_service_bytes_recursive: + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_serviced_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_queue_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_service_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_wait_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_merged_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + sectors_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + example: + io_service_bytes_recursive: [ + {"major": 254, "minor": 0, "op": "read", "value": 7593984}, + {"major": 254, "minor": 0, "op": "write", "value": 100} + ] + io_serviced_recursive: null + io_queue_recursive: null + io_service_time_recursive: null + io_wait_time_recursive: null + io_merged_recursive: null + io_time_recursive: null + sectors_recursive: null + + ContainerBlkioStatEntry: + description: | + Blkio stats entry. + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "BlkioStatEntry" + x-nullable: true + properties: + major: + type: "integer" + format: "uint64" + example: 254 + minor: + type: "integer" + format: "uint64" + example: 0 + op: + type: "string" + example: "read" + value: + type: "integer" + format: "uint64" + example: 7593984 + + ContainerCPUStats: + description: | + CPU related info of the container + type: "object" + x-go-name: "CPUStats" + x-nullable: true + properties: + cpu_usage: + $ref: "#/definitions/ContainerCPUUsage" + system_cpu_usage: + description: | + System Usage. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 5 + online_cpus: + description: | + Number of online CPUs. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint32" + x-nullable: true + example: 5 + throttling_data: + $ref: "#/definitions/ContainerThrottlingData" + + ContainerCPUUsage: + description: | + All CPU stats aggregated since container inception. + type: "object" + x-go-name: "CPUUsage" + x-nullable: true + properties: + total_usage: + description: | + Total CPU time consumed in nanoseconds (Linux) or 100's of nanoseconds (Windows). + type: "integer" + format: "uint64" + example: 29912000 + percpu_usage: + description: | + Total CPU time (in nanoseconds) consumed per core (Linux). + + This field is Linux-specific when using cgroups v1. It is omitted + when using cgroups v2 and Windows containers. + type: "array" + x-nullable: true + items: + type: "integer" + format: "uint64" + example: 29912000 + + usage_in_kernelmode: + description: | + Time (in nanoseconds) spent by tasks of the cgroup in kernel mode (Linux), + or time spent (in 100's of nanoseconds) by all container processes in + kernel mode (Windows). + + Not populated for Windows containers using Hyper-V isolation. + type: "integer" + format: "uint64" + example: 21994000 + usage_in_usermode: + description: | + Time (in nanoseconds) spent by tasks of the cgroup in user mode (Linux), + or time spent (in 100's of nanoseconds) by all container processes in + kernel mode (Windows). + + Not populated for Windows containers using Hyper-V isolation. + type: "integer" + format: "uint64" + example: 7918000 + + ContainerPidsStats: + description: | + PidsStats contains Linux-specific stats of a container's process-IDs (PIDs). + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "PidsStats" + x-nullable: true + properties: + current: + description: | + Current is the number of PIDs in the cgroup. + type: "integer" + format: "uint64" + x-nullable: true + example: 5 + limit: + description: | + Limit is the hard limit on the number of pids in the cgroup. + A "Limit" of 0 means that there is no limit. + type: "integer" + format: "uint64" + x-nullable: true + example: "18446744073709551615" + + ContainerThrottlingData: + description: | + CPU throttling stats of the container. + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "ThrottlingData" + x-nullable: true + properties: + periods: + description: | + Number of periods with throttling active. + type: "integer" + format: "uint64" + example: 0 + throttled_periods: + description: | + Number of periods when the container hit its throttling limit. + type: "integer" + format: "uint64" + example: 0 + throttled_time: + description: | + Aggregated time (in nanoseconds) the container was throttled for. + type: "integer" + format: "uint64" + example: 0 + + ContainerMemoryStats: + description: | + Aggregates all memory stats since container inception on Linux. + Windows returns stats for commit and private working set only. + type: "object" + x-go-name: "MemoryStats" + properties: + usage: + description: | + Current `res_counter` usage for memory. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + max_usage: + description: | + Maximum usage ever recorded. + + This field is Linux-specific and only supported on cgroups v1. + It is omitted when using cgroups v2 and for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + stats: + description: | + All the stats exported via memory.stat. when using cgroups v2. + + This field is Linux-specific and omitted for Windows containers. + type: "object" + additionalProperties: + type: "integer" + format: "uint64" + x-nullable: true + example: + { + "active_anon": 1572864, + "active_file": 5115904, + "anon": 1572864, + "anon_thp": 0, + "file": 7626752, + "file_dirty": 0, + "file_mapped": 2723840, + "file_writeback": 0, + "inactive_anon": 0, + "inactive_file": 2510848, + "kernel_stack": 16384, + "pgactivate": 0, + "pgdeactivate": 0, + "pgfault": 2042, + "pglazyfree": 0, + "pglazyfreed": 0, + "pgmajfault": 45, + "pgrefill": 0, + "pgscan": 0, + "pgsteal": 0, + "shmem": 0, + "slab": 1180928, + "slab_reclaimable": 725576, + "slab_unreclaimable": 455352, + "sock": 0, + "thp_collapse_alloc": 0, + "thp_fault_alloc": 1, + "unevictable": 0, + "workingset_activate": 0, + "workingset_nodereclaim": 0, + "workingset_refault": 0 + } + failcnt: + description: | + Number of times memory usage hits limits. + + This field is Linux-specific and only supported on cgroups v1. + It is omitted when using cgroups v2 and for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + limit: + description: | + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 8217579520 + commitbytes: + description: | + Committed bytes. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + commitpeakbytes: + description: | + Peak committed bytes. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + privateworkingset: + description: | + Private working set. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + + ContainerNetworkStats: + description: | + Aggregates the network stats of one container + type: "object" + x-go-name: "NetworkStats" + x-nullable: true + properties: + rx_bytes: + description: | + Bytes received. Windows and Linux. + type: "integer" + format: "uint64" + example: 5338 + rx_packets: + description: | + Packets received. Windows and Linux. + type: "integer" + format: "uint64" + example: 36 + rx_errors: + description: | + Received errors. Not used on Windows. + + This field is Linux-specific and always zero for Windows containers. + type: "integer" + format: "uint64" + example: 0 + rx_dropped: + description: | + Incoming packets dropped. Windows and Linux. + type: "integer" + format: "uint64" + example: 0 + tx_bytes: + description: | + Bytes sent. Windows and Linux. + type: "integer" + format: "uint64" + example: 1200 + tx_packets: + description: | + Packets sent. Windows and Linux. + type: "integer" + format: "uint64" + example: 12 + tx_errors: + description: | + Sent errors. Not used on Windows. + + This field is Linux-specific and always zero for Windows containers. + type: "integer" + format: "uint64" + example: 0 + tx_dropped: + description: | + Outgoing packets dropped. Windows and Linux. + type: "integer" + format: "uint64" + example: 0 + endpoint_id: + description: | + Endpoint ID. Not used on Linux. + + This field is Windows-specific and omitted for Linux containers. + type: "string" + x-nullable: true + instance_id: + description: | + Instance ID. Not used on Linux. + + This field is Windows-specific and omitted for Linux containers. + type: "string" + x-nullable: true + + ContainerStorageStats: + description: | + StorageStats is the disk I/O stats for read/write on Windows. + + This type is Windows-specific and omitted for Linux containers. + type: "object" + x-go-name: "StorageStats" + x-nullable: true + properties: + read_count_normalized: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + read_size_bytes: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + write_count_normalized: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + write_size_bytes: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + + ContainerTopResponse: + type: "object" + x-go-name: "TopResponse" + title: "ContainerTopResponse" + description: |- + Container "top" response. + properties: + Titles: + description: "The ps column titles" + type: "array" + items: + type: "string" + example: + Titles: + - "UID" + - "PID" + - "PPID" + - "C" + - "STIME" + - "TTY" + - "TIME" + - "CMD" + Processes: + description: |- + Each process running in the container, where each process + is an array of values corresponding to the titles. + type: "array" + items: + type: "array" + items: + type: "string" + example: + Processes: + - + - "root" + - "13642" + - "882" + - "0" + - "17:03" + - "pts/0" + - "00:00:00" + - "/bin/bash" + - + - "root" + - "13735" + - "13642" + - "0" + - "17:06" + - "pts/0" + - "00:00:00" + - "sleep 10" + + ContainerWaitResponse: + description: "OK response to ContainerWait operation" + type: "object" + x-go-name: "WaitResponse" + title: "ContainerWaitResponse" + required: [StatusCode] + properties: + StatusCode: + description: "Exit code of the container" + type: "integer" + format: "int64" + x-nullable: false + Error: + $ref: "#/definitions/ContainerWaitExitError" + + ContainerWaitExitError: + description: "container waiting error, if any" + type: "object" + x-go-name: "WaitExitError" + properties: + Message: + description: "Details of an error" + type: "string" + + SystemVersion: + type: "object" + description: | + Response of Engine API: GET "/version" + properties: + Platform: + type: "object" + required: [Name] + properties: + Name: + type: "string" + Components: + type: "array" + description: | + Information about system components + items: + type: "object" + x-go-name: ComponentVersion + required: [Name, Version] + properties: + Name: + description: | + Name of the component + type: "string" + example: "Engine" + Version: + description: | + Version of the component + type: "string" + x-nullable: false + example: "27.0.1" + Details: + description: | + Key/value pairs of strings with additional information about the + component. These values are intended for informational purposes + only, and their content is not defined, and not part of the API + specification. + + These messages can be printed by the client as information to the user. + type: "object" + x-nullable: true + Version: + description: "The version of the daemon" + type: "string" + example: "27.0.1" + ApiVersion: + description: | + The default (and highest) API version that is supported by the daemon + type: "string" + example: "1.47" + MinAPIVersion: + description: | + The minimum API version that is supported by the daemon + type: "string" + example: "1.24" + GitCommit: + description: | + The Git commit of the source code that was used to build the daemon + type: "string" + example: "48a66213fe" + GoVersion: + description: | + The version Go used to compile the daemon, and the version of the Go + runtime in use. + type: "string" + example: "go1.22.7" + Os: + description: | + The operating system that the daemon is running on ("linux" or "windows") + type: "string" + example: "linux" + Arch: + description: | + The architecture that the daemon is running on + type: "string" + example: "amd64" + KernelVersion: + description: | + The kernel version (`uname -r`) that the daemon is running on. + + This field is omitted when empty. + type: "string" + example: "6.8.0-31-generic" + Experimental: + description: | + Indicates if the daemon is started with experimental features enabled. + + This field is omitted when empty / false. + type: "boolean" + example: true + BuildTime: + description: | + The date and time that the daemon was compiled. + type: "string" + example: "2020-06-22T15:49:27.000000000+00:00" + + SystemInfo: + type: "object" + properties: + ID: + description: | + Unique identifier of the daemon. + +


+ + > **Note**: The format of the ID itself is not part of the API, and + > should not be considered stable. + type: "string" + example: "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS" + Containers: + description: "Total number of containers on the host." + type: "integer" + example: 14 + ContainersRunning: + description: | + Number of containers with status `"running"`. + type: "integer" + example: 3 + ContainersPaused: + description: | + Number of containers with status `"paused"`. + type: "integer" + example: 1 + ContainersStopped: + description: | + Number of containers with status `"stopped"`. + type: "integer" + example: 10 + Images: + description: | + Total number of images on the host. + + Both _tagged_ and _untagged_ (dangling) images are counted. + type: "integer" + example: 508 + Driver: + description: "Name of the storage driver in use." + type: "string" + example: "overlay2" + DriverStatus: + description: | + Information specific to the storage driver, provided as + "label" / "value" pairs. + + This information is provided by the storage driver, and formatted + in a way consistent with the output of `docker info` on the command + line. + +


+ + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "array" + items: + type: "array" + items: + type: "string" + example: + - ["Backing Filesystem", "extfs"] + - ["Supports d_type", "true"] + - ["Native Overlay Diff", "true"] + DockerRootDir: + description: | + Root directory of persistent Docker state. + + Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` + on Windows. + type: "string" + example: "/var/lib/docker" + Plugins: + $ref: "#/definitions/PluginsInfo" + MemoryLimit: + description: "Indicates if the host has memory limit support enabled." + type: "boolean" + example: true + SwapLimit: + description: "Indicates if the host has memory swap limit support enabled." + type: "boolean" + example: true + KernelMemoryTCP: + description: | + Indicates if the host has kernel memory TCP limit support enabled. This + field is omitted if not supported. + + Kernel memory TCP limits are not supported when using cgroups v2, which + does not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup. + type: "boolean" + example: true + CpuCfsPeriod: + description: | + Indicates if CPU CFS(Completely Fair Scheduler) period is supported by + the host. + type: "boolean" + example: true + CpuCfsQuota: + description: | + Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by + the host. + type: "boolean" + example: true + CPUShares: + description: | + Indicates if CPU Shares limiting is supported by the host. + type: "boolean" + example: true + CPUSet: + description: | + Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host. + + See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt) + type: "boolean" + example: true + PidsLimit: + description: "Indicates if the host kernel has PID limit support enabled." + type: "boolean" + example: true + OomKillDisable: + description: "Indicates if OOM killer disable is supported on the host." + type: "boolean" + IPv4Forwarding: + description: "Indicates IPv4 forwarding is enabled." + type: "boolean" + example: true + BridgeNfIptables: + description: | + Indicates if `bridge-nf-call-iptables` is available on the host when + the daemon was started. + +


+ + > **Deprecated**: netfilter module is now loaded on-demand and no longer + > during daemon startup, making this field obsolete. This field is always + > `false` and will be removed in a API v1.49. + type: "boolean" + example: false + BridgeNfIp6tables: + description: | + Indicates if `bridge-nf-call-ip6tables` is available on the host. + +


+ + > **Deprecated**: netfilter module is now loaded on-demand, and no longer + > during daemon startup, making this field obsolete. This field is always + > `false` and will be removed in a API v1.49. + type: "boolean" + example: false + Debug: + description: | + Indicates if the daemon is running in debug-mode / with debug-level + logging enabled. + type: "boolean" + example: true + NFd: + description: | + The total number of file Descriptors in use by the daemon process. + + This information is only returned if debug-mode is enabled. + type: "integer" + example: 64 + NGoroutines: + description: | + The number of goroutines that currently exist. + + This information is only returned if debug-mode is enabled. + type: "integer" + example: 174 + SystemTime: + description: | + Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + format with nano-seconds. + type: "string" + example: "2017-08-08T20:28:29.06202363Z" + LoggingDriver: + description: | + The logging driver to use as a default for new containers. + type: "string" + CgroupDriver: + description: | + The driver to use for managing cgroups. + type: "string" + enum: ["cgroupfs", "systemd", "none"] + default: "cgroupfs" + example: "cgroupfs" + CgroupVersion: + description: | + The version of the cgroup. + type: "string" + enum: ["1", "2"] + default: "1" + example: "1" + NEventsListener: + description: "Number of event listeners subscribed." + type: "integer" + example: 30 + KernelVersion: + description: | + Kernel version of the host. + + On Linux, this information obtained from `uname`. On Windows this + information is queried from the HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ + registry value, for example _"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)"_. + type: "string" + example: "6.8.0-31-generic" + OperatingSystem: + description: | + Name of the host's operating system, for example: "Ubuntu 24.04 LTS" + or "Windows Server 2016 Datacenter" + type: "string" + example: "Ubuntu 24.04 LTS" + OSVersion: + description: | + Version of the host's operating system + +


+ + > **Note**: The information returned in this field, including its + > very existence, and the formatting of values, should not be considered + > stable, and may change without notice. + type: "string" + example: "24.04" + OSType: + description: | + Generic type of the operating system of the host, as returned by the + Go runtime (`GOOS`). + + Currently returned values are "linux" and "windows". A full list of + possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + type: "string" + example: "linux" + Architecture: + description: | + Hardware architecture of the host, as returned by the Go runtime + (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + type: "string" + example: "x86_64" + NCPU: + description: | + The number of logical CPUs usable by the daemon. + + The number of available CPUs is checked by querying the operating + system when the daemon starts. Changes to operating system CPU + allocation after the daemon is started are not reflected. + type: "integer" + example: 4 + MemTotal: + description: | + Total amount of physical memory available on the host, in bytes. + type: "integer" + format: "int64" + example: 2095882240 + + IndexServerAddress: + description: | + Address / URL of the index server that is used for image search, + and as a default for user authentication for Docker Hub and Docker Cloud. + default: "https://index.docker.io/v1/" + type: "string" + example: "https://index.docker.io/v1/" + RegistryConfig: + $ref: "#/definitions/RegistryServiceConfig" + GenericResources: + $ref: "#/definitions/GenericResources" + HttpProxy: + description: | + HTTP-proxy configured for the daemon. This value is obtained from the + [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + type: "string" + example: "http://xxxxx:xxxxx@proxy.corp.example.com:8080" + HttpsProxy: + description: | + HTTPS-proxy configured for the daemon. This value is obtained from the + [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + type: "string" + example: "https://xxxxx:xxxxx@proxy.corp.example.com:4443" + NoProxy: + description: | + Comma-separated list of domain extensions for which no proxy should be + used. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) + environment variable. + + Containers do not automatically inherit this configuration. + type: "string" + example: "*.local, 169.254/16" + Name: + description: "Hostname of the host." + type: "string" + example: "node5.corp.example.com" + Labels: + description: | + User-defined labels (key/value metadata) as set on the daemon. + +


+ + > **Note**: When part of a Swarm, nodes can both have _daemon_ labels, + > set through the daemon configuration, and _node_ labels, set from a + > manager node in the Swarm. Node labels are not included in this + > field. Node labels can be retrieved using the `/nodes/(id)` endpoint + > on a manager node in the Swarm. + type: "array" + items: + type: "string" + example: ["storage=ssd", "production"] + ExperimentalBuild: + description: | + Indicates if experimental features are enabled on the daemon. + type: "boolean" + example: true + ServerVersion: + description: | + Version string of the daemon. + type: "string" + example: "27.0.1" + Runtimes: + description: | + List of [OCI compliant](https://github.com/opencontainers/runtime-spec) + runtimes configured on the daemon. Keys hold the "name" used to + reference the runtime. + + The Docker daemon relies on an OCI compliant runtime (invoked via the + `containerd` daemon) as its interface to the Linux kernel namespaces, + cgroups, and SELinux. + + The default runtime is `runc`, and automatically configured. Additional + runtimes can be configured by the user and will be listed here. + type: "object" + additionalProperties: + $ref: "#/definitions/Runtime" + default: + runc: + path: "runc" + example: + runc: + path: "runc" + runc-master: + path: "/go/bin/runc" + custom: + path: "/usr/local/bin/my-oci-runtime" + runtimeArgs: ["--debug", "--systemd-cgroup=false"] + DefaultRuntime: + description: | + Name of the default OCI runtime that is used when starting containers. + + The default can be overridden per-container at create time. + type: "string" + default: "runc" + example: "runc" + Swarm: + $ref: "#/definitions/SwarmInfo" + LiveRestoreEnabled: + description: | + Indicates if live restore is enabled. + + If enabled, containers are kept running when the daemon is shutdown + or upon daemon start if running containers are detected. + type: "boolean" + default: false + example: false + Isolation: + description: | + Represents the isolation technology to use as a default for containers. + The supported values are platform-specific. + + If no isolation value is specified on daemon start, on Windows client, + the default is `hyperv`, and on Windows server, the default is `process`. + + This option is currently not used on other platforms. + default: "default" + type: "string" + enum: + - "default" + - "hyperv" + - "process" + - "" + InitBinary: + description: | + Name and, optional, path of the `docker-init` binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + type: "string" + example: "docker-init" + ContainerdCommit: + $ref: "#/definitions/Commit" + RuncCommit: + $ref: "#/definitions/Commit" + InitCommit: + $ref: "#/definitions/Commit" + SecurityOptions: + description: | + List of security features that are enabled on the daemon, such as + apparmor, seccomp, SELinux, user-namespaces (userns), rootless and + no-new-privileges. + + Additional configuration options for each security feature may + be present, and are included as a comma-separated list of key/value + pairs. + type: "array" + items: + type: "string" + example: + - "name=apparmor" + - "name=seccomp,profile=default" + - "name=selinux" + - "name=userns" + - "name=rootless" + ProductLicense: + description: | + Reports a summary of the product license on the daemon. + + If a commercial license has been applied to the daemon, information + such as number of nodes, and expiration are included. + type: "string" + example: "Community Engine" + DefaultAddressPools: + description: | + List of custom default address pools for local networks, which can be + specified in the daemon.json file or dockerd option. + + Example: a Base "10.10.0.0/16" with Size 24 will define the set of 256 + 10.10.[0-255].0/24 address pools. + type: "array" + items: + type: "object" + properties: + Base: + description: "The network address in CIDR format" + type: "string" + example: "10.10.0.0/16" + Size: + description: "The network pool size" + type: "integer" + example: "24" + FirewallBackend: + $ref: "#/definitions/FirewallInfo" + DiscoveredDevices: + description: | + List of devices discovered by device drivers. + + Each device includes information about its source driver, kind, name, + and additional driver-specific attributes. + type: "array" + items: + $ref: "#/definitions/DeviceInfo" + Warnings: + description: | + List of warnings / informational messages about missing features, or + issues related to the daemon configuration. + + These messages can be printed by the client as information to the user. + type: "array" + items: + type: "string" + example: + - "WARNING: No memory limit support" + CDISpecDirs: + description: | + List of directories where (Container Device Interface) CDI + specifications are located. + + These specifications define vendor-specific modifications to an OCI + runtime specification for a container being created. + + An empty list indicates that CDI device injection is disabled. + + Note that since using CDI device injection requires the daemon to have + experimental enabled. For non-experimental daemons an empty list will + always be returned. + type: "array" + items: + type: "string" + example: + - "/etc/cdi" + - "/var/run/cdi" + Containerd: + $ref: "#/definitions/ContainerdInfo" + + ContainerdInfo: + description: | + Information for connecting to the containerd instance that is used by the daemon. + This is included for debugging purposes only. + type: "object" + x-nullable: true + properties: + Address: + description: "The address of the containerd socket." + type: "string" + example: "/run/containerd/containerd.sock" + Namespaces: + description: | + The namespaces that the daemon uses for running containers and + plugins in containerd. These namespaces can be configured in the + daemon configuration, and are considered to be used exclusively + by the daemon, Tampering with the containerd instance may cause + unexpected behavior. + + As these namespaces are considered to be exclusively accessed + by the daemon, it is not recommended to change these values, + or to change them to a value that is used by other systems, + such as cri-containerd. + type: "object" + properties: + Containers: + description: | + The default containerd namespace used for containers managed + by the daemon. + + The default namespace for containers is "moby", but will be + suffixed with the `.` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + type: "string" + default: "moby" + example: "moby" + Plugins: + description: | + The default containerd namespace used for plugins managed by + the daemon. + + The default namespace for plugins is "plugins.moby", but will be + suffixed with the `.` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + type: "string" + default: "plugins.moby" + example: "plugins.moby" + + FirewallInfo: + description: | + Information about the daemon's firewalling configuration. + + This field is currently only used on Linux, and omitted on other platforms. + type: "object" + x-nullable: true + properties: + Driver: + description: | + The name of the firewall backend driver. + type: "string" + example: "nftables" + Info: + description: | + Information about the firewall backend, provided as + "label" / "value" pairs. + +


+ + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "array" + items: + type: "array" + items: + type: "string" + example: + - ["ReloadedAt", "2025-01-01T00:00:00Z"] + + # PluginsInfo is a temp struct holding Plugins name + # registered with docker daemon. It is used by Info struct + PluginsInfo: + description: | + Available plugins per type. + +


+ + > **Note**: Only unmanaged (V1) plugins are included in this list. + > V1 plugins are "lazily" loaded, and are not returned in this list + > if there is no resource using the plugin. + type: "object" + properties: + Volume: + description: "Names of available volume-drivers, and network-driver plugins." + type: "array" + items: + type: "string" + example: ["local"] + Network: + description: "Names of available network-drivers, and network-driver plugins." + type: "array" + items: + type: "string" + example: ["bridge", "host", "ipvlan", "macvlan", "null", "overlay"] + Authorization: + description: "Names of available authorization plugins." + type: "array" + items: + type: "string" + example: ["img-authz-plugin", "hbm"] + Log: + description: "Names of available logging-drivers, and logging-driver plugins." + type: "array" + items: + type: "string" + example: ["awslogs", "fluentd", "gcplogs", "gelf", "journald", "json-file", "splunk", "syslog"] + + + RegistryServiceConfig: + description: | + RegistryServiceConfig stores daemon registry services configuration. + type: "object" + x-nullable: true + properties: + InsecureRegistryCIDRs: + description: | + List of IP ranges of insecure registries, using the CIDR syntax + ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries + accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates + from unknown CAs) communication. + + By default, local registries (`::1/128` and `127.0.0.0/8`) are configured as + insecure. All other registries are secure. Communicating with an + insecure registry is not possible if the daemon assumes that registry + is secure. + + This configuration override this behavior, insecure communication with + registries whose resolved IP address is within the subnet described by + the CIDR syntax. + + Registries can also be marked insecure by hostname. Those registries + are listed under `IndexConfigs` and have their `Secure` field set to + `false`. + + > **Warning**: Using this option can be useful when running a local + > registry, but introduces security vulnerabilities. This option + > should therefore ONLY be used for testing purposes. For increased + > security, users should add their CA to their system's list of trusted + > CAs instead of enabling this option. + type: "array" + items: + type: "string" + example: ["::1/128", "127.0.0.0/8"] + IndexConfigs: + type: "object" + additionalProperties: + $ref: "#/definitions/IndexInfo" + example: + "127.0.0.1:5000": + "Name": "127.0.0.1:5000" + "Mirrors": [] + "Secure": false + "Official": false + "[2001:db8:a0b:12f0::1]:80": + "Name": "[2001:db8:a0b:12f0::1]:80" + "Mirrors": [] + "Secure": false + "Official": false + "docker.io": + Name: "docker.io" + Mirrors: ["https://hub-mirror.corp.example.com:5000/"] + Secure: true + Official: true + "registry.internal.corp.example.com:3000": + Name: "registry.internal.corp.example.com:3000" + Mirrors: [] + Secure: false + Official: false + Mirrors: + description: | + List of registry URLs that act as a mirror for the official + (`docker.io`) registry. + + type: "array" + items: + type: "string" + example: + - "https://hub-mirror.corp.example.com:5000/" + - "https://[2001:db8:a0b:12f0::1]/" + + IndexInfo: + description: + IndexInfo contains information about a registry. + type: "object" + x-nullable: true + properties: + Name: + description: | + Name of the registry, such as "docker.io". + type: "string" + example: "docker.io" + Mirrors: + description: | + List of mirrors, expressed as URIs. + type: "array" + items: + type: "string" + example: + - "https://hub-mirror.corp.example.com:5000/" + - "https://registry-2.docker.io/" + - "https://registry-3.docker.io/" + Secure: + description: | + Indicates if the registry is part of the list of insecure + registries. + + If `false`, the registry is insecure. Insecure registries accept + un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from + unknown CAs) communication. + + > **Warning**: Insecure registries can be useful when running a local + > registry. However, because its use creates security vulnerabilities + > it should ONLY be enabled for testing purposes. For increased + > security, users should add their CA to their system's list of + > trusted CAs instead of enabling this option. + type: "boolean" + example: true + Official: + description: | + Indicates whether this is an official registry (i.e., Docker Hub / docker.io) + type: "boolean" + example: true + + Runtime: + description: | + Runtime describes an [OCI compliant](https://github.com/opencontainers/runtime-spec) + runtime. + + The runtime is invoked by the daemon via the `containerd` daemon. OCI + runtimes act as an interface to the Linux kernel namespaces, cgroups, + and SELinux. + type: "object" + properties: + path: + description: | + Name and, optional, path, of the OCI executable binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + type: "string" + example: "/usr/local/bin/my-oci-runtime" + runtimeArgs: + description: | + List of command-line arguments to pass to the runtime when invoked. + type: "array" + x-nullable: true + items: + type: "string" + example: ["--debug", "--systemd-cgroup=false"] + status: + description: | + Information specific to the runtime. + + While this API specification does not define data provided by runtimes, + the following well-known properties may be provided by runtimes: + + `org.opencontainers.runtime-spec.features`: features structure as defined + in the [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec/blob/main/features.md), + in a JSON string representation. + +


+ + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + "org.opencontainers.runtime-spec.features": "{\"ociVersionMin\":\"1.0.0\",\"ociVersionMax\":\"1.1.0\",\"...\":\"...\"}" + + Commit: + description: | + Commit holds the Git-commit (SHA1) that a binary was built from, as + reported in the version-string of external tools, such as `containerd`, + or `runC`. + type: "object" + properties: + ID: + description: "Actual commit ID of external tool." + type: "string" + example: "cfb82a876ecc11b5ca0977d1733adbe58599088a" + + SwarmInfo: + description: | + Represents generic information about swarm. + type: "object" + properties: + NodeID: + description: "Unique identifier of for this node in the swarm." + type: "string" + default: "" + example: "k67qz4598weg5unwwffg6z1m1" + NodeAddr: + description: | + IP address at which this node can be reached by other nodes in the + swarm. + type: "string" + default: "" + example: "10.0.0.46" + LocalNodeState: + $ref: "#/definitions/LocalNodeState" + ControlAvailable: + type: "boolean" + default: false + example: true + Error: + type: "string" + default: "" + RemoteManagers: + description: | + List of ID's and addresses of other managers in the swarm. + type: "array" + default: null + x-nullable: true + items: + $ref: "#/definitions/PeerNode" + example: + - NodeID: "71izy0goik036k48jg985xnds" + Addr: "10.0.0.158:2377" + - NodeID: "79y6h1o4gv8n120drcprv5nmc" + Addr: "10.0.0.159:2377" + - NodeID: "k67qz4598weg5unwwffg6z1m1" + Addr: "10.0.0.46:2377" + Nodes: + description: "Total number of nodes in the swarm." + type: "integer" + x-nullable: true + example: 4 + Managers: + description: "Total number of managers in the swarm." + type: "integer" + x-nullable: true + example: 3 + Cluster: + $ref: "#/definitions/ClusterInfo" + + LocalNodeState: + description: "Current local status of this node." + type: "string" + default: "" + enum: + - "" + - "inactive" + - "pending" + - "active" + - "error" + - "locked" + example: "active" + + PeerNode: + description: "Represents a peer-node in the swarm" + type: "object" + properties: + NodeID: + description: "Unique identifier of for this node in the swarm." + type: "string" + Addr: + description: | + IP address and ports at which this node can be reached. + type: "string" + + NetworkAttachmentConfig: + description: | + Specifies how a service should be attached to a particular network. + type: "object" + properties: + Target: + description: | + The target network for attachment. Must be a network name or ID. + type: "string" + Aliases: + description: | + Discoverable alternate names for the service on this network. + type: "array" + items: + type: "string" + DriverOpts: + description: | + Driver attachment options for the network target. + type: "object" + additionalProperties: + type: "string" + + EventActor: + description: | + Actor describes something that generates events, like a container, network, + or a volume. + type: "object" + properties: + ID: + description: "The ID of the object emitting the event" + type: "string" + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + Attributes: + description: | + Various key/value attributes of the object, depending on its type. + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-label-value" + image: "alpine:latest" + name: "my-container" + + EventMessage: + description: | + EventMessage represents the information an event contains. + type: "object" + title: "SystemEventsResponse" + properties: + Type: + description: "The type of object emitting the event" + type: "string" + enum: ["builder", "config", "container", "daemon", "image", "network", "node", "plugin", "secret", "service", "volume"] + example: "container" + Action: + description: "The type of event" + type: "string" + example: "create" + Actor: + $ref: "#/definitions/EventActor" + scope: + description: | + Scope of the event. Engine events are `local` scope. Cluster (Swarm) + events are `swarm` scope. + type: "string" + enum: ["local", "swarm"] + time: + description: "Timestamp of event" + type: "integer" + format: "int64" + example: 1629574695 + timeNano: + description: "Timestamp of event, with nanosecond accuracy" + type: "integer" + format: "int64" + example: 1629574695515050031 + + OCIDescriptor: + type: "object" + x-go-name: Descriptor + description: | + A descriptor struct containing digest, media type, and size, as defined in + the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). + properties: + mediaType: + description: | + The media type of the object this schema refers to. + type: "string" + example: "application/vnd.oci.image.manifest.v1+json" + digest: + description: | + The digest of the targeted content. + type: "string" + example: "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96" + size: + description: | + The size in bytes of the blob. + type: "integer" + format: "int64" + example: 424 + urls: + description: |- + List of URLs from which this object MAY be downloaded. + type: "array" + items: + type: "string" + format: "uri" + x-nullable: true + annotations: + description: |- + Arbitrary metadata relating to the targeted content. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + "com.docker.official-images.bashbrew.arch": "amd64" + "org.opencontainers.image.base.digest": "sha256:0d0ef5c914d3ea700147da1bd050c59edb8bb12ca312f3800b29d7c8087eabd8" + "org.opencontainers.image.base.name": "scratch" + "org.opencontainers.image.created": "2025-01-27T00:00:00Z" + "org.opencontainers.image.revision": "9fabb4bad5138435b01857e2fe9363e2dc5f6a79" + "org.opencontainers.image.source": "https://git.launchpad.net/cloud-images/+oci/ubuntu-base" + "org.opencontainers.image.url": "https://hub.docker.com/_/ubuntu" + "org.opencontainers.image.version": "24.04" + data: + type: string + x-nullable: true + description: |- + Data is an embedding of the targeted content. This is encoded as a base64 + string when marshalled to JSON (automatically, by encoding/json). If + present, Data can be used directly to avoid fetching the targeted content. + example: null + platform: + $ref: "#/definitions/OCIPlatform" + artifactType: + description: |- + ArtifactType is the IANA media type of this artifact. + type: "string" + x-nullable: true + example: null + + OCIPlatform: + type: "object" + x-go-name: Platform + x-nullable: true + description: | + Describes the platform which the image in the manifest runs on, as defined + in the [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md). + properties: + architecture: + description: | + The CPU architecture, for example `amd64` or `ppc64`. + type: "string" + example: "arm" + os: + description: | + The operating system, for example `linux` or `windows`. + type: "string" + example: "windows" + os.version: + description: | + Optional field specifying the operating system version, for example on + Windows `10.0.19041.1165`. + type: "string" + example: "10.0.19041.1165" + os.features: + description: | + Optional field specifying an array of strings, each listing a required + OS feature (for example on Windows `win32k`). + type: "array" + items: + type: "string" + example: + - "win32k" + variant: + description: | + Optional field specifying a variant of the CPU, for example `v7` to + specify ARMv7 when architecture is `arm`. + type: "string" + example: "v7" + + DistributionInspect: + type: "object" + x-go-name: DistributionInspect + title: "DistributionInspectResponse" + required: [Descriptor, Platforms] + description: | + Describes the result obtained from contacting the registry to retrieve + image metadata. + properties: + Descriptor: + $ref: "#/definitions/OCIDescriptor" + Platforms: + type: "array" + description: | + An array containing all platforms supported by the image. + items: + $ref: "#/definitions/OCIPlatform" + + ClusterVolume: + type: "object" + description: | + Options and information specific to, and only present on, Swarm CSI + cluster volumes. + properties: + ID: + type: "string" + description: | + The Swarm ID of this volume. Because cluster volumes are Swarm + objects, they have an ID, unlike non-cluster volumes. This ID can + be used to refer to the Volume instead of the name. + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ClusterVolumeSpec" + Info: + type: "object" + description: | + Information about the global status of the volume. + properties: + CapacityBytes: + type: "integer" + format: "int64" + description: | + The capacity of the volume in bytes. A value of 0 indicates that + the capacity is unknown. + VolumeContext: + type: "object" + description: | + A map of strings to strings returned from the storage plugin when + the volume is created. + additionalProperties: + type: "string" + VolumeID: + type: "string" + description: | + The ID of the volume as returned by the CSI storage plugin. This + is distinct from the volume's ID as provided by Docker. This ID + is never used by the user when communicating with Docker to refer + to this volume. If the ID is blank, then the Volume has not been + successfully created in the plugin yet. + AccessibleTopology: + type: "array" + description: | + The topology this volume is actually accessible from. + items: + $ref: "#/definitions/Topology" + PublishStatus: + type: "array" + description: | + The status of the volume as it pertains to its publishing and use on + specific nodes + items: + type: "object" + properties: + NodeID: + type: "string" + description: | + The ID of the Swarm node the volume is published on. + State: + type: "string" + description: | + The published state of the volume. + * `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed. + * `published` The volume is published successfully to the node. + * `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so. + * `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller. + enum: + - "pending-publish" + - "published" + - "pending-node-unpublish" + - "pending-controller-unpublish" + PublishContext: + type: "object" + description: | + A map of strings to strings returned by the CSI controller + plugin when a volume is published. + additionalProperties: + type: "string" + + ClusterVolumeSpec: + type: "object" + description: | + Cluster-specific options used to create the volume. + properties: + Group: + type: "string" + description: | + Group defines the volume group of this volume. Volumes belonging to + the same group can be referred to by group name when creating + Services. Referring to a volume by group instructs Swarm to treat + volumes in that group interchangeably for the purpose of scheduling. + Volumes with an empty string for a group technically all belong to + the same, emptystring group. + AccessMode: + type: "object" + description: | + Defines how the volume is used by tasks. + properties: + Scope: + type: "string" + description: | + The set of nodes this volume can be used on at one time. + - `single` The volume may only be scheduled to one node at a time. + - `multi` the volume may be scheduled to any supported number of nodes at a time. + default: "single" + enum: ["single", "multi"] + x-nullable: false + Sharing: + type: "string" + description: | + The number and way that different tasks can use this volume + at one time. + - `none` The volume may only be used by one task at a time. + - `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly + - `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write. + - `all` The volume may have any number of readers and writers. + default: "none" + enum: ["none", "readonly", "onewriter", "all"] + x-nullable: false + MountVolume: + type: "object" + description: | + Options for using this volume as a Mount-type volume. + + Either MountVolume or BlockVolume, but not both, must be + present. + properties: + FsType: + type: "string" + description: | + Specifies the filesystem type for the mount volume. + Optional. + MountFlags: + type: "array" + description: | + Flags to pass when mounting the volume. Optional. + items: + type: "string" + BlockVolume: + type: "object" + description: | + Options for using this volume as a Block-type volume. + Intentionally empty. + Secrets: + type: "array" + description: | + Swarm Secrets that are passed to the CSI storage plugin when + operating on this volume. + items: + type: "object" + description: | + One cluster volume secret entry. Defines a key-value pair that + is passed to the plugin. + properties: + Key: + type: "string" + description: | + Key is the name of the key of the key-value pair passed to + the plugin. + Secret: + type: "string" + description: | + Secret is the swarm Secret object from which to read data. + This can be a Secret name or ID. The Secret data is + retrieved by swarm and used as the value of the key-value + pair passed to the plugin. + AccessibilityRequirements: + type: "object" + description: | + Requirements for the accessible topology of the volume. These + fields are optional. For an in-depth description of what these + fields mean, see the CSI specification. + properties: + Requisite: + type: "array" + description: | + A list of required topologies, at least one of which the + volume must be accessible from. + items: + $ref: "#/definitions/Topology" + Preferred: + type: "array" + description: | + A list of topologies that the volume should attempt to be + provisioned in. + items: + $ref: "#/definitions/Topology" + CapacityRange: + type: "object" + description: | + The desired capacity that the volume should be created with. If + empty, the plugin will decide the capacity. + properties: + RequiredBytes: + type: "integer" + format: "int64" + description: | + The volume must be at least this big. The value of 0 + indicates an unspecified minimum + LimitBytes: + type: "integer" + format: "int64" + description: | + The volume must not be bigger than this. The value of 0 + indicates an unspecified maximum. + Availability: + type: "string" + description: | + The availability of the volume for use in tasks. + - `active` The volume is fully available for scheduling on the cluster + - `pause` No new workloads should use the volume, but existing workloads are not stopped. + - `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started. + default: "active" + x-nullable: false + enum: + - "active" + - "pause" + - "drain" + + Topology: + description: | + A map of topological domains to topological segments. For in depth + details, see documentation for the Topology object in the CSI + specification. + type: "object" + additionalProperties: + type: "string" + + ImageManifestSummary: + x-go-name: "ManifestSummary" + description: | + ImageManifestSummary represents a summary of an image manifest. + type: "object" + required: ["ID", "Descriptor", "Available", "Size", "Kind"] + properties: + ID: + description: | + ID is the content-addressable ID of an image and is the same as the + digest of the image manifest. + type: "string" + example: "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f" + Descriptor: + $ref: "#/definitions/OCIDescriptor" + Available: + description: Indicates whether all the child content (image config, layers) is fully available locally. + type: "boolean" + example: true + Size: + type: "object" + x-nullable: false + required: ["Content", "Total"] + properties: + Total: + type: "integer" + format: "int64" + example: 8213251 + description: | + Total is the total size (in bytes) of all the locally present + data (both distributable and non-distributable) that's related to + this manifest and its children. + This equal to the sum of [Content] size AND all the sizes in the + [Size] struct present in the Kind-specific data struct. + For example, for an image kind (Kind == "image") + this would include the size of the image content and unpacked + image snapshots ([Size.Content] + [ImageData.Size.Unpacked]). + Content: + description: | + Content is the size (in bytes) of all the locally present + content in the content store (e.g. image config, layers) + referenced by this manifest and its children. + This only includes blobs in the content store. + type: "integer" + format: "int64" + example: 3987495 + Kind: + type: "string" + example: "image" + enum: + - "image" + - "attestation" + - "unknown" + description: | + The kind of the manifest. + + kind | description + -------------|----------------------------------------------------------- + image | Image manifest that can be used to start a container. + attestation | Attestation manifest produced by the Buildkit builder for a specific image manifest. + ImageData: + description: | + The image data for the image manifest. + This field is only populated when Kind is "image". + type: "object" + x-nullable: true + x-omitempty: true + required: ["Platform", "Containers", "Size", "UnpackedSize"] + properties: + Platform: + $ref: "#/definitions/OCIPlatform" + description: | + OCI platform of the image. This will be the platform specified in the + manifest descriptor from the index/manifest list. + If it's not available, it will be obtained from the image config. + Containers: + description: | + The IDs of the containers that are using this image. + type: "array" + items: + type: "string" + example: ["ede54ee1fda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c7430", "abadbce344c096744d8d6071a90d474d28af8f1034b5ea9fb03c3f4bfc6d005e"] + Size: + type: "object" + x-nullable: false + required: ["Unpacked"] + properties: + Unpacked: + type: "integer" + format: "int64" + example: 3987495 + description: | + Unpacked is the size (in bytes) of the locally unpacked + (uncompressed) image content that's directly usable by the containers + running this image. + It's independent of the distributable content - e.g. + the image might still have an unpacked data that's still used by + some container even when the distributable/compressed content is + already gone. + AttestationData: + description: | + The image data for the attestation manifest. + This field is only populated when Kind is "attestation". + type: "object" + x-nullable: true + x-omitempty: true + required: ["For"] + properties: + For: + description: | + The digest of the image manifest that this attestation is for. + type: "string" + example: "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f" + +paths: + /containers/json: + get: + summary: "List containers" + description: | + Returns a list of containers. For details on the format, see the + [inspect endpoint](#operation/ContainerInspect). + + Note that it uses a different, smaller representation of a container + than inspecting a single container. For example, the list of linked + containers is not propagated . + operationId: "ContainerList" + produces: + - "application/json" + parameters: + - name: "all" + in: "query" + description: | + Return all containers. By default, only running containers are shown. + type: "boolean" + default: false + - name: "limit" + in: "query" + description: | + Return this number of most recently created containers, including + non-running ones. + type: "integer" + - name: "size" + in: "query" + description: | + Return the size of container as fields `SizeRw` and `SizeRootFs`. + type: "boolean" + default: false + - name: "filters" + in: "query" + description: | + Filters to process on the container list, encoded as JSON (a + `map[string][]string`). For example, `{"status": ["paused"]}` will + only return paused containers. + + Available filters: + + - `ancestor`=(`[:]`, ``, or ``) + - `before`=(`` or ``) + - `expose`=(`[/]`|`/[]`) + - `exited=` containers with exit code of `` + - `health`=(`starting`|`healthy`|`unhealthy`|`none`) + - `id=` a container's ID + - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only) + - `is-task=`(`true`|`false`) + - `label=key` or `label="key=value"` of a container label + - `name=` a container's name + - `network`=(`` or ``) + - `publish`=(`[/]`|`/[]`) + - `since`=(`` or ``) + - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`) + - `volume`=(`` or ``) + type: "string" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/ContainerSummary" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /containers/create: + post: + summary: "Create a container" + operationId: "ContainerCreate" + consumes: + - "application/json" + - "application/octet-stream" + produces: + - "application/json" + parameters: + - name: "name" + in: "query" + description: | + Assign the specified name to the container. Must match + `/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`. + type: "string" + pattern: "^/?[a-zA-Z0-9][a-zA-Z0-9_.-]+$" + - name: "platform" + in: "query" + description: | + Platform in the format `os[/arch[/variant]]` used for image lookup. + + When specified, the daemon checks if the requested image is present + in the local image cache with the given OS and Architecture, and + otherwise returns a `404` status. + + If the option is not set, the host's native OS and Architecture are + used to look up the image in the image cache. However, if no platform + is passed and the given image does exist in the local image cache, + but its OS or architecture does not match, the container is created + with the available image, and a warning is added to the `Warnings` + field in the response, for example; + + WARNING: The requested image's platform (linux/arm64/v8) does not + match the detected host platform (linux/amd64) and no + specific platform was requested + + type: "string" + default: "" + - name: "body" + in: "body" + description: "Container to create" + schema: + allOf: + - $ref: "#/definitions/ContainerConfig" + - type: "object" + properties: + HostConfig: + $ref: "#/definitions/HostConfig" + NetworkingConfig: + $ref: "#/definitions/NetworkingConfig" + example: + Hostname: "" + Domainname: "" + User: "" + AttachStdin: false + AttachStdout: true + AttachStderr: true + Tty: false + OpenStdin: false + StdinOnce: false + Env: + - "FOO=bar" + - "BAZ=quux" + Cmd: + - "date" + Entrypoint: "" + Image: "ubuntu" + Labels: + com.example.vendor: "Acme" + com.example.license: "GPL" + com.example.version: "1.0" + Volumes: + /volumes/data: {} + WorkingDir: "" + NetworkDisabled: false + MacAddress: "12:34:56:78:9a:bc" + ExposedPorts: + 22/tcp: {} + StopSignal: "SIGTERM" + StopTimeout: 10 + HostConfig: + Binds: + - "/tmp:/tmp" + Links: + - "redis3:redis" + Memory: 0 + MemorySwap: 0 + MemoryReservation: 0 + NanoCpus: 500000 + CpuPercent: 80 + CpuShares: 512 + CpuPeriod: 100000 + CpuRealtimePeriod: 1000000 + CpuRealtimeRuntime: 10000 + CpuQuota: 50000 + CpusetCpus: "0,1" + CpusetMems: "0,1" + MaximumIOps: 0 + MaximumIOBps: 0 + BlkioWeight: 300 + BlkioWeightDevice: + - {} + BlkioDeviceReadBps: + - {} + BlkioDeviceReadIOps: + - {} + BlkioDeviceWriteBps: + - {} + BlkioDeviceWriteIOps: + - {} + DeviceRequests: + - Driver: "nvidia" + Count: -1 + DeviceIDs": ["0", "1", "GPU-fef8089b-4820-abfc-e83e-94318197576e"] + Capabilities: [["gpu", "nvidia", "compute"]] + Options: + property1: "string" + property2: "string" + MemorySwappiness: 60 + OomKillDisable: false + OomScoreAdj: 500 + PidMode: "" + PidsLimit: 0 + PortBindings: + 22/tcp: + - HostPort: "11022" + PublishAllPorts: false + Privileged: false + ReadonlyRootfs: false + Dns: + - "8.8.8.8" + DnsOptions: + - "" + DnsSearch: + - "" + VolumesFrom: + - "parent" + - "other:ro" + CapAdd: + - "NET_ADMIN" + CapDrop: + - "MKNOD" + GroupAdd: + - "newgroup" + RestartPolicy: + Name: "" + MaximumRetryCount: 0 + AutoRemove: true + NetworkMode: "bridge" + Devices: [] + Ulimits: + - {} + LogConfig: + Type: "json-file" + Config: {} + SecurityOpt: [] + StorageOpt: {} + CgroupParent: "" + VolumeDriver: "" + ShmSize: 67108864 + NetworkingConfig: + EndpointsConfig: + isolated_nw: + IPAMConfig: + IPv4Address: "172.20.30.33" + IPv6Address: "2001:db8:abcd::3033" + LinkLocalIPs: + - "169.254.34.68" + - "fe80::3468" + Links: + - "container_1" + - "container_2" + Aliases: + - "server_x" + - "server_y" + database_nw: {} + + required: true + responses: + 201: + description: "Container created successfully" + schema: + $ref: "#/definitions/ContainerCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such image" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: c2ada9df5af8" + 409: + description: "conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /containers/{id}/json: + get: + summary: "Inspect a container" + description: "Return low-level information about a container." + operationId: "ContainerInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerInspectResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "size" + in: "query" + type: "boolean" + default: false + description: "Return the size of container as fields `SizeRw` and `SizeRootFs`" + tags: ["Container"] + /containers/{id}/top: + get: + summary: "List processes running inside a container" + description: | + On Unix systems, this is done by running the `ps` command. This endpoint + is not supported on Windows. + operationId: "ContainerTop" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerTopResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "ps_args" + in: "query" + description: "The arguments to pass to `ps`. For example, `aux`" + type: "string" + default: "-ef" + tags: ["Container"] + /containers/{id}/logs: + get: + summary: "Get container logs" + description: | + Get `stdout` and `stderr` logs from a container. + + Note: This endpoint works only for containers with the `json-file` or + `journald` logging driver. + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + operationId: "ContainerLogs" + responses: + 200: + description: | + logs returned as a stream in response body. + For the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach). + Note that unlike the attach endpoint, the logs endpoint does not + upgrade the connection and does not set Content-Type. + schema: + type: "string" + format: "binary" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "until" + in: "query" + description: "Only return logs before this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Container"] + /containers/{id}/changes: + get: + summary: "Get changes on a container’s filesystem" + description: | + Returns which files in a container's filesystem have been added, deleted, + or modified. The `Kind` of modification can be one of: + + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") + operationId: "ContainerChanges" + produces: ["application/json"] + responses: + 200: + description: "The list of changes" + schema: + type: "array" + items: + $ref: "#/definitions/FilesystemChange" + examples: + application/json: + - Path: "/dev" + Kind: 0 + - Path: "/dev/kmsg" + Kind: 1 + - Path: "/test" + Kind: 1 + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/export: + get: + summary: "Export a container" + description: "Export the contents of a container as a tarball." + operationId: "ContainerExport" + produces: + - "application/octet-stream" + responses: + 200: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/stats: + get: + summary: "Get container stats based on resource usage" + description: | + This endpoint returns a live stream of a container’s resource usage + statistics. + + The `precpu_stats` is the CPU statistic of the *previous* read, and is + used to calculate the CPU usage percentage. It is not an exact copy + of the `cpu_stats` field. + + If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is + nil then for compatibility with older daemons the length of the + corresponding `cpu_usage.percpu_usage` array should be used. + + On a cgroup v2 host, the following fields are not set + * `blkio_stats`: all fields other than `io_service_bytes_recursive` + * `cpu_stats`: `cpu_usage.percpu_usage` + * `memory_stats`: `max_usage` and `failcnt` + Also, `memory_stats.stats` fields are incompatible with cgroup v1. + + To calculate the values shown by the `stats` command of the docker cli tool + the following formulas can be used: + * used_memory = `memory_stats.usage - memory_stats.stats.cache` + * available_memory = `memory_stats.limit` + * Memory usage % = `(used_memory / available_memory) * 100.0` + * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` + * system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage` + * number_cpus = `length(cpu_stats.cpu_usage.percpu_usage)` or `cpu_stats.online_cpus` + * CPU usage % = `(cpu_delta / system_cpu_delta) * number_cpus * 100.0` + operationId: "ContainerStats" + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerStatsResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "stream" + in: "query" + description: | + Stream the output. If false, the stats will be output once and then + it will disconnect. + type: "boolean" + default: true + - name: "one-shot" + in: "query" + description: | + Only get a single stat instead of waiting for 2 cycles. Must be used + with `stream=false`. + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/resize: + post: + summary: "Resize a container TTY" + description: "Resize the TTY for a container." + operationId: "ContainerResize" + consumes: + - "application/octet-stream" + produces: + - "text/plain" + responses: + 200: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "cannot resize container" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "h" + in: "query" + required: true + description: "Height of the TTY session in characters" + type: "integer" + - name: "w" + in: "query" + required: true + description: "Width of the TTY session in characters" + type: "integer" + tags: ["Container"] + /containers/{id}/start: + post: + summary: "Start a container" + operationId: "ContainerStart" + responses: + 204: + description: "no error" + 304: + description: "container already started" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container. Format is a + single character `[a-Z]` or `ctrl-` where `` is one + of: `a-z`, `@`, `^`, `[`, `,` or `_`. + type: "string" + tags: ["Container"] + /containers/{id}/stop: + post: + summary: "Stop a container" + operationId: "ContainerStop" + responses: + 204: + description: "no error" + 304: + description: "container already stopped" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + - name: "t" + in: "query" + description: "Number of seconds to wait before killing the container" + type: "integer" + tags: ["Container"] + /containers/{id}/restart: + post: + summary: "Restart a container" + operationId: "ContainerRestart" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + - name: "t" + in: "query" + description: "Number of seconds to wait before killing the container" + type: "integer" + tags: ["Container"] + /containers/{id}/kill: + post: + summary: "Kill a container" + description: | + Send a POSIX signal to a container, defaulting to killing to the + container. + operationId: "ContainerKill" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "container is not running" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "Container d37cde0fe4ad63c3a7252023b2f9800282894247d145cb5933ddf6e52cc03a28 is not running" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + default: "SIGKILL" + tags: ["Container"] + /containers/{id}/update: + post: + summary: "Update a container" + description: | + Change various configuration options of a container without having to + recreate it. + operationId: "ContainerUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "The container has been updated." + schema: + $ref: "#/definitions/ContainerUpdateResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "update" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/Resources" + - type: "object" + properties: + RestartPolicy: + $ref: "#/definitions/RestartPolicy" + example: + BlkioWeight: 300 + CpuShares: 512 + CpuPeriod: 100000 + CpuQuota: 50000 + CpuRealtimePeriod: 1000000 + CpuRealtimeRuntime: 10000 + CpusetCpus: "0,1" + CpusetMems: "0" + Memory: 314572800 + MemorySwap: 514288000 + MemoryReservation: 209715200 + RestartPolicy: + MaximumRetryCount: 4 + Name: "on-failure" + tags: ["Container"] + /containers/{id}/rename: + post: + summary: "Rename a container" + operationId: "ContainerRename" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "name already in use" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "name" + in: "query" + required: true + description: "New name for the container" + type: "string" + tags: ["Container"] + /containers/{id}/pause: + post: + summary: "Pause a container" + description: | + Use the freezer cgroup to suspend all processes in a container. + + Traditionally, when suspending a process the `SIGSTOP` signal is used, + which is observable by the process being suspended. With the freezer + cgroup the process is unaware, and unable to capture, that it is being + suspended, and subsequently resumed. + operationId: "ContainerPause" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/unpause: + post: + summary: "Unpause a container" + description: "Resume a container which has been paused." + operationId: "ContainerUnpause" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/attach: + post: + summary: "Attach to a container" + description: | + Attach to a container to read its output or send it input. You can attach + to the same container multiple times and you can reattach to containers + that have been detached. + + Either the `stream` or `logs` parameter must be `true` for this endpoint + to do anything. + + See the [documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) + for more details. + + ### Hijacking + + This endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, + and `stderr` on the same socket. + + This is the response from the daemon for an attach request: + + ``` + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + [STREAM] + ``` + + After the headers and two new lines, the TCP connection can now be used + for raw, bidirectional communication between the client and server. + + To hint potential proxies about connection hijacking, the Docker client + can also optionally send connection upgrade headers. + + For example, the client sends this request to upgrade the connection: + + ``` + POST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1 + Upgrade: tcp + Connection: Upgrade + ``` + + The Docker daemon will respond with a `101 UPGRADED` response, and will + similarly follow with the raw stream: + + ``` + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + [STREAM] + ``` + + ### Stream format + + When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate), + the HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream + and the stream over the hijacked connected is multiplexed to separate out + `stdout` and `stderr`. The stream consists of a series of frames, each + containing a header and a payload. + + The header contains the information which the stream writes (`stdout` or + `stderr`). It also contains the size of the associated frame encoded in + the last four bytes (`uint32`). + + It is encoded on the first eight bytes like this: + + ```go + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + ``` + + `STREAM_TYPE` can be: + + - 0: `stdin` (is written on `stdout`) + - 1: `stdout` + - 2: `stderr` + + `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size + encoded as big endian. + + Following the header is the payload, which is the specified number of + bytes of `STREAM_TYPE`. + + The simplest way to implement this protocol is the following: + + 1. Read 8 bytes. + 2. Choose `stdout` or `stderr` depending on the first byte. + 3. Extract the frame size from the last four bytes. + 4. Read the extracted size and output it on the correct output. + 5. Goto 1. + + ### Stream format when using a TTY + + When the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate), + the stream is not multiplexed. The data exchanged over the hijacked + connection is simply the raw data from the process PTY and client's + `stdin`. + + operationId: "ContainerAttach" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 101: + description: "no error, hints proxy about hijacking" + 200: + description: "no error, no upgrade header found" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container.Format is a single + character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, + `@`, `^`, `[`, `,` or `_`. + type: "string" + - name: "logs" + in: "query" + description: | + Replay previous logs from the container. + + This is useful for attaching to a container that has started and you + want to output everything since the container started. + + If `stream` is also enabled, once all the previous output has been + returned, it will seamlessly transition into streaming current + output. + type: "boolean" + default: false + - name: "stream" + in: "query" + description: | + Stream attached streams from the time the request was made onwards. + type: "boolean" + default: false + - name: "stdin" + in: "query" + description: "Attach to `stdin`" + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Attach to `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Attach to `stderr`" + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/attach/ws: + get: + summary: "Attach to a container via a websocket" + operationId: "ContainerAttachWebsocket" + responses: + 101: + description: "no error, hints proxy about hijacking" + 200: + description: "no error, no upgrade header found" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container.Format is a single + character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, + `@`, `^`, `[`, `,`, or `_`. + type: "string" + - name: "logs" + in: "query" + description: "Return logs" + type: "boolean" + default: false + - name: "stream" + in: "query" + description: "Return stream" + type: "boolean" + default: false + - name: "stdin" + in: "query" + description: "Attach to `stdin`" + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Attach to `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Attach to `stderr`" + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/wait: + post: + summary: "Wait for a container" + description: "Block until a container stops, then returns the exit code." + operationId: "ContainerWait" + produces: ["application/json"] + responses: + 200: + description: "The container has exit." + schema: + $ref: "#/definitions/ContainerWaitResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "condition" + in: "query" + description: | + Wait until a container state reaches the given condition. + + Defaults to `not-running` if omitted or empty. + type: "string" + enum: + - "not-running" + - "next-exit" + - "removed" + default: "not-running" + tags: ["Container"] + /containers/{id}: + delete: + summary: "Remove a container" + operationId: "ContainerDelete" + responses: + 204: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "conflict" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: | + You cannot remove a running container: c2ada9df5af8. Stop the + container before attempting removal or force remove + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "v" + in: "query" + description: "Remove anonymous volumes associated with the container." + type: "boolean" + default: false + - name: "force" + in: "query" + description: "If the container is running, kill it before removing it." + type: "boolean" + default: false + - name: "link" + in: "query" + description: "Remove the specified link associated with the container." + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/archive: + head: + summary: "Get information about files in a container" + description: | + A response header `X-Docker-Container-Path-Stat` is returned, containing + a base64 - encoded JSON object with some filesystem header information + about the path. + operationId: "ContainerArchiveInfo" + responses: + 200: + description: "no error" + headers: + X-Docker-Container-Path-Stat: + type: "string" + description: | + A base64 - encoded JSON object with some filesystem header + information about the path + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Container or path does not exist" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Resource in the container’s filesystem to archive." + type: "string" + tags: ["Container"] + get: + summary: "Get an archive of a filesystem resource in a container" + description: "Get a tar archive of a resource in the filesystem of container id." + operationId: "ContainerArchive" + produces: ["application/x-tar"] + responses: + 200: + description: "no error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Container or path does not exist" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Resource in the container’s filesystem to archive." + type: "string" + tags: ["Container"] + put: + summary: "Extract an archive of files or folders to a directory in a container" + description: | + Upload a tar archive to be extracted to a path in the filesystem of container id. + `path` parameter is asserted to be a directory. If it exists as a file, 400 error + will be returned with message "not a directory". + operationId: "PutContainerArchive" + consumes: ["application/x-tar", "application/octet-stream"] + responses: + 200: + description: "The content was extracted successfully" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "not a directory" + 403: + description: "Permission denied, the volume or container rootfs is marked as read-only." + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such container or path does not exist inside the container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Path to a directory in the container to extract the archive’s contents into. " + type: "string" + - name: "noOverwriteDirNonDir" + in: "query" + description: | + If `1`, `true`, or `True` then it will be an error if unpacking the + given content would cause an existing directory to be replaced with + a non-directory and vice versa. + type: "string" + - name: "copyUIDGID" + in: "query" + description: | + If `1`, `true`, then it will copy UID/GID maps to the dest file or + dir + type: "string" + - name: "inputStream" + in: "body" + required: true + description: | + The input stream must be a tar archive compressed with one of the + following algorithms: `identity` (no compression), `gzip`, `bzip2`, + or `xz`. + schema: + type: "string" + format: "binary" + tags: ["Container"] + /containers/prune: + post: + summary: "Delete stopped containers" + produces: + - "application/json" + operationId: "ContainerPrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `until=` Prune containers created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune containers with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ContainerPruneResponse" + properties: + ContainersDeleted: + description: "Container IDs that were deleted" + type: "array" + items: + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /images/json: + get: + summary: "List Images" + description: "Returns a list of images on the server. Note that it uses a different, smaller representation of an image than inspecting a single image." + operationId: "ImageList" + produces: + - "application/json" + responses: + 200: + description: "Summary image data for the images matching the query" + schema: + type: "array" + items: + $ref: "#/definitions/ImageSummary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "all" + in: "query" + description: "Show all images. Only images from a final layer (no children) are shown by default." + type: "boolean" + default: false + - name: "filters" + in: "query" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the images list. + + Available filters: + + - `before`=(`[:]`, `` or ``) + - `dangling=true` + - `label=key` or `label="key=value"` of an image label + - `reference`=(`[:]`) + - `since`=(`[:]`, `` or ``) + - `until=` + type: "string" + - name: "shared-size" + in: "query" + description: "Compute and show shared size as a `SharedSize` field on each image." + type: "boolean" + default: false + - name: "digests" + in: "query" + description: "Show digest information as a `RepoDigests` field on each image." + type: "boolean" + default: false + - name: "manifests" + in: "query" + description: "Include `Manifests` in the image summary." + type: "boolean" + default: false + tags: ["Image"] + /build: + post: + summary: "Build an image" + description: | + Build an image from a tar archive with a `Dockerfile` in it. + + The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](https://docs.docker.com/engine/reference/builder/). + + The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output. + + The build is canceled if the client drops the connection by quitting or being killed. + operationId: "ImageBuild" + consumes: + - "application/octet-stream" + produces: + - "application/json" + parameters: + - name: "inputStream" + in: "body" + description: "A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz." + schema: + type: "string" + format: "binary" + - name: "dockerfile" + in: "query" + description: "Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`." + type: "string" + default: "Dockerfile" + - name: "t" + in: "query" + description: "A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default `latest` value is assumed. You can provide several `t` parameters." + type: "string" + - name: "extrahosts" + in: "query" + description: "Extra hosts to add to /etc/hosts" + type: "string" + - name: "remote" + in: "query" + description: "A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called `Dockerfile` and the image is built from that file. If the URI points to a tarball, the file is downloaded by the daemon and the contents therein used as the context for the build. If the URI points to a tarball and the `dockerfile` parameter is also specified, there must be a file with the corresponding path inside the tarball." + type: "string" + - name: "q" + in: "query" + description: "Suppress verbose build output." + type: "boolean" + default: false + - name: "nocache" + in: "query" + description: "Do not use the cache when building the image." + type: "boolean" + default: false + - name: "cachefrom" + in: "query" + description: "JSON array of images used for build cache resolution." + type: "string" + - name: "pull" + in: "query" + description: "Attempt to pull the image even if an older image exists locally." + type: "string" + - name: "rm" + in: "query" + description: "Remove intermediate containers after a successful build." + type: "boolean" + default: true + - name: "forcerm" + in: "query" + description: "Always remove intermediate containers, even upon failure." + type: "boolean" + default: false + - name: "memory" + in: "query" + description: "Set memory limit for build." + type: "integer" + - name: "memswap" + in: "query" + description: "Total memory (memory + swap). Set as `-1` to disable swap." + type: "integer" + - name: "cpushares" + in: "query" + description: "CPU shares (relative weight)." + type: "integer" + - name: "cpusetcpus" + in: "query" + description: "CPUs in which to allow execution (e.g., `0-3`, `0,1`)." + type: "string" + - name: "cpuperiod" + in: "query" + description: "The length of a CPU period in microseconds." + type: "integer" + - name: "cpuquota" + in: "query" + description: "Microseconds of CPU time that the container can get in a CPU period." + type: "integer" + - name: "buildargs" + in: "query" + description: > + JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker + uses the buildargs as the environment context for commands run via the `Dockerfile` RUN + instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for + passing secret values. + + + For example, the build arg `FOO=bar` would become `{"FOO":"bar"}` in JSON. This would result in the + query parameter `buildargs={"FOO":"bar"}`. Note that `{"FOO":"bar"}` should be URI component encoded. + + + [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg) + type: "string" + - name: "shmsize" + in: "query" + description: "Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB." + type: "integer" + - name: "squash" + in: "query" + description: "Squash the resulting images layers into a single layer. *(Experimental release only.)*" + type: "boolean" + - name: "labels" + in: "query" + description: "Arbitrary key/value labels to set on the image, as a JSON map of string pairs." + type: "string" + - name: "networkmode" + in: "query" + description: | + Sets the networking mode for the run commands during build. Supported + standard values are: `bridge`, `host`, `none`, and `container:`. + Any other value is taken as a custom network's name or ID to which this + container should connect to. + type: "string" + - name: "Content-type" + in: "header" + type: "string" + enum: + - "application/x-tar" + default: "application/x-tar" + - name: "X-Registry-Config" + in: "header" + description: | + This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to. + + The key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example: + + ``` + { + "docker.example.com": { + "username": "janedoe", + "password": "hunter2" + }, + "https://index.docker.io/v1/": { + "username": "mobydock", + "password": "conta1n3rize14" + } + } + ``` + + Only the registry domain name (and port if not the default 443) are required. However, for legacy reasons, the Docker Hub registry must be specified with both a `https://` prefix and a `/v1/` suffix even though Docker will prefer to use the v2 registry API. + type: "string" + - name: "platform" + in: "query" + description: "Platform in the format os[/arch[/variant]]" + type: "string" + default: "" + - name: "target" + in: "query" + description: "Target build stage" + type: "string" + default: "" + - name: "outputs" + in: "query" + description: "BuildKit output configuration" + type: "string" + default: "" + - name: "version" + in: "query" + type: "string" + default: "1" + enum: ["1", "2"] + description: | + Version of the builder backend to use. + + - `1` is the first generation classic (deprecated) builder in the Docker daemon (default) + - `2` is [BuildKit](https://github.com/moby/buildkit) + responses: + 200: + description: "no error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /build/prune: + post: + summary: "Delete builder cache" + produces: + - "application/json" + operationId: "BuildPrune" + parameters: + - name: "keep-storage" + in: "query" + description: | + Amount of disk space in bytes to keep for cache + + > **Deprecated**: This parameter is deprecated and has been renamed to "reserved-space". + > It is kept for backward compatibility and will be removed in API v1.49. + type: "integer" + format: "int64" + - name: "reserved-space" + in: "query" + description: "Amount of disk space in bytes to keep for cache" + type: "integer" + format: "int64" + - name: "max-used-space" + in: "query" + description: "Maximum amount of disk space allowed to keep for cache" + type: "integer" + format: "int64" + - name: "min-free-space" + in: "query" + description: "Target amount of free disk space after pruning" + type: "integer" + format: "int64" + - name: "all" + in: "query" + type: "boolean" + description: "Remove all types of build cache" + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the list of build cache objects. + + Available filters: + + - `until=` remove cache older than ``. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon's local time. + - `id=` + - `parent=` + - `type=` + - `description=` + - `inuse` + - `shared` + - `private` + responses: + 200: + description: "No error" + schema: + type: "object" + title: "BuildPruneResponse" + properties: + CachesDeleted: + type: "array" + items: + description: "ID of build cache object" + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /images/create: + post: + summary: "Create an image" + description: "Pull or import an image." + operationId: "ImageCreate" + consumes: + - "text/plain" + - "application/octet-stream" + produces: + - "application/json" + responses: + 200: + description: "no error" + 404: + description: "repository does not exist or no read access" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "fromImage" + in: "query" + description: | + Name of the image to pull. If the name includes a tag or digest, specific behavior applies: + + - If only `fromImage` includes a tag, that tag is used. + - If both `fromImage` and `tag` are provided, `tag` takes precedence. + - If `fromImage` includes a digest, the image is pulled by digest, and `tag` is ignored. + - If neither a tag nor digest is specified, all tags are pulled. + type: "string" + - name: "fromSrc" + in: "query" + description: "Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image." + type: "string" + - name: "repo" + in: "query" + description: "Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image." + type: "string" + - name: "tag" + in: "query" + description: "Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled." + type: "string" + - name: "message" + in: "query" + description: "Set commit message for imported image." + type: "string" + - name: "inputImage" + in: "body" + description: "Image content if the value `-` has been specified in fromSrc query parameter" + schema: + type: "string" + required: false + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "changes" + in: "query" + description: | + Apply `Dockerfile` instructions to the image that is created, + for example: `changes=ENV DEBUG=true`. + Note that `ENV DEBUG=true` should be URI component encoded. + + Supported `Dockerfile` instructions: + `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR` + type: "array" + items: + type: "string" + - name: "platform" + in: "query" + description: | + Platform in the format os[/arch[/variant]]. + + When used in combination with the `fromImage` option, the daemon checks + if the given image is present in the local image cache with the given + OS and Architecture, and otherwise attempts to pull the image. If the + option is not set, the host's native OS and Architecture are used. + If the given image does not exist in the local image cache, the daemon + attempts to pull the image with the host's native OS and Architecture. + If the given image does exists in the local image cache, but its OS or + architecture does not match, a warning is produced. + + When used with the `fromSrc` option to import an image from an archive, + this option sets the platform information for the imported image. If + the option is not set, the host's native OS and Architecture are used + for the imported image. + type: "string" + default: "" + tags: ["Image"] + /images/{name}/json: + get: + summary: "Inspect an image" + description: "Return low-level information about an image." + operationId: "ImageInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/ImageInspect" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: someimage (tag: latest)" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or id" + type: "string" + required: true + - name: "manifests" + in: "query" + description: "Include Manifests in the image summary." + type: "boolean" + default: false + required: false + tags: ["Image"] + /images/{name}/history: + get: + summary: "Get the history of an image" + description: "Return parent layers of an image." + operationId: "ImageHistory" + produces: ["application/json"] + responses: + 200: + description: "List of image layers" + schema: + type: "array" + items: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false + examples: + application/json: + - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" + Created: 1398108230 + CreatedBy: "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /" + Tags: + - "ubuntu:lucid" + - "ubuntu:10.04" + Size: 182964289 + Comment: "" + - Id: "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8" + Created: 1398108222 + CreatedBy: "/bin/sh -c #(nop) MAINTAINER Tianon Gravi - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/" + Tags: [] + Size: 0 + Comment: "" + - Id: "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158" + Created: 1371157430 + CreatedBy: "" + Tags: + - "scratch12:latest" + - "scratch:latest" + Size: 0 + Comment: "Imported from -" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "platform" + type: "string" + in: "query" + description: | + JSON-encoded OCI platform to select the platform-variant. + If omitted, it defaults to any locally available platform, + prioritizing the daemon's host platform. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to show the history for. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/{name}/push: + post: + summary: "Push an image" + description: | + Push an image to a registry. + + If you wish to push an image on to a private registry, that image must + already have a tag which references the registry. For example, + `registry.example.com/myimage:latest`. + + The push is cancelled if the HTTP connection is closed. + operationId: "ImagePush" + consumes: + - "application/octet-stream" + responses: + 200: + description: "No error" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + Name of the image to push. For example, `registry.example.com/myimage`. + The image must be present in the local image store with the same name. + + The name should be provided without tag; if a tag is provided, it + is ignored. For example, `registry.example.com/myimage:latest` is + considered equivalent to `registry.example.com/myimage`. + + Use the `tag` parameter to specify the tag to push. + type: "string" + required: true + - name: "tag" + in: "query" + description: | + Tag of the image to push. For example, `latest`. If no tag is provided, + all tags of the given image that are present in the local image store + are pushed. + type: "string" + - name: "platform" + type: "string" + in: "query" + description: | + JSON-encoded OCI platform to select the platform-variant to push. + If not provided, all available variants will attempt to be pushed. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to push to the registry. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + required: true + tags: ["Image"] + /images/{name}/tag: + post: + summary: "Tag an image" + description: "Tag an image so that it becomes part of a repository." + operationId: "ImageTag" + responses: + 201: + description: "No error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID to tag." + type: "string" + required: true + - name: "repo" + in: "query" + description: "The repository to tag in. For example, `someuser/someimage`." + type: "string" + - name: "tag" + in: "query" + description: "The name of the new tag." + type: "string" + tags: ["Image"] + /images/{name}: + delete: + summary: "Remove an image" + description: | + Remove an image, along with any untagged parent images that were + referenced by that image. + + Images can't be removed if they have descendant images, are being + used by a running container or are being used by a build. + operationId: "ImageDelete" + produces: ["application/json"] + responses: + 200: + description: "The image was deleted successfully" + schema: + type: "array" + items: + $ref: "#/definitions/ImageDeleteResponseItem" + examples: + application/json: + - Untagged: "3e2f21a89f" + - Deleted: "3e2f21a89f" + - Deleted: "53b4f83ac9" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "force" + in: "query" + description: "Remove the image even if it is being used by stopped containers or has other tags" + type: "boolean" + default: false + - name: "noprune" + in: "query" + description: "Do not delete untagged parent images" + type: "boolean" + default: false + - name: "platforms" + in: "query" + description: | + Select platform-specific content to delete. + Multiple values are accepted. + Each platform is a OCI platform encoded as a JSON string. + type: "array" + items: + # This should be OCIPlatform + # but $ref is not supported for array in query in Swagger 2.0 + # $ref: "#/definitions/OCIPlatform" + type: "string" + tags: ["Image"] + /images/search: + get: + summary: "Search images" + description: "Search for an image on Docker Hub." + operationId: "ImageSearch" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "array" + items: + type: "object" + title: "ImageSearchResponseItem" + properties: + description: + type: "string" + is_official: + type: "boolean" + is_automated: + description: | + Whether this repository has automated builds enabled. + +


+ + > **Deprecated**: This field is deprecated and will always be "false". + type: "boolean" + example: false + name: + type: "string" + star_count: + type: "integer" + examples: + application/json: + - description: "A minimal Docker image based on Alpine Linux with a complete package index and only 5 MB in size!" + is_official: true + is_automated: false + name: "alpine" + star_count: 10093 + - description: "Busybox base image." + is_official: true + is_automated: false + name: "Busybox base image." + star_count: 3037 + - description: "The PostgreSQL object-relational database system provides reliability and data integrity." + is_official: true + is_automated: false + name: "postgres" + star_count: 12408 + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "term" + in: "query" + description: "Term to search" + type: "string" + required: true + - name: "limit" + in: "query" + description: "Maximum number of results to return" + type: "integer" + - name: "filters" + in: "query" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: + + - `is-official=(true|false)` + - `stars=` Matches images that has at least 'number' stars. + type: "string" + tags: ["Image"] + /images/prune: + post: + summary: "Delete unused images" + produces: + - "application/json" + operationId: "ImagePrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters: + + - `dangling=` When set to `true` (or `1`), prune only + unused *and* untagged images. When set to `false` + (or `0`), all unused images are pruned. + - `until=` Prune images created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune images with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ImagePruneResponse" + properties: + ImagesDeleted: + description: "Images that were deleted" + type: "array" + items: + $ref: "#/definitions/ImageDeleteResponseItem" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /auth: + post: + summary: "Check auth configuration" + description: | + Validate credentials for a registry and, if available, get an identity + token for accessing the registry without password. + operationId: "SystemAuth" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "An identity token was generated successfully." + schema: + type: "object" + title: "SystemAuthResponse" + required: [Status] + properties: + Status: + description: "The status of the authentication" + type: "string" + x-nullable: false + IdentityToken: + description: "An opaque token used to authenticate a user after a successful login" + type: "string" + x-nullable: false + examples: + application/json: + Status: "Login Succeeded" + IdentityToken: "9cbaf023786cd7..." + 204: + description: "No error" + 401: + description: "Auth error" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "authConfig" + in: "body" + description: "Authentication to check" + schema: + $ref: "#/definitions/AuthConfig" + tags: ["System"] + /info: + get: + summary: "Get system information" + operationId: "SystemInfo" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/SystemInfo" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /version: + get: + summary: "Get version" + description: "Returns the version of Docker that is running and various information about the system that Docker is running on." + operationId: "SystemVersion" + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/SystemVersion" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /_ping: + get: + summary: "Ping" + description: "This is a dummy endpoint you can use to test if the server is accessible." + operationId: "SystemPing" + produces: ["text/plain"] + responses: + 200: + description: "no error" + schema: + type: "string" + example: "OK" + headers: + Api-Version: + type: "string" + description: "Max API Version the server supports" + Builder-Version: + type: "string" + description: | + Default version of docker image builder + + The default on Linux is version "2" (BuildKit), but the daemon + can be configured to recommend version "1" (classic Builder). + Windows does not yet support BuildKit for native Windows images, + and uses "1" (classic builder) as a default. + + This value is a recommendation as advertised by the daemon, and + it is up to the client to choose which builder to use. + default: "2" + Docker-Experimental: + type: "boolean" + description: "If the server is running with experimental mode enabled" + Swarm: + type: "string" + enum: ["inactive", "pending", "error", "locked", "active/worker", "active/manager"] + description: | + Contains information about Swarm status of the daemon, + and if the daemon is acting as a manager or worker node. + default: "inactive" + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + headers: + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + tags: ["System"] + head: + summary: "Ping" + description: "This is a dummy endpoint you can use to test if the server is accessible." + operationId: "SystemPingHead" + produces: ["text/plain"] + responses: + 200: + description: "no error" + schema: + type: "string" + example: "(empty)" + headers: + Api-Version: + type: "string" + description: "Max API Version the server supports" + Builder-Version: + type: "string" + description: "Default version of docker image builder" + Docker-Experimental: + type: "boolean" + description: "If the server is running with experimental mode enabled" + Swarm: + type: "string" + enum: ["inactive", "pending", "error", "locked", "active/worker", "active/manager"] + description: | + Contains information about Swarm status of the daemon, + and if the daemon is acting as a manager or worker node. + default: "inactive" + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /commit: + post: + summary: "Create a new image from a container" + operationId: "ImageCommit" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "containerConfig" + in: "body" + description: "The container configuration" + schema: + $ref: "#/definitions/ContainerConfig" + - name: "container" + in: "query" + description: "The ID or name of the container to commit" + type: "string" + - name: "repo" + in: "query" + description: "Repository name for the created image" + type: "string" + - name: "tag" + in: "query" + description: "Tag name for the create image" + type: "string" + - name: "comment" + in: "query" + description: "Commit message" + type: "string" + - name: "author" + in: "query" + description: "Author of the image (e.g., `John Hannibal Smith `)" + type: "string" + - name: "pause" + in: "query" + description: "Whether to pause the container before committing" + type: "boolean" + default: true + - name: "changes" + in: "query" + description: "`Dockerfile` instructions to apply while committing" + type: "string" + tags: ["Image"] + /events: + get: + summary: "Monitor events" + description: | + Stream real-time events from the server. + + Various objects within Docker report events when something happens to them. + + Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update`, and `prune` + + Images report these events: `create`, `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune` + + Volumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune` + + Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune` + + The Docker daemon reports these events: `reload` + + Services report these events: `create`, `update`, and `remove` + + Nodes report these events: `create`, `update`, and `remove` + + Secrets report these events: `create`, `update`, and `remove` + + Configs report these events: `create`, `update`, and `remove` + + The Builder reports `prune` events + + operationId: "SystemEvents" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/EventMessage" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "since" + in: "query" + description: "Show events created since this timestamp then stream new events." + type: "string" + - name: "until" + in: "query" + description: "Show events created until this timestamp then stop streaming." + type: "string" + - name: "filters" + in: "query" + description: | + A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters: + + - `config=` config name or ID + - `container=` container name or ID + - `daemon=` daemon name or ID + - `event=` event type + - `image=` image name or ID + - `label=` image or container label + - `network=` network name or ID + - `node=` node ID + - `plugin`= plugin name or ID + - `scope`= local or swarm + - `secret=` secret name or ID + - `service=` service name or ID + - `type=` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config` + - `volume=` volume name + type: "string" + tags: ["System"] + /system/df: + get: + summary: "Get data usage information" + operationId: "SystemDataUsage" + responses: + 200: + description: "no error" + schema: + type: "object" + title: "SystemDataUsageResponse" + properties: + LayersSize: + type: "integer" + format: "int64" + Images: + type: "array" + items: + $ref: "#/definitions/ImageSummary" + Containers: + type: "array" + items: + $ref: "#/definitions/ContainerSummary" + Volumes: + type: "array" + items: + $ref: "#/definitions/Volume" + BuildCache: + type: "array" + items: + $ref: "#/definitions/BuildCache" + example: + LayersSize: 1092588 + Images: + - + Id: "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749" + ParentId: "" + RepoTags: + - "busybox:latest" + RepoDigests: + - "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6" + Created: 1466724217 + Size: 1092588 + SharedSize: 0 + Labels: {} + Containers: 1 + Containers: + - + Id: "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148" + Names: + - "/top" + Image: "busybox" + ImageID: "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749" + Command: "top" + Created: 1472592424 + Ports: [] + SizeRootFs: 1092588 + Labels: {} + State: "exited" + Status: "Exited (0) 56 minutes ago" + HostConfig: + NetworkMode: "default" + NetworkSettings: + Networks: + bridge: + IPAMConfig: null + Links: null + Aliases: null + NetworkID: "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92" + EndpointID: "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a" + Gateway: "172.18.0.1" + IPAddress: "172.18.0.2" + IPPrefixLen: 16 + IPv6Gateway: "" + GlobalIPv6Address: "" + GlobalIPv6PrefixLen: 0 + MacAddress: "02:42:ac:12:00:02" + Mounts: [] + Volumes: + - + Name: "my-volume" + Driver: "local" + Mountpoint: "/var/lib/docker/volumes/my-volume/_data" + Labels: null + Scope: "local" + Options: null + UsageData: + Size: 10920104 + RefCount: 2 + BuildCache: + - + ID: "hw53o5aio51xtltp5xjp8v7fx" + Parents: [] + Type: "regular" + Description: "pulled from docker.io/library/debian@sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0" + InUse: false + Shared: true + Size: 0 + CreatedAt: "2021-06-28T13:31:01.474619385Z" + LastUsedAt: "2021-07-07T22:02:32.738075951Z" + UsageCount: 26 + - + ID: "ndlpt0hhvkqcdfkputsk4cq9c" + Parents: ["ndlpt0hhvkqcdfkputsk4cq9c"] + Type: "regular" + Description: "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache" + InUse: false + Shared: true + Size: 51 + CreatedAt: "2021-06-28T13:31:03.002625487Z" + LastUsedAt: "2021-07-07T22:02:32.773909517Z" + UsageCount: 26 + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "type" + in: "query" + description: | + Object types, for which to compute and return data. + type: "array" + collectionFormat: multi + items: + type: "string" + enum: ["container", "image", "volume", "build-cache"] + tags: ["System"] + /images/{name}/get: + get: + summary: "Export an image" + description: | + Get a tarball containing all images and metadata for a repository. + + If `name` is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned. If `name` is an image ID, similarly only that image (and its parents) are returned, but with the exclusion of the `repositories` file in the tarball, as there were no image names referenced. + + ### Image tarball format + + An image tarball contains [Content as defined in the OCI Image Layout Specification](https://github.com/opencontainers/image-spec/blob/v1.1.1/image-layout.md#content). + + Additionally, includes the manifest.json file associated with a backwards compatible docker save format. + + If the tarball defines a repository, the tarball should also include a `repositories` file at the root that contains a list of repository and tag names mapped to layer IDs. + + ```json + { + "hello-world": { + "latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1" + } + } + ``` + operationId: "ImageGet" + produces: + - "application/x-tar" + responses: + 200: + description: "no error" + schema: + type: "string" + format: "binary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "platform" + type: "string" + in: "query" + description: | + JSON encoded OCI platform describing a platform which will be used + to select a platform-specific image to be saved if the image is + multi-platform. + If not provided, the full multi-platform image will be saved. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/get: + get: + summary: "Export several images" + description: | + Get a tarball containing all images and metadata for several image + repositories. + + For each value of the `names` parameter: if it is a specific name and + tag (e.g. `ubuntu:latest`), then only that image (and its parents) are + returned; if it is an image ID, similarly only that image (and its parents) + are returned and there would be no names referenced in the 'repositories' + file for this image ID. + + For details on the format, see the [export image endpoint](#operation/ImageGet). + operationId: "ImageGetAll" + produces: + - "application/x-tar" + responses: + 200: + description: "no error" + schema: + type: "string" + format: "binary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "names" + in: "query" + description: "Image names to filter by" + type: "array" + items: + type: "string" + - name: "platform" + type: "string" + in: "query" + description: | + JSON encoded OCI platform describing a platform which will be used + to select a platform-specific image to be saved if the image is + multi-platform. + If not provided, the full multi-platform image will be saved. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/load: + post: + summary: "Import images" + description: | + Load a set of images and tags into a repository. + + For details on the format, see the [export image endpoint](#operation/ImageGet). + operationId: "ImageLoad" + consumes: + - "application/x-tar" + produces: + - "application/json" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "imagesTarball" + in: "body" + description: "Tar archive containing images" + schema: + type: "string" + format: "binary" + - name: "quiet" + in: "query" + description: "Suppress progress details during load." + type: "boolean" + default: false + - name: "platform" + type: "string" + in: "query" + description: | + JSON encoded OCI platform describing a platform which will be used + to select a platform-specific image to be load if the image is + multi-platform. + If not provided, the full multi-platform image will be loaded. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /containers/{id}/exec: + post: + summary: "Create an exec instance" + description: "Run a command inside a running container." + operationId: "ContainerExec" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "container is paused" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "execConfig" + in: "body" + description: "Exec configuration" + schema: + type: "object" + title: "ExecConfig" + properties: + AttachStdin: + type: "boolean" + description: "Attach to `stdin` of the exec command." + AttachStdout: + type: "boolean" + description: "Attach to `stdout` of the exec command." + AttachStderr: + type: "boolean" + description: "Attach to `stderr` of the exec command." + ConsoleSize: + type: "array" + description: "Initial console size, as an `[height, width]` array." + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + DetachKeys: + type: "string" + description: | + Override the key sequence for detaching a container. Format is + a single character `[a-Z]` or `ctrl-` where `` + is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. + Tty: + type: "boolean" + description: "Allocate a pseudo-TTY." + Env: + description: | + A list of environment variables in the form `["VAR=value", ...]`. + type: "array" + items: + type: "string" + Cmd: + type: "array" + description: "Command to run, as a string or array of strings." + items: + type: "string" + Privileged: + type: "boolean" + description: "Runs the exec process with extended privileges." + default: false + User: + type: "string" + description: | + The user, and optionally, group to run the exec process inside + the container. Format is one of: `user`, `user:group`, `uid`, + or `uid:gid`. + WorkingDir: + type: "string" + description: | + The working directory for the exec process inside the container. + example: + AttachStdin: false + AttachStdout: true + AttachStderr: true + DetachKeys: "ctrl-p,ctrl-q" + Tty: false + Cmd: + - "date" + Env: + - "FOO=bar" + - "BAZ=quux" + required: true + - name: "id" + in: "path" + description: "ID or name of container" + type: "string" + required: true + tags: ["Exec"] + /exec/{id}/start: + post: + summary: "Start an exec instance" + description: | + Starts a previously set up exec instance. If detach is true, this endpoint + returns immediately after starting the command. Otherwise, it sets up an + interactive session with the command. + operationId: "ExecStart" + consumes: + - "application/json" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 200: + description: "No error" + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Container is stopped or paused" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "execStartConfig" + in: "body" + schema: + type: "object" + title: "ExecStartConfig" + properties: + Detach: + type: "boolean" + description: "Detach from the command." + example: false + Tty: + type: "boolean" + description: "Allocate a pseudo-TTY." + example: true + ConsoleSize: + type: "array" + description: "Initial console size, as an `[height, width]` array." + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + tags: ["Exec"] + /exec/{id}/resize: + post: + summary: "Resize an exec instance" + description: | + Resize the TTY session used by an exec instance. This endpoint only works + if `tty` was specified as part of creating and starting the exec instance. + operationId: "ExecResize" + responses: + 200: + description: "No error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + - name: "h" + in: "query" + required: true + description: "Height of the TTY session in characters" + type: "integer" + - name: "w" + in: "query" + required: true + description: "Width of the TTY session in characters" + type: "integer" + tags: ["Exec"] + /exec/{id}/json: + get: + summary: "Inspect an exec instance" + description: "Return low-level information about an exec instance." + operationId: "ExecInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ExecInspectResponse" + properties: + CanRemove: + type: "boolean" + DetachKeys: + type: "string" + ID: + type: "string" + Running: + type: "boolean" + ExitCode: + type: "integer" + ProcessConfig: + $ref: "#/definitions/ProcessConfig" + OpenStdin: + type: "boolean" + OpenStderr: + type: "boolean" + OpenStdout: + type: "boolean" + ContainerID: + type: "string" + Pid: + type: "integer" + description: "The system process ID for the exec process." + examples: + application/json: + CanRemove: false + ContainerID: "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126" + DetachKeys: "" + ExitCode: 2 + ID: "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b" + OpenStderr: true + OpenStdin: true + OpenStdout: true + ProcessConfig: + arguments: + - "-c" + - "exit 2" + entrypoint: "sh" + privileged: false + tty: true + user: "1000" + Running: false + Pid: 42000 + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + tags: ["Exec"] + + /volumes: + get: + summary: "List volumes" + operationId: "VolumeList" + produces: ["application/json"] + responses: + 200: + description: "Summary volume data that matches the query" + schema: + $ref: "#/definitions/VolumeListResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + JSON encoded value of the filters (a `map[string][]string`) to + process on the volumes list. Available filters: + + - `dangling=` When set to `true` (or `1`), returns all + volumes that are not in use by a container. When set to `false` + (or `0`), only volumes that are in use by one or more + containers are returned. + - `driver=` Matches volumes based on their driver. + - `label=` or `label=:` Matches volumes based on + the presence of a `label` alone or a `label` and a value. + - `name=` Matches all or part of a volume name. + type: "string" + format: "json" + tags: ["Volume"] + + /volumes/create: + post: + summary: "Create a volume" + operationId: "VolumeCreate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 201: + description: "The volume was created successfully" + schema: + $ref: "#/definitions/Volume" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "volumeConfig" + in: "body" + required: true + description: "Volume configuration" + schema: + $ref: "#/definitions/VolumeCreateOptions" + tags: ["Volume"] + + /volumes/{name}: + get: + summary: "Inspect a volume" + operationId: "VolumeInspect" + produces: ["application/json"] + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/Volume" + 404: + description: "No such volume" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + required: true + description: "Volume name or ID" + type: "string" + tags: ["Volume"] + + put: + summary: | + "Update a volume. Valid only for Swarm cluster volumes" + operationId: "VolumeUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such volume" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "The name or ID of the volume" + type: "string" + required: true + - name: "body" + in: "body" + schema: + # though the schema for is an object that contains only a + # ClusterVolumeSpec, wrapping the ClusterVolumeSpec in this object + # means that if, later on, we support things like changing the + # labels, we can do so without duplicating that information to the + # ClusterVolumeSpec. + type: "object" + description: "Volume configuration" + properties: + Spec: + $ref: "#/definitions/ClusterVolumeSpec" + description: | + The spec of the volume to update. Currently, only Availability may + change. All other fields must remain unchanged. + - name: "version" + in: "query" + description: | + The version number of the volume being updated. This is required to + avoid conflicting writes. Found in the volume's `ClusterVolume` + field. + type: "integer" + format: "int64" + required: true + tags: ["Volume"] + + delete: + summary: "Remove a volume" + description: "Instruct the driver to remove the volume." + operationId: "VolumeDelete" + responses: + 204: + description: "The volume was removed" + 404: + description: "No such volume or volume driver" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Volume is in use and cannot be removed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + required: true + description: "Volume name or ID" + type: "string" + - name: "force" + in: "query" + description: "Force the removal of the volume" + type: "boolean" + default: false + tags: ["Volume"] + + /volumes/prune: + post: + summary: "Delete unused volumes" + produces: + - "application/json" + operationId: "VolumePrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune volumes with (or without, in case `label!=...` is used) the specified labels. + - `all` (`all=true`) - Consider all (local) volumes for pruning and not just anonymous volumes. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "VolumePruneResponse" + properties: + VolumesDeleted: + description: "Volumes that were deleted" + type: "array" + items: + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Volume"] + /networks: + get: + summary: "List networks" + description: | + Returns a list of networks. For details on the format, see the + [network inspect endpoint](#operation/NetworkInspect). + + Note that it uses a different, smaller representation of a network than + inspecting a single network. For example, the list of containers attached + to the network is not propagated in API versions 1.28 and up. + operationId: "NetworkList" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "array" + items: + $ref: "#/definitions/Network" + examples: + application/json: + - Name: "bridge" + Id: "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566" + Created: "2016-10-19T06:21:00.416543526Z" + Scope: "local" + Driver: "bridge" + EnableIPv4: true + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: + - + Subnet: "172.17.0.0/16" + Options: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + - Name: "none" + Id: "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794" + Created: "0001-01-01T00:00:00Z" + Scope: "local" + Driver: "null" + EnableIPv4: false + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: [] + Containers: {} + Options: {} + - Name: "host" + Id: "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e" + Created: "0001-01-01T00:00:00Z" + Scope: "local" + Driver: "host" + EnableIPv4: false + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: [] + Containers: {} + Options: {} + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + JSON encoded value of the filters (a `map[string][]string`) to process + on the networks list. + + Available filters: + + - `dangling=` When set to `true` (or `1`), returns all + networks that are not in use by a container. When set to `false` + (or `0`), only networks that are in use by one or more + containers are returned. + - `driver=` Matches a network's driver. + - `id=` Matches all or part of a network ID. + - `label=` or `label==` of a network label. + - `name=` Matches all or part of a network name. + - `scope=["swarm"|"global"|"local"]` Filters networks by scope (`swarm`, `global`, or `local`). + - `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks. + type: "string" + tags: ["Network"] + + /networks/{id}: + get: + summary: "Inspect a network" + operationId: "NetworkInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/Network" + 404: + description: "Network not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "verbose" + in: "query" + description: "Detailed inspect output for troubleshooting" + type: "boolean" + default: false + - name: "scope" + in: "query" + description: "Filter the network by scope (swarm, global, or local)" + type: "string" + tags: ["Network"] + + delete: + summary: "Remove a network" + operationId: "NetworkDelete" + responses: + 204: + description: "No error" + 403: + description: "operation not supported for pre-defined networks" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such network" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + tags: ["Network"] + + /networks/create: + post: + summary: "Create a network" + operationId: "NetworkCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "Network created successfully" + schema: + $ref: "#/definitions/NetworkCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: | + Forbidden operation. This happens when trying to create a network named after a pre-defined network, + or when trying to create an overlay network on a daemon which is not part of a Swarm cluster. + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "plugin not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "networkConfig" + in: "body" + description: "Network configuration" + required: true + schema: + type: "object" + title: "NetworkCreateRequest" + required: ["Name"] + properties: + Name: + description: "The network's name." + type: "string" + example: "my_network" + Driver: + description: "Name of the network driver plugin to use." + type: "string" + default: "bridge" + example: "bridge" + Scope: + description: | + The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level). + type: "string" + Internal: + description: "Restrict external access to the network." + type: "boolean" + Attachable: + description: | + Globally scoped network is manually attachable by regular + containers from workers in swarm mode. + type: "boolean" + example: true + Ingress: + description: | + Ingress network is the network which provides the routing-mesh + in swarm mode. + type: "boolean" + example: false + ConfigOnly: + description: | + Creates a config-only network. Config-only networks are placeholder + networks for network configurations to be used by other networks. + Config-only networks cannot be used directly to run containers + or services. + type: "boolean" + default: false + example: false + ConfigFrom: + description: | + Specifies the source which will provide the configuration for + this network. The specified network must be an existing + config-only network; see ConfigOnly. + $ref: "#/definitions/ConfigReference" + IPAM: + description: "Optional custom IP scheme for the network." + $ref: "#/definitions/IPAM" + EnableIPv4: + description: "Enable IPv4 on the network." + type: "boolean" + example: true + EnableIPv6: + description: "Enable IPv6 on the network." + type: "boolean" + example: true + Options: + description: "Network specific options to be used by the drivers." + type: "object" + additionalProperties: + type: "string" + example: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + tags: ["Network"] + + /networks/{id}/connect: + post: + summary: "Connect a container to a network" + description: "The network must be either a local-scoped network or a swarm-scoped network with the `attachable` option set. A network cannot be re-attached to a running container" + operationId: "NetworkConnect" + consumes: + - "application/json" + responses: + 200: + description: "No error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: "Operation forbidden" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Network or container not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "container" + in: "body" + required: true + schema: + type: "object" + title: "NetworkConnectRequest" + properties: + Container: + type: "string" + description: "The ID or name of the container to connect to the network." + EndpointConfig: + $ref: "#/definitions/EndpointSettings" + example: + Container: "3613f73ba0e4" + EndpointConfig: + IPAMConfig: + IPv4Address: "172.24.56.89" + IPv6Address: "2001:db8::5689" + MacAddress: "02:42:ac:12:05:02" + Priority: 100 + tags: ["Network"] + + /networks/{id}/disconnect: + post: + summary: "Disconnect a container from a network" + operationId: "NetworkDisconnect" + consumes: + - "application/json" + responses: + 200: + description: "No error" + 403: + description: "Operation not supported for swarm scoped networks" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Network or container not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "container" + in: "body" + required: true + schema: + type: "object" + title: "NetworkDisconnectRequest" + properties: + Container: + type: "string" + description: | + The ID or name of the container to disconnect from the network. + Force: + type: "boolean" + description: | + Force the container to disconnect from the network. + tags: ["Network"] + /networks/prune: + post: + summary: "Delete unused networks" + produces: + - "application/json" + operationId: "NetworkPrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `until=` Prune networks created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune networks with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "NetworkPruneResponse" + properties: + NetworksDeleted: + description: "Networks that were deleted" + type: "array" + items: + type: "string" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Network"] + /plugins: + get: + summary: "List plugins" + operationId: "PluginList" + description: "Returns information about installed plugins." + produces: ["application/json"] + responses: + 200: + description: "No error" + schema: + type: "array" + items: + $ref: "#/definitions/Plugin" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the plugin list. + + Available filters: + + - `capability=` + - `enable=|` + tags: ["Plugin"] + + /plugins/privileges: + get: + summary: "Get plugin privileges" + operationId: "GetPluginPrivileges" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "remote" + in: "query" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + tags: + - "Plugin" + + /plugins/pull: + post: + summary: "Install a plugin" + operationId: "PluginPull" + description: | + Pulls and installs a plugin. After the plugin is installed, it can be + enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable). + produces: + - "application/json" + responses: + 204: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "remote" + in: "query" + description: | + Remote reference for plugin to install. + + The `:latest` tag is optional, and is used as the default if omitted. + required: true + type: "string" + - name: "name" + in: "query" + description: | + Local name for the pulled plugin. + + The `:latest` tag is optional, and is used as the default if omitted. + required: false + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration to use when pulling a plugin + from a registry. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + tags: ["Plugin"] + /plugins/{name}/json: + get: + summary: "Inspect a plugin" + operationId: "PluginInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Plugin" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + tags: ["Plugin"] + /plugins/{name}: + delete: + summary: "Remove a plugin" + operationId: "PluginDelete" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Plugin" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "force" + in: "query" + description: | + Disable the plugin before removing. This may result in issues if the + plugin is in use by a container. + type: "boolean" + default: false + tags: ["Plugin"] + /plugins/{name}/enable: + post: + summary: "Enable a plugin" + operationId: "PluginEnable" + responses: + 200: + description: "no error" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "timeout" + in: "query" + description: "Set the HTTP client timeout (in seconds)" + type: "integer" + default: 0 + tags: ["Plugin"] + /plugins/{name}/disable: + post: + summary: "Disable a plugin" + operationId: "PluginDisable" + responses: + 200: + description: "no error" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "force" + in: "query" + description: | + Force disable a plugin even if still in use. + required: false + type: "boolean" + tags: ["Plugin"] + /plugins/{name}/upgrade: + post: + summary: "Upgrade a plugin" + operationId: "PluginUpgrade" + responses: + 204: + description: "no error" + 404: + description: "plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "remote" + in: "query" + description: | + Remote reference to upgrade to. + + The `:latest` tag is optional, and is used as the default if omitted. + required: true + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration to use when pulling a plugin + from a registry. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + tags: ["Plugin"] + /plugins/create: + post: + summary: "Create a plugin" + operationId: "PluginCreate" + consumes: + - "application/x-tar" + responses: + 204: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "query" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "tarContext" + in: "body" + description: "Path to tar containing plugin rootfs and manifest" + schema: + type: "string" + format: "binary" + tags: ["Plugin"] + /plugins/{name}/push: + post: + summary: "Push a plugin" + operationId: "PluginPush" + description: | + Push a plugin to the registry. + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + responses: + 200: + description: "no error" + 404: + description: "plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Plugin"] + /plugins/{name}/set: + post: + summary: "Configure a plugin" + operationId: "PluginSet" + consumes: + - "application/json" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + type: "string" + example: ["DEBUG=1"] + responses: + 204: + description: "No error" + 404: + description: "Plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Plugin"] + /nodes: + get: + summary: "List nodes" + operationId: "NodeList" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Node" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the nodes list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `id=` + - `label=` + - `membership=`(`accepted`|`pending`)` + - `name=` + - `node.label=` + - `role=`(`manager`|`worker`)` + type: "string" + tags: ["Node"] + /nodes/{id}: + get: + summary: "Inspect a node" + operationId: "NodeInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Node" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the node" + type: "string" + required: true + tags: ["Node"] + delete: + summary: "Delete a node" + operationId: "NodeDelete" + responses: + 200: + description: "no error" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the node" + type: "string" + required: true + - name: "force" + in: "query" + description: "Force remove a node from the swarm" + default: false + type: "boolean" + tags: ["Node"] + /nodes/{id}/update: + post: + summary: "Update a node" + operationId: "NodeUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID of the node" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/NodeSpec" + - name: "version" + in: "query" + description: | + The version number of the node object being updated. This is required + to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Node"] + /swarm: + get: + summary: "Inspect swarm" + operationId: "SwarmInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Swarm" + 404: + description: "no such swarm" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /swarm/init: + post: + summary: "Initialize a new swarm" + operationId: "SwarmInit" + produces: + - "application/json" + - "text/plain" + responses: + 200: + description: "no error" + schema: + description: "The node ID" + type: "string" + example: "7v2t30z9blmxuhnyo6s4cpenp" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is already part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmInitRequest" + properties: + ListenAddr: + description: | + Listen address used for inter-manager communication, as well + as determining the networking interface used for the VXLAN + Tunnel Endpoint (VTEP). This can either be an address/port + combination in the form `192.168.1.1:4567`, or an interface + followed by a port number, like `eth0:4567`. If the port number + is omitted, the default swarm listening port is used. + type: "string" + AdvertiseAddr: + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + type: "string" + DataPathAddr: + description: | + Address or interface to use for data path traffic (format: + ``), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + type: "string" + DataPathPort: + description: | + DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + if no port is set or is set to 0, default port 4789 will be used. + type: "integer" + format: "uint32" + DefaultAddrPool: + description: | + Default Address Pool specifies default subnet pools for global + scope networks. + type: "array" + items: + type: "string" + example: ["10.10.0.0/16", "20.20.0.0/16"] + ForceNewCluster: + description: "Force creation of a new swarm." + type: "boolean" + SubnetSize: + description: | + SubnetSize specifies the subnet size of the networks created + from the default subnet pool. + type: "integer" + format: "uint32" + Spec: + $ref: "#/definitions/SwarmSpec" + example: + ListenAddr: "0.0.0.0:2377" + AdvertiseAddr: "192.168.1.1:2377" + DataPathPort: 4789 + DefaultAddrPool: ["10.10.0.0/8", "20.20.0.0/8"] + SubnetSize: 24 + ForceNewCluster: false + Spec: + Orchestration: {} + Raft: {} + Dispatcher: {} + CAConfig: {} + EncryptionConfig: + AutoLockManagers: false + tags: ["Swarm"] + /swarm/join: + post: + summary: "Join an existing swarm" + operationId: "SwarmJoin" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is already part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmJoinRequest" + properties: + ListenAddr: + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). + type: "string" + AdvertiseAddr: + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + type: "string" + DataPathAddr: + description: | + Address or interface to use for data path traffic (format: + ``), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + + type: "string" + RemoteAddrs: + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" + JoinToken: + description: "Secret token for joining this swarm." + type: "string" + example: + ListenAddr: "0.0.0.0:2377" + AdvertiseAddr: "192.168.1.1:2377" + DataPathAddr: "192.168.1.1" + RemoteAddrs: + - "node1:2377" + JoinToken: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + tags: ["Swarm"] + /swarm/leave: + post: + summary: "Leave a swarm" + operationId: "SwarmLeave" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "force" + description: | + Force leave swarm, even if this is the last manager or that it will + break the cluster. + in: "query" + type: "boolean" + default: false + tags: ["Swarm"] + /swarm/update: + post: + summary: "Update a swarm" + operationId: "SwarmUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + $ref: "#/definitions/SwarmSpec" + - name: "version" + in: "query" + description: | + The version number of the swarm object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + - name: "rotateWorkerToken" + in: "query" + description: "Rotate the worker join token." + type: "boolean" + default: false + - name: "rotateManagerToken" + in: "query" + description: "Rotate the manager join token." + type: "boolean" + default: false + - name: "rotateManagerUnlockKey" + in: "query" + description: "Rotate the manager unlock key." + type: "boolean" + default: false + tags: ["Swarm"] + /swarm/unlockkey: + get: + summary: "Get the unlock key" + operationId: "SwarmUnlockkey" + consumes: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "object" + title: "UnlockKeyResponse" + properties: + UnlockKey: + description: "The swarm's unlock key." + type: "string" + example: + UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /swarm/unlock: + post: + summary: "Unlock a locked manager" + operationId: "SwarmUnlock" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmUnlockRequest" + properties: + UnlockKey: + description: "The swarm's unlock key." + type: "string" + example: + UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /services: + get: + summary: "List services" + operationId: "ServiceList" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Service" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the services list. + + Available filters: + + - `id=` + - `label=` + - `mode=["replicated"|"global"]` + - `name=` + - name: "status" + in: "query" + type: "boolean" + description: | + Include service status, with count of running and desired tasks. + tags: ["Service"] + /services/create: + post: + summary: "Create a service" + operationId: "ServiceCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/ServiceCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: "network is not eligible for services" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "name conflicts with an existing service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/ServiceSpec" + - type: "object" + example: + Name: "web" + TaskTemplate: + ContainerSpec: + Image: "nginx:alpine" + Mounts: + - + ReadOnly: true + Source: "web-data" + Target: "/usr/share/nginx/html" + Type: "volume" + VolumeOptions: + DriverConfig: {} + Labels: + com.example.something: "something-value" + Hosts: ["10.10.10.10 host1", "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789 host2"] + User: "33" + DNSConfig: + Nameservers: ["8.8.8.8"] + Search: ["example.org"] + Options: ["timeout:3"] + Secrets: + - + File: + Name: "www.example.org.key" + UID: "33" + GID: "33" + Mode: 384 + SecretID: "fpjqlhnwb19zds35k8wn80lq9" + SecretName: "example_org_domain_key" + OomScoreAdj: 0 + LogDriver: + Name: "json-file" + Options: + max-file: "3" + max-size: "10M" + Placement: {} + Resources: + Limits: + MemoryBytes: 104857600 + Reservations: {} + RestartPolicy: + Condition: "on-failure" + Delay: 10000000000 + MaxAttempts: 10 + Mode: + Replicated: + Replicas: 4 + UpdateConfig: + Parallelism: 2 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Ports: + - + Protocol: "tcp" + PublishedPort: 8080 + TargetPort: 80 + Labels: + foo: "bar" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration for pulling from private + registries. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + tags: ["Service"] + /services/{id}: + get: + summary: "Inspect a service" + operationId: "ServiceInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Service" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + - name: "insertDefaults" + in: "query" + description: "Fill empty fields with default values." + type: "boolean" + default: false + tags: ["Service"] + delete: + summary: "Delete a service" + operationId: "ServiceDelete" + responses: + 200: + description: "no error" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + tags: ["Service"] + /services/{id}/update: + post: + summary: "Update a service" + operationId: "ServiceUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ServiceUpdateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + - name: "body" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/ServiceSpec" + - type: "object" + example: + Name: "top" + TaskTemplate: + ContainerSpec: + Image: "busybox" + Args: + - "top" + OomScoreAdj: 0 + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ForceUpdate: 0 + Mode: + Replicated: + Replicas: 1 + UpdateConfig: + Parallelism: 2 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Mode: "vip" + + - name: "version" + in: "query" + description: | + The version number of the service object being updated. This is + required to avoid conflicting writes. + This version number should be the value as currently set on the + service *before* the update. You can find the current version by + calling `GET /services/{id}` + required: true + type: "integer" + - name: "registryAuthFrom" + in: "query" + description: | + If the `X-Registry-Auth` header is not specified, this parameter + indicates where to find registry authorization credentials. + type: "string" + enum: ["spec", "previous-spec"] + default: "spec" + - name: "rollback" + in: "query" + description: | + Set to this parameter to `previous` to cause a server-side rollback + to the previous service spec. The supplied spec will be ignored in + this case. + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration for pulling from private + registries. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + + tags: ["Service"] + /services/{id}/logs: + get: + summary: "Get service logs" + description: | + Get `stdout` and `stderr` logs from a service. See also + [`/containers/{id}/logs`](#operation/ContainerLogs). + + **Note**: This endpoint works only for services with the `local`, + `json-file` or `journald` logging drivers. + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + operationId: "ServiceLogs" + responses: + 200: + description: "logs returned as a stream in response body" + schema: + type: "string" + format: "binary" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such service: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the service" + type: "string" + - name: "details" + in: "query" + description: "Show service context and extra details provided to logs." + type: "boolean" + default: false + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Service"] + /tasks: + get: + summary: "List tasks" + operationId: "TaskList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Task" + example: + - ID: "0kzzo1i0y4jz6027t0k7aezc7" + Version: + Index: 71 + CreatedAt: "2016-06-07T21:07:31.171892745Z" + UpdatedAt: "2016-06-07T21:07:31.376370513Z" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:31.290032978Z" + State: "running" + Message: "started" + ContainerStatus: + ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035" + PID: 677 + DesiredState: "running" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.10/16" + - ID: "1yljwbmlr8er2waf8orvqpwms" + Version: + Index: 30 + CreatedAt: "2016-06-07T21:07:30.019104782Z" + UpdatedAt: "2016-06-07T21:07:30.231958098Z" + Name: "hopeful_cori" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:30.202183143Z" + State: "shutdown" + Message: "shutdown" + ContainerStatus: + ContainerID: "1cf8d63d18e79668b0004a4be4c6ee58cddfad2dae29506d8781581d0688a213" + DesiredState: "shutdown" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.5/16" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the tasks list. + + Available filters: + + - `desired-state=(running | shutdown | accepted)` + - `id=` + - `label=key` or `label="key=value"` + - `name=` + - `node=` + - `service=` + tags: ["Task"] + /tasks/{id}: + get: + summary: "Inspect a task" + operationId: "TaskInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Task" + 404: + description: "no such task" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID of the task" + required: true + type: "string" + tags: ["Task"] + /tasks/{id}/logs: + get: + summary: "Get task logs" + description: | + Get `stdout` and `stderr` logs from a task. + See also [`/containers/{id}/logs`](#operation/ContainerLogs). + + **Note**: This endpoint works only for services with the `local`, + `json-file` or `journald` logging drivers. + operationId: "TaskLogs" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 200: + description: "logs returned as a stream in response body" + schema: + type: "string" + format: "binary" + 404: + description: "no such task" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such task: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID of the task" + type: "string" + - name: "details" + in: "query" + description: "Show task context and extra details provided to logs." + type: "boolean" + default: false + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Task"] + /secrets: + get: + summary: "List secrets" + operationId: "SecretList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Secret" + example: + - ID: "blt1owaxmitz71s9v5zh81zun" + Version: + Index: 85 + CreatedAt: "2017-07-20T13:55:28.678958722Z" + UpdatedAt: "2017-07-20T13:55:28.678958722Z" + Spec: + Name: "mysql-passwd" + Labels: + some.label: "some.value" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + - ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + Labels: + foo: "bar" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the secrets list. + + Available filters: + + - `id=` + - `label= or label==value` + - `name=` + - `names=` + tags: ["Secret"] + /secrets/create: + post: + summary: "Create a secret" + operationId: "SecretCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 409: + description: "name conflicts with an existing object" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + schema: + allOf: + - $ref: "#/definitions/SecretSpec" + - type: "object" + example: + Name: "app-key.crt" + Labels: + foo: "bar" + Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + tags: ["Secret"] + /secrets/{id}: + get: + summary: "Inspect a secret" + operationId: "SecretInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Secret" + examples: + application/json: + ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + Labels: + foo: "bar" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + + 404: + description: "secret not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the secret" + tags: ["Secret"] + delete: + summary: "Delete a secret" + operationId: "SecretDelete" + produces: + - "application/json" + responses: + 204: + description: "no error" + 404: + description: "secret not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the secret" + tags: ["Secret"] + /secrets/{id}/update: + post: + summary: "Update a Secret" + operationId: "SecretUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such secret" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the secret" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/SecretSpec" + description: | + The spec of the secret to update. Currently, only the Labels field + can be updated. All other fields must remain unchanged from the + [SecretInspect endpoint](#operation/SecretInspect) response values. + - name: "version" + in: "query" + description: | + The version number of the secret object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Secret"] + /configs: + get: + summary: "List configs" + operationId: "ConfigList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Config" + example: + - ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "server.conf" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the configs list. + + Available filters: + + - `id=` + - `label= or label==value` + - `name=` + - `names=` + tags: ["Config"] + /configs/create: + post: + summary: "Create a config" + operationId: "ConfigCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 409: + description: "name conflicts with an existing object" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + schema: + allOf: + - $ref: "#/definitions/ConfigSpec" + - type: "object" + example: + Name: "server.conf" + Labels: + foo: "bar" + Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + tags: ["Config"] + /configs/{id}: + get: + summary: "Inspect a config" + operationId: "ConfigInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Config" + examples: + application/json: + ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + 404: + description: "config not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the config" + tags: ["Config"] + delete: + summary: "Delete a config" + operationId: "ConfigDelete" + produces: + - "application/json" + responses: + 204: + description: "no error" + 404: + description: "config not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the config" + tags: ["Config"] + /configs/{id}/update: + post: + summary: "Update a Config" + operationId: "ConfigUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such config" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the config" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/ConfigSpec" + description: | + The spec of the config to update. Currently, only the Labels field + can be updated. All other fields must remain unchanged from the + [ConfigInspect endpoint](#operation/ConfigInspect) response values. + - name: "version" + in: "query" + description: | + The version number of the config object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Config"] + /distribution/{name}/json: + get: + summary: "Get image information from the registry" + description: | + Return image digest and platform information by contacting the registry. + operationId: "DistributionInspect" + produces: + - "application/json" + responses: + 200: + description: "descriptor and platform information" + schema: + $ref: "#/definitions/DistributionInspect" + 401: + description: "Failed authentication or no image found" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: someimage (tag: latest)" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or id" + type: "string" + required: true + tags: ["Distribution"] + /session: + post: + summary: "Initialize interactive session" + description: | + Start a new interactive session with a server. Session allows server to + call back to the client for advanced capabilities. + + ### Hijacking + + This endpoint hijacks the HTTP connection to HTTP2 transport that allows + the client to expose gPRC services on that connection. + + For example, the client sends this request to upgrade the connection: + + ``` + POST /session HTTP/1.1 + Upgrade: h2c + Connection: Upgrade + ``` + + The Docker daemon responds with a `101 UPGRADED` response follow with + the raw stream: + + ``` + HTTP/1.1 101 UPGRADED + Connection: Upgrade + Upgrade: h2c + ``` + operationId: "Session" + produces: + - "application/vnd.docker.raw-stream" + responses: + 101: + description: "no error, hijacking successful" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Session"] diff --git a/vendor/github.com/moby/moby/api/types/auxprogress/push.go b/vendor/github.com/moby/moby/api/types/auxprogress/push.go new file mode 100644 index 0000000000..9bddae8951 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/auxprogress/push.go @@ -0,0 +1,26 @@ +package auxprogress + +import ( + ocispec "github.com/opencontainers/image-spec/specs-go/v1" +) + +// ManifestPushedInsteadOfIndex is a note that is sent when a manifest is pushed +// instead of an index. It is sent when the pushed image is an multi-platform +// index, but the whole index couldn't be pushed. +type ManifestPushedInsteadOfIndex struct { + ManifestPushedInsteadOfIndex bool `json:"manifestPushedInsteadOfIndex"` // Always true + + // OriginalIndex is the descriptor of the original image index. + OriginalIndex ocispec.Descriptor `json:"originalIndex"` + + // SelectedManifest is the descriptor of the manifest that was pushed instead. + SelectedManifest ocispec.Descriptor `json:"selectedManifest"` +} + +// ContentMissing is a note that is sent when push fails because the content is missing. +type ContentMissing struct { + ContentMissing bool `json:"contentMissing"` // Always true + + // Desc is the descriptor of the root object that was attempted to be pushed. + Desc ocispec.Descriptor `json:"desc"` +} diff --git a/vendor/github.com/moby/moby/api/types/backend/backend.go b/vendor/github.com/moby/moby/api/types/backend/backend.go new file mode 100644 index 0000000000..0f981b3ac5 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/backend/backend.go @@ -0,0 +1,191 @@ +// Package backend includes types to send information to server backends. +package backend + +import ( + "io" + "time" + + "github.com/distribution/reference" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/network" + ocispec "github.com/opencontainers/image-spec/specs-go/v1" +) + +// ContainerCreateConfig is the parameter set to ContainerCreate() +type ContainerCreateConfig struct { + Name string + Config *container.Config + HostConfig *container.HostConfig + NetworkingConfig *network.NetworkingConfig + Platform *ocispec.Platform + DefaultReadOnlyNonRecursive bool +} + +// ContainerRmConfig holds arguments for the container remove +// operation. This struct is used to tell the backend what operations +// to perform. +type ContainerRmConfig struct { + ForceRemove, RemoveVolume, RemoveLink bool +} + +// ContainerAttachConfig holds the streams to use when connecting to a container to view logs. +type ContainerAttachConfig struct { + GetStreams func(multiplexed bool, cancel func()) (io.ReadCloser, io.Writer, io.Writer, error) + UseStdin bool + UseStdout bool + UseStderr bool + Logs bool + Stream bool + DetachKeys string + // Used to signify that streams must be multiplexed by producer as endpoint can't manage multiple streams. + // This is typically set by HTTP endpoint, while websocket can transport raw streams + MuxStreams bool +} + +// PartialLogMetaData provides meta data for a partial log message. Messages +// exceeding a predefined size are split into chunks with this metadata. The +// expectation is for the logger endpoints to assemble the chunks using this +// metadata. +type PartialLogMetaData struct { + Last bool // true if this message is last of a partial + ID string // identifies group of messages comprising a single record + Ordinal int // ordering of message in partial group +} + +// LogMessage is datastructure that represents piece of output produced by some +// container. The Line member is a slice of an array whose contents can be +// changed after a log driver's Log() method returns. +type LogMessage struct { + Line []byte + Source string + Timestamp time.Time + Attrs []LogAttr + PLogMetaData *PartialLogMetaData + + // Err is an error associated with a message. Completeness of a message + // with Err is not expected, tho it may be partially complete (fields may + // be missing, gibberish, or nil) + Err error +} + +// LogAttr is used to hold the extra attributes available in the log message. +type LogAttr struct { + Key string + Value string +} + +// LogSelector is a list of services and tasks that should be returned as part +// of a log stream. It is similar to swarmapi.LogSelector, with the difference +// that the names don't have to be resolved to IDs; this is mostly to avoid +// accidents later where a swarmapi LogSelector might have been incorrectly +// used verbatim (and to avoid the handler having to import swarmapi types) +type LogSelector struct { + Services []string + Tasks []string +} + +// ContainerStatsConfig holds information for configuring the runtime +// behavior of a backend.ContainerStats() call. +type ContainerStatsConfig struct { + Stream bool + OneShot bool + OutStream func() io.Writer +} + +// ContainerInspectOptions defines options for the backend.ContainerInspect +// call. +type ContainerInspectOptions struct { + // Size controls whether to propagate the container's size fields. + Size bool +} + +// ExecStartConfig holds the options to start container's exec. +type ExecStartConfig struct { + Stdin io.Reader + Stdout io.Writer + Stderr io.Writer + ConsoleSize *[2]uint `json:",omitempty"` +} + +// ExecInspect holds information about a running process started +// with docker exec. +type ExecInspect struct { + ID string + Running bool + ExitCode *int + ProcessConfig *ExecProcessConfig + OpenStdin bool + OpenStderr bool + OpenStdout bool + CanRemove bool + ContainerID string + DetachKeys []byte + Pid int +} + +// ExecProcessConfig holds information about the exec process +// running on the host. +type ExecProcessConfig struct { + Tty bool `json:"tty"` + Entrypoint string `json:"entrypoint"` + Arguments []string `json:"arguments"` + Privileged *bool `json:"privileged,omitempty"` + User string `json:"user,omitempty"` +} + +// CreateImageConfig is the configuration for creating an image from a +// container. +type CreateImageConfig struct { + Tag reference.NamedTagged + Pause bool + Author string + Comment string + Config *container.Config + Changes []string +} + +// GetImageOpts holds parameters to retrieve image information +// from the backend. +type GetImageOpts struct { + Platform *ocispec.Platform +} + +// ImageInspectOpts holds parameters to inspect an image. +type ImageInspectOpts struct { + Manifests bool + Platform *ocispec.Platform +} + +// CommitConfig is the configuration for creating an image as part of a build. +type CommitConfig struct { + Author string + Comment string + Config *container.Config // TODO(thaJeztah); change this to [dockerspec.DockerOCIImageConfig] + ContainerConfig *container.Config + ContainerID string + ContainerMountLabel string + ContainerOS string + ParentImageID string +} + +// PluginRmConfig holds arguments for plugin remove. +type PluginRmConfig struct { + ForceRemove bool +} + +// PluginEnableConfig holds arguments for plugin enable +type PluginEnableConfig struct { + Timeout int +} + +// PluginDisableConfig holds arguments for plugin disable. +type PluginDisableConfig struct { + ForceDisable bool +} + +// NetworkListConfig stores the options available for listing networks +type NetworkListConfig struct { + // TODO(@cpuguy83): naming is hard, this is pulled from what was being used in the router before moving here + Detailed bool + Verbose bool +} diff --git a/vendor/github.com/moby/moby/api/types/backend/build.go b/vendor/github.com/moby/moby/api/types/backend/build.go new file mode 100644 index 0000000000..3176b0ec50 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/backend/build.go @@ -0,0 +1,50 @@ +package backend + +import ( + "io" + + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/registry" + ocispec "github.com/opencontainers/image-spec/specs-go/v1" +) + +// PullOption defines different modes for accessing images +type PullOption int + +const ( + // PullOptionNoPull only returns local images + PullOptionNoPull PullOption = iota + // PullOptionForcePull always tries to pull a ref from the registry first + PullOptionForcePull + // PullOptionPreferLocal uses local image if it exists, otherwise pulls + PullOptionPreferLocal +) + +// ProgressWriter is a data object to transport progress streams to the client +type ProgressWriter struct { + Output io.Writer + StdoutFormatter io.Writer + StderrFormatter io.Writer + AuxFormatter AuxEmitter + ProgressReaderFunc func(io.ReadCloser) io.ReadCloser +} + +// AuxEmitter is an interface for emitting aux messages during build progress +type AuxEmitter interface { + Emit(string, interface{}) error +} + +// BuildConfig is the configuration used by a BuildManager to start a build +type BuildConfig struct { + Source io.ReadCloser + ProgressWriter ProgressWriter + Options *build.ImageBuildOptions +} + +// GetImageAndLayerOptions are the options supported by GetImageAndReleasableLayer +type GetImageAndLayerOptions struct { + PullOption PullOption + AuthConfig map[string]registry.AuthConfig + Output io.Writer + Platform *ocispec.Platform +} diff --git a/vendor/github.com/moby/moby/api/types/blkiodev/blkio.go b/vendor/github.com/moby/moby/api/types/blkiodev/blkio.go new file mode 100644 index 0000000000..931ae10ab1 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/blkiodev/blkio.go @@ -0,0 +1,23 @@ +package blkiodev + +import "fmt" + +// WeightDevice is a structure that holds device:weight pair +type WeightDevice struct { + Path string + Weight uint16 +} + +func (w *WeightDevice) String() string { + return fmt.Sprintf("%s:%d", w.Path, w.Weight) +} + +// ThrottleDevice is a structure that holds device:rate_per_second pair +type ThrottleDevice struct { + Path string + Rate uint64 +} + +func (t *ThrottleDevice) String() string { + return fmt.Sprintf("%s:%d", t.Path, t.Rate) +} diff --git a/vendor/github.com/moby/moby/api/types/build/build.go b/vendor/github.com/moby/moby/api/types/build/build.go new file mode 100644 index 0000000000..a798802357 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/build/build.go @@ -0,0 +1,91 @@ +package build + +import ( + "io" + + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/registry" +) + +// BuilderVersion sets the version of underlying builder to use +type BuilderVersion string + +const ( + // BuilderV1 is the first generation builder in docker daemon + BuilderV1 BuilderVersion = "1" + // BuilderBuildKit is builder based on moby/buildkit project + BuilderBuildKit BuilderVersion = "2" +) + +// Result contains the image id of a successful build. +type Result struct { + ID string +} + +// ImageBuildOptions holds the information +// necessary to build images. +type ImageBuildOptions struct { + Tags []string + SuppressOutput bool + RemoteContext string + NoCache bool + Remove bool + ForceRemove bool + PullParent bool + Isolation container.Isolation + CPUSetCPUs string + CPUSetMems string + CPUShares int64 + CPUQuota int64 + CPUPeriod int64 + Memory int64 + MemorySwap int64 + CgroupParent string + NetworkMode string + ShmSize int64 + Dockerfile string + Ulimits []*container.Ulimit + // BuildArgs needs to be a *string instead of just a string so that + // we can tell the difference between "" (empty string) and no value + // at all (nil). See the parsing of buildArgs in + // api/server/router/build/build_routes.go for even more info. + BuildArgs map[string]*string + AuthConfigs map[string]registry.AuthConfig + Context io.Reader + Labels map[string]string + // squash the resulting image's layers to the parent + // preserves the original image and creates a new one from the parent with all + // the changes applied to a single layer + Squash bool + // CacheFrom specifies images that are used for matching cache. Images + // specified here do not need to have a valid parent chain to match cache. + CacheFrom []string + SecurityOpt []string + ExtraHosts []string // List of extra hosts + Target string + SessionID string + Platform string + // Version specifies the version of the underlying builder to use + Version BuilderVersion + // BuildID is an optional identifier that can be passed together with the + // build request. The same identifier can be used to gracefully cancel the + // build with the cancel request. + BuildID string + // Outputs defines configurations for exporting build results. Only supported + // in BuildKit mode + Outputs []ImageBuildOutput +} + +// ImageBuildOutput defines configuration for exporting a build result +type ImageBuildOutput struct { + Type string + Attrs map[string]string +} + +// ImageBuildResponse holds information +// returned by a server after building +// an image. +type ImageBuildResponse struct { + Body io.ReadCloser + OSType string +} diff --git a/vendor/github.com/moby/moby/api/types/build/cache.go b/vendor/github.com/moby/moby/api/types/build/cache.go new file mode 100644 index 0000000000..442bd903d9 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/build/cache.go @@ -0,0 +1,52 @@ +package build + +import ( + "time" + + "github.com/moby/moby/api/types/filters" +) + +// CacheRecord contains information about a build cache record. +type CacheRecord struct { + // ID is the unique ID of the build cache record. + ID string + // Parent is the ID of the parent build cache record. + // + // Deprecated: deprecated in API v1.42 and up, as it was deprecated in BuildKit; use Parents instead. + Parent string `json:"Parent,omitempty"` + // Parents is the list of parent build cache record IDs. + Parents []string `json:" Parents,omitempty"` + // Type is the cache record type. + Type string + // Description is a description of the build-step that produced the build cache. + Description string + // InUse indicates if the build cache is in use. + InUse bool + // Shared indicates if the build cache is shared. + Shared bool + // Size is the amount of disk space used by the build cache (in bytes). + Size int64 + // CreatedAt is the date and time at which the build cache was created. + CreatedAt time.Time + // LastUsedAt is the date and time at which the build cache was last used. + LastUsedAt *time.Time + UsageCount int +} + +// CachePruneOptions hold parameters to prune the build cache. +type CachePruneOptions struct { + All bool + ReservedSpace int64 + MaxUsedSpace int64 + MinFreeSpace int64 + Filters filters.Args + + KeepStorage int64 // Deprecated: deprecated in API 1.48. +} + +// CachePruneReport contains the response for Engine API: +// POST "/build/prune" +type CachePruneReport struct { + CachesDeleted []string + SpaceReclaimed uint64 +} diff --git a/vendor/github.com/moby/moby/api/types/build/disk_usage.go b/vendor/github.com/moby/moby/api/types/build/disk_usage.go new file mode 100644 index 0000000000..e969b6d615 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/build/disk_usage.go @@ -0,0 +1,8 @@ +package build + +// CacheDiskUsage contains disk usage for the build cache. +type CacheDiskUsage struct { + TotalSize int64 + Reclaimable int64 + Items []*CacheRecord +} diff --git a/vendor/github.com/moby/moby/api/types/checkpoint/list.go b/vendor/github.com/moby/moby/api/types/checkpoint/list.go new file mode 100644 index 0000000000..94a9c0a47d --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/checkpoint/list.go @@ -0,0 +1,7 @@ +package checkpoint + +// Summary represents the details of a checkpoint when listing endpoints. +type Summary struct { + // Name is the name of the checkpoint. + Name string +} diff --git a/vendor/github.com/moby/moby/api/types/checkpoint/options.go b/vendor/github.com/moby/moby/api/types/checkpoint/options.go new file mode 100644 index 0000000000..9477458c24 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/checkpoint/options.go @@ -0,0 +1,19 @@ +package checkpoint + +// CreateOptions holds parameters to create a checkpoint from a container. +type CreateOptions struct { + CheckpointID string + CheckpointDir string + Exit bool +} + +// ListOptions holds parameters to list checkpoints for a container. +type ListOptions struct { + CheckpointDir string +} + +// DeleteOptions holds parameters to delete a checkpoint from a container. +type DeleteOptions struct { + CheckpointID string + CheckpointDir string +} diff --git a/vendor/github.com/moby/moby/api/types/client.go b/vendor/github.com/moby/moby/api/types/client.go new file mode 100644 index 0000000000..42fe03ecca --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/client.go @@ -0,0 +1,85 @@ +package types + +import ( + "bufio" + "context" + "net" +) + +// NewHijackedResponse initializes a [HijackedResponse] type. +func NewHijackedResponse(conn net.Conn, mediaType string) HijackedResponse { + return HijackedResponse{Conn: conn, Reader: bufio.NewReader(conn), mediaType: mediaType} +} + +// HijackedResponse holds connection information for a hijacked request. +type HijackedResponse struct { + mediaType string + Conn net.Conn + Reader *bufio.Reader +} + +// Close closes the hijacked connection and reader. +func (h *HijackedResponse) Close() { + h.Conn.Close() +} + +// MediaType let client know if HijackedResponse hold a raw or multiplexed stream. +// returns false if HTTP Content-Type is not relevant, and container must be inspected +func (h *HijackedResponse) MediaType() (string, bool) { + if h.mediaType == "" { + return "", false + } + return h.mediaType, true +} + +// CloseWriter is an interface that implements structs +// that close input streams to prevent from writing. +type CloseWriter interface { + CloseWrite() error +} + +// CloseWrite closes a readWriter for writing. +func (h *HijackedResponse) CloseWrite() error { + if conn, ok := h.Conn.(CloseWriter); ok { + return conn.CloseWrite() + } + return nil +} + +// PluginRemoveOptions holds parameters to remove plugins. +type PluginRemoveOptions struct { + Force bool +} + +// PluginEnableOptions holds parameters to enable plugins. +type PluginEnableOptions struct { + Timeout int +} + +// PluginDisableOptions holds parameters to disable plugins. +type PluginDisableOptions struct { + Force bool +} + +// PluginInstallOptions holds parameters to install a plugin. +type PluginInstallOptions struct { + Disabled bool + AcceptAllPermissions bool + RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry + RemoteRef string // RemoteRef is the plugin name on the registry + + // PrivilegeFunc is a function that clients can supply to retry operations + // after getting an authorization error. This function returns the registry + // authentication header value in base64 encoded format, or an error if the + // privilege request fails. + // + // For details, refer to [github.com/docker/docker/api/types/registry.RequestAuthConfig]. + PrivilegeFunc func(context.Context) (string, error) + AcceptPermissionsFunc func(context.Context, PluginPrivileges) (bool, error) + Args []string +} + +// PluginCreateOptions hold all options to plugin create. +type PluginCreateOptions struct { + RepoName string +} diff --git a/vendor/github.com/moby/moby/api/types/common/id_response.go b/vendor/github.com/moby/moby/api/types/common/id_response.go new file mode 100644 index 0000000000..22e8c60a48 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/common/id_response.go @@ -0,0 +1,13 @@ +package common + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// IDResponse Response to an API call that returns just an Id +// swagger:model IDResponse +type IDResponse struct { + + // The id of the newly created object. + // Required: true + ID string `json:"Id"` +} diff --git a/vendor/github.com/moby/moby/api/types/container/change_type.go b/vendor/github.com/moby/moby/api/types/container/change_type.go new file mode 100644 index 0000000000..fe8d6d3696 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/change_type.go @@ -0,0 +1,15 @@ +package container + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// ChangeType Kind of change +// +// Can be one of: +// +// - `0`: Modified ("C") +// - `1`: Added ("A") +// - `2`: Deleted ("D") +// +// swagger:model ChangeType +type ChangeType uint8 diff --git a/vendor/github.com/moby/moby/api/types/container/change_types.go b/vendor/github.com/moby/moby/api/types/container/change_types.go new file mode 100644 index 0000000000..3a3a83866e --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/change_types.go @@ -0,0 +1,23 @@ +package container + +const ( + // ChangeModify represents the modify operation. + ChangeModify ChangeType = 0 + // ChangeAdd represents the add operation. + ChangeAdd ChangeType = 1 + // ChangeDelete represents the delete operation. + ChangeDelete ChangeType = 2 +) + +func (ct ChangeType) String() string { + switch ct { + case ChangeModify: + return "C" + case ChangeAdd: + return "A" + case ChangeDelete: + return "D" + default: + return "" + } +} diff --git a/vendor/github.com/moby/moby/api/types/container/commit.go b/vendor/github.com/moby/moby/api/types/container/commit.go new file mode 100644 index 0000000000..c5aab26ff4 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/commit.go @@ -0,0 +1,7 @@ +package container + +import "github.com/moby/moby/api/types/common" + +// CommitResponse response for the commit API call, containing the ID of the +// image that was produced. +type CommitResponse = common.IDResponse diff --git a/vendor/github.com/moby/moby/api/types/container/config.go b/vendor/github.com/moby/moby/api/types/container/config.go new file mode 100644 index 0000000000..0eba9f6841 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/config.go @@ -0,0 +1,73 @@ +package container + +import ( + "time" + + "github.com/docker/go-connections/nat" + dockerspec "github.com/moby/docker-image-spec/specs-go/v1" + "github.com/moby/moby/api/types/strslice" +) + +// MinimumDuration puts a minimum on user configured duration. +// This is to prevent API error on time unit. For example, API may +// set 3 as healthcheck interval with intention of 3 seconds, but +// Docker interprets it as 3 nanoseconds. +const MinimumDuration = 1 * time.Millisecond + +// StopOptions holds the options to stop or restart a container. +type StopOptions struct { + // Signal (optional) is the signal to send to the container to (gracefully) + // stop it before forcibly terminating the container with SIGKILL after the + // timeout expires. If not value is set, the default (SIGTERM) is used. + Signal string `json:",omitempty"` + + // Timeout (optional) is the timeout (in seconds) to wait for the container + // to stop gracefully before forcibly terminating it with SIGKILL. + // + // - Use nil to use the default timeout (10 seconds). + // - Use '-1' to wait indefinitely. + // - Use '0' to not wait for the container to exit gracefully, and + // immediately proceeds to forcibly terminating the container. + // - Other positive values are used as timeout (in seconds). + Timeout *int `json:",omitempty"` +} + +// HealthConfig holds configuration settings for the HEALTHCHECK feature. +type HealthConfig = dockerspec.HealthcheckConfig + +// Config contains the configuration data about a container. +// It should hold only portable information about the container. +// Here, "portable" means "independent from the host we are running on". +// Non-portable information *should* appear in HostConfig. +// All fields added to this struct must be marked `omitempty` to keep getting +// predictable hashes from the old `v1Compatibility` configuration. +type Config struct { + Hostname string // Hostname + Domainname string // Domainname + User string // User that will run the command(s) inside the container, also support user:group + AttachStdin bool // Attach the standard input, makes possible user interaction + AttachStdout bool // Attach the standard output + AttachStderr bool // Attach the standard error + ExposedPorts nat.PortSet `json:",omitempty"` // List of exposed ports + Tty bool // Attach standard streams to a tty, including stdin if it is not closed. + OpenStdin bool // Open stdin + StdinOnce bool // If true, close stdin after the 1 attached client disconnects. + Env []string // List of environment variable to set in the container + Cmd strslice.StrSlice // Command to run when starting the container + Healthcheck *HealthConfig `json:",omitempty"` // Healthcheck describes how to check the container is healthy + ArgsEscaped bool `json:",omitempty"` // True if command is already escaped (meaning treat as a command line) (Windows specific). + Image string // Name of the image as it was passed by the operator (e.g. could be symbolic) + Volumes map[string]struct{} // List of volumes (mounts) used for the container + WorkingDir string // Current directory (PWD) in the command will be launched + Entrypoint strslice.StrSlice // Entrypoint to run when starting the container + NetworkDisabled bool `json:",omitempty"` // Is network disabled + // Mac Address of the container. + // + // Deprecated: this field is deprecated since API v1.44. Use EndpointSettings.MacAddress instead. + MacAddress string `json:",omitempty"` + OnBuild []string // ONBUILD metadata that were defined on the image Dockerfile + Labels map[string]string // List of labels set to this container + StopSignal string `json:",omitempty"` // Signal to stop a container + StopTimeout *int `json:",omitempty"` // Timeout (in seconds) to stop a container + Shell strslice.StrSlice `json:",omitempty"` // Shell for shell-form of RUN, CMD, ENTRYPOINT +} diff --git a/vendor/github.com/moby/moby/api/types/container/container.go b/vendor/github.com/moby/moby/api/types/container/container.go new file mode 100644 index 0000000000..8e9d53d58e --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/container.go @@ -0,0 +1,178 @@ +package container + +import ( + "io" + "os" + "time" + + "github.com/moby/moby/api/types/mount" + "github.com/moby/moby/api/types/storage" + ocispec "github.com/opencontainers/image-spec/specs-go/v1" +) + +// PruneReport contains the response for Engine API: +// POST "/containers/prune" +type PruneReport struct { + ContainersDeleted []string + SpaceReclaimed uint64 +} + +// PathStat is used to encode the header from +// GET "/containers/{name:.*}/archive" +// "Name" is the file or directory name. +type PathStat struct { + Name string `json:"name"` + Size int64 `json:"size"` + Mode os.FileMode `json:"mode"` + Mtime time.Time `json:"mtime"` + LinkTarget string `json:"linkTarget"` +} + +// CopyToContainerOptions holds information +// about files to copy into a container +type CopyToContainerOptions struct { + AllowOverwriteDirWithFile bool + CopyUIDGID bool +} + +// StatsResponseReader wraps an io.ReadCloser to read (a stream of) stats +// for a container, as produced by the GET "/stats" endpoint. +// +// The OSType field is set to the server's platform to allow +// platform-specific handling of the response. +// +// TODO(thaJeztah): remove this wrapper, and make OSType part of [StatsResponse]. +type StatsResponseReader struct { + Body io.ReadCloser `json:"body"` + OSType string `json:"ostype"` +} + +// MountPoint represents a mount point configuration inside the container. +// This is used for reporting the mountpoints in use by a container. +type MountPoint struct { + // Type is the type of mount, see `Type` definitions in + // github.com/docker/docker/api/types/mount.Type + Type mount.Type `json:",omitempty"` + + // Name is the name reference to the underlying data defined by `Source` + // e.g., the volume name. + Name string `json:",omitempty"` + + // Source is the source location of the mount. + // + // For volumes, this contains the storage location of the volume (within + // `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains + // the source (host) part of the bind-mount. For `tmpfs` mount points, this + // field is empty. + Source string + + // Destination is the path relative to the container root (`/`) where the + // Source is mounted inside the container. + Destination string + + // Driver is the volume driver used to create the volume (if it is a volume). + Driver string `json:",omitempty"` + + // Mode is a comma separated list of options supplied by the user when + // creating the bind/volume mount. + // + // The default is platform-specific (`"z"` on Linux, empty on Windows). + Mode string + + // RW indicates whether the mount is mounted writable (read-write). + RW bool + + // Propagation describes how mounts are propagated from the host into the + // mount point, and vice-versa. Refer to the Linux kernel documentation + // for details: + // https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt + // + // This field is not used on Windows. + Propagation mount.Propagation +} + +// State stores container's running state +// it's part of ContainerJSONBase and returned by "inspect" command +type State struct { + Status ContainerState // String representation of the container state. Can be one of "created", "running", "paused", "restarting", "removing", "exited", or "dead" + Running bool + Paused bool + Restarting bool + OOMKilled bool + Dead bool + Pid int + ExitCode int + Error string + StartedAt string + FinishedAt string + Health *Health `json:",omitempty"` +} + +// Summary contains response of Engine API: +// GET "/containers/json" +type Summary struct { + ID string `json:"Id"` + Names []string + Image string + ImageID string + ImageManifestDescriptor *ocispec.Descriptor `json:"ImageManifestDescriptor,omitempty"` + Command string + Created int64 + Ports []Port + SizeRw int64 `json:",omitempty"` + SizeRootFs int64 `json:",omitempty"` + Labels map[string]string + State ContainerState + Status string + HostConfig struct { + NetworkMode string `json:",omitempty"` + Annotations map[string]string `json:",omitempty"` + } + NetworkSettings *NetworkSettingsSummary + Mounts []MountPoint +} + +// ContainerJSONBase contains response of Engine API GET "/containers/{name:.*}/json" +// for API version 1.18 and older. +// +// TODO(thaJeztah): combine ContainerJSONBase and InspectResponse into a single struct. +// The split between ContainerJSONBase (ContainerJSONBase) and InspectResponse (InspectResponse) +// was done in commit 6deaa58ba5f051039643cedceee97c8695e2af74 (https://github.com/moby/moby/pull/13675). +// ContainerJSONBase contained all fields for API < 1.19, and InspectResponse +// held fields that were added in API 1.19 and up. Given that the minimum +// supported API version is now 1.24, we no longer use the separate type. +type ContainerJSONBase struct { + ID string `json:"Id"` + Created string + Path string + Args []string + State *State + Image string + ResolvConfPath string + HostnamePath string + HostsPath string + LogPath string + Name string + RestartCount int + Driver string + Platform string + MountLabel string + ProcessLabel string + AppArmorProfile string + ExecIDs []string + HostConfig *HostConfig + GraphDriver storage.DriverData + SizeRw *int64 `json:",omitempty"` + SizeRootFs *int64 `json:",omitempty"` +} + +// InspectResponse is the response for the GET "/containers/{name:.*}/json" +// endpoint. +type InspectResponse struct { + *ContainerJSONBase + Mounts []MountPoint + Config *Config + NetworkSettings *NetworkSettings + // ImageManifestDescriptor is the descriptor of a platform-specific manifest of the image used to create the container. + ImageManifestDescriptor *ocispec.Descriptor `json:"ImageManifestDescriptor,omitempty"` +} diff --git a/vendor/github.com/moby/moby/api/types/container/create_request.go b/vendor/github.com/moby/moby/api/types/container/create_request.go new file mode 100644 index 0000000000..decb208af0 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/create_request.go @@ -0,0 +1,13 @@ +package container + +import "github.com/moby/moby/api/types/network" + +// CreateRequest is the request message sent to the server for container +// create calls. It is a config wrapper that holds the container [Config] +// (portable) and the corresponding [HostConfig] (non-portable) and +// [network.NetworkingConfig]. +type CreateRequest struct { + *Config + HostConfig *HostConfig `json:"HostConfig,omitempty"` + NetworkingConfig *network.NetworkingConfig `json:"NetworkingConfig,omitempty"` +} diff --git a/vendor/github.com/moby/moby/api/types/container/create_response.go b/vendor/github.com/moby/moby/api/types/container/create_response.go new file mode 100644 index 0000000000..aa0e7f7d07 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/create_response.go @@ -0,0 +1,19 @@ +package container + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// CreateResponse ContainerCreateResponse +// +// OK response to ContainerCreate operation +// swagger:model CreateResponse +type CreateResponse struct { + + // The ID of the created container + // Required: true + ID string `json:"Id"` + + // Warnings encountered when creating the container + // Required: true + Warnings []string `json:"Warnings"` +} diff --git a/vendor/github.com/moby/moby/api/types/container/disk_usage.go b/vendor/github.com/moby/moby/api/types/container/disk_usage.go new file mode 100644 index 0000000000..05b6cbe9c7 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/disk_usage.go @@ -0,0 +1,8 @@ +package container + +// DiskUsage contains disk usage for containers. +type DiskUsage struct { + TotalSize int64 + Reclaimable int64 + Items []*Summary +} diff --git a/vendor/github.com/moby/moby/api/types/container/errors.go b/vendor/github.com/moby/moby/api/types/container/errors.go new file mode 100644 index 0000000000..32c978037e --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/errors.go @@ -0,0 +1,9 @@ +package container + +type errInvalidParameter struct{ error } + +func (e *errInvalidParameter) InvalidParameter() {} + +func (e *errInvalidParameter) Unwrap() error { + return e.error +} diff --git a/vendor/github.com/moby/moby/api/types/container/exec.go b/vendor/github.com/moby/moby/api/types/container/exec.go new file mode 100644 index 0000000000..749a2a4452 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/exec.go @@ -0,0 +1,53 @@ +package container + +import "github.com/moby/moby/api/types/common" + +// ExecCreateResponse is the response for a successful exec-create request. +// It holds the ID of the exec that was created. +// +// TODO(thaJeztah): make this a distinct type. +type ExecCreateResponse = common.IDResponse + +// ExecOptions is a small subset of the Config struct that holds the configuration +// for the exec feature of docker. +type ExecOptions struct { + User string // User that will run the command + Privileged bool // Is the container in privileged mode + Tty bool // Attach standard streams to a tty. + ConsoleSize *[2]uint `json:",omitempty"` // Initial console size [height, width] + AttachStdin bool // Attach the standard input, makes possible user interaction + AttachStderr bool // Attach the standard error + AttachStdout bool // Attach the standard output + DetachKeys string // Escape keys for detach + Env []string // Environment variables + WorkingDir string // Working directory + Cmd []string // Execution commands and args + + // Deprecated: the Detach field is not used, and will be removed in a future release. + Detach bool +} + +// ExecStartOptions is a temp struct used by execStart +// Config fields is part of ExecConfig in runconfig package +type ExecStartOptions struct { + // ExecStart will first check if it's detached + Detach bool + // Check if there's a tty + Tty bool + // Terminal size [height, width], unused if Tty == false + ConsoleSize *[2]uint `json:",omitempty"` +} + +// ExecAttachOptions is a temp struct used by execAttach. +// +// TODO(thaJeztah): make this a separate type; ContainerExecAttach does not use the Detach option, and cannot run detached. +type ExecAttachOptions = ExecStartOptions + +// ExecInspect holds information returned by exec inspect. +type ExecInspect struct { + ExecID string `json:"ID"` + ContainerID string + Running bool + ExitCode int + Pid int +} diff --git a/vendor/github.com/moby/moby/api/types/container/filesystem_change.go b/vendor/github.com/moby/moby/api/types/container/filesystem_change.go new file mode 100644 index 0000000000..9e9c2ad1d5 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/filesystem_change.go @@ -0,0 +1,19 @@ +package container + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// FilesystemChange Change in the container's filesystem. +// +// swagger:model FilesystemChange +type FilesystemChange struct { + + // kind + // Required: true + Kind ChangeType `json:"Kind"` + + // Path to file or directory that has changed. + // + // Required: true + Path string `json:"Path"` +} diff --git a/vendor/github.com/moby/moby/api/types/container/health.go b/vendor/github.com/moby/moby/api/types/container/health.go new file mode 100644 index 0000000000..96e91cc8d8 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/health.go @@ -0,0 +1,50 @@ +package container + +import ( + "fmt" + "strings" + "time" +) + +// HealthStatus is a string representation of the container's health. +// +// It currently is an alias for string, but may become a distinct type in future. +type HealthStatus = string + +// Health states +const ( + NoHealthcheck HealthStatus = "none" // Indicates there is no healthcheck + Starting HealthStatus = "starting" // Starting indicates that the container is not yet ready + Healthy HealthStatus = "healthy" // Healthy indicates that the container is running correctly + Unhealthy HealthStatus = "unhealthy" // Unhealthy indicates that the container has a problem +) + +// Health stores information about the container's healthcheck results +type Health struct { + Status HealthStatus // Status is one of [Starting], [Healthy] or [Unhealthy]. + FailingStreak int // FailingStreak is the number of consecutive failures + Log []*HealthcheckResult // Log contains the last few results (oldest first) +} + +// HealthcheckResult stores information about a single run of a healthcheck probe +type HealthcheckResult struct { + Start time.Time // Start is the time this check started + End time.Time // End is the time this check ended + ExitCode int // ExitCode meanings: 0=healthy, 1=unhealthy, 2=reserved (considered unhealthy), else=error running probe + Output string // Output from last check +} + +var validHealths = []string{ + NoHealthcheck, Starting, Healthy, Unhealthy, +} + +// ValidateHealthStatus checks if the provided string is a valid +// container [HealthStatus]. +func ValidateHealthStatus(s HealthStatus) error { + switch s { + case NoHealthcheck, Starting, Healthy, Unhealthy: + return nil + default: + return errInvalidParameter{error: fmt.Errorf("invalid value for health (%s): must be one of %s", s, strings.Join(validHealths, ", "))} + } +} diff --git a/vendor/github.com/moby/moby/api/types/container/hostconfig.go b/vendor/github.com/moby/moby/api/types/container/hostconfig.go new file mode 100644 index 0000000000..cf27f63fce --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/hostconfig.go @@ -0,0 +1,501 @@ +package container + +import ( + "errors" + "fmt" + "strings" + + "github.com/docker/go-connections/nat" + "github.com/docker/go-units" + "github.com/moby/moby/api/types/blkiodev" + "github.com/moby/moby/api/types/mount" + "github.com/moby/moby/api/types/network" + "github.com/moby/moby/api/types/strslice" +) + +// CgroupnsMode represents the cgroup namespace mode of the container +type CgroupnsMode string + +// cgroup namespace modes for containers +const ( + CgroupnsModeEmpty CgroupnsMode = "" + CgroupnsModePrivate CgroupnsMode = "private" + CgroupnsModeHost CgroupnsMode = "host" +) + +// IsPrivate indicates whether the container uses its own private cgroup namespace +func (c CgroupnsMode) IsPrivate() bool { + return c == CgroupnsModePrivate +} + +// IsHost indicates whether the container shares the host's cgroup namespace +func (c CgroupnsMode) IsHost() bool { + return c == CgroupnsModeHost +} + +// IsEmpty indicates whether the container cgroup namespace mode is unset +func (c CgroupnsMode) IsEmpty() bool { + return c == CgroupnsModeEmpty +} + +// Valid indicates whether the cgroup namespace mode is valid +func (c CgroupnsMode) Valid() bool { + return c.IsEmpty() || c.IsPrivate() || c.IsHost() +} + +// Isolation represents the isolation technology of a container. The supported +// values are platform specific +type Isolation string + +// Isolation modes for containers +const ( + IsolationEmpty Isolation = "" // IsolationEmpty is unspecified (same behavior as default) + IsolationDefault Isolation = "default" // IsolationDefault is the default isolation mode on current daemon + IsolationProcess Isolation = "process" // IsolationProcess is process isolation mode + IsolationHyperV Isolation = "hyperv" // IsolationHyperV is HyperV isolation mode +) + +// IsDefault indicates the default isolation technology of a container. On Linux this +// is the native driver. On Windows, this is a Windows Server Container. +func (i Isolation) IsDefault() bool { + // TODO consider making isolation-mode strict (case-sensitive) + v := Isolation(strings.ToLower(string(i))) + return v == IsolationDefault || v == IsolationEmpty +} + +// IsHyperV indicates the use of a Hyper-V partition for isolation +func (i Isolation) IsHyperV() bool { + // TODO consider making isolation-mode strict (case-sensitive) + return Isolation(strings.ToLower(string(i))) == IsolationHyperV +} + +// IsProcess indicates the use of process isolation +func (i Isolation) IsProcess() bool { + // TODO consider making isolation-mode strict (case-sensitive) + return Isolation(strings.ToLower(string(i))) == IsolationProcess +} + +// IpcMode represents the container ipc stack. +type IpcMode string + +// IpcMode constants +const ( + IPCModeNone IpcMode = "none" + IPCModeHost IpcMode = "host" + IPCModeContainer IpcMode = "container" + IPCModePrivate IpcMode = "private" + IPCModeShareable IpcMode = "shareable" +) + +// IsPrivate indicates whether the container uses its own private ipc namespace which can not be shared. +func (n IpcMode) IsPrivate() bool { + return n == IPCModePrivate +} + +// IsHost indicates whether the container shares the host's ipc namespace. +func (n IpcMode) IsHost() bool { + return n == IPCModeHost +} + +// IsShareable indicates whether the container's ipc namespace can be shared with another container. +func (n IpcMode) IsShareable() bool { + return n == IPCModeShareable +} + +// IsContainer indicates whether the container uses another container's ipc namespace. +func (n IpcMode) IsContainer() bool { + _, ok := containerID(string(n)) + return ok +} + +// IsNone indicates whether container IpcMode is set to "none". +func (n IpcMode) IsNone() bool { + return n == IPCModeNone +} + +// IsEmpty indicates whether container IpcMode is empty +func (n IpcMode) IsEmpty() bool { + return n == "" +} + +// Valid indicates whether the ipc mode is valid. +func (n IpcMode) Valid() bool { + // TODO(thaJeztah): align with PidMode, and consider container-mode without a container name/ID to be invalid. + return n.IsEmpty() || n.IsNone() || n.IsPrivate() || n.IsHost() || n.IsShareable() || n.IsContainer() +} + +// Container returns the name of the container ipc stack is going to be used. +func (n IpcMode) Container() (idOrName string) { + idOrName, _ = containerID(string(n)) + return idOrName +} + +// NetworkMode represents the container network stack. +type NetworkMode string + +// IsNone indicates whether container isn't using a network stack. +func (n NetworkMode) IsNone() bool { + return n == network.NetworkNone +} + +// IsDefault indicates whether container uses the default network stack. +func (n NetworkMode) IsDefault() bool { + return n == network.NetworkDefault +} + +// IsPrivate indicates whether container uses its private network stack. +func (n NetworkMode) IsPrivate() bool { + return !n.IsHost() && !n.IsContainer() +} + +// IsContainer indicates whether container uses a container network stack. +func (n NetworkMode) IsContainer() bool { + _, ok := containerID(string(n)) + return ok +} + +// ConnectedContainer is the id of the container which network this container is connected to. +func (n NetworkMode) ConnectedContainer() (idOrName string) { + idOrName, _ = containerID(string(n)) + return idOrName +} + +// UserDefined indicates user-created network +func (n NetworkMode) UserDefined() string { + if n.IsUserDefined() { + return string(n) + } + return "" +} + +// UsernsMode represents userns mode in the container. +type UsernsMode string + +// IsHost indicates whether the container uses the host's userns. +func (n UsernsMode) IsHost() bool { + return n == "host" +} + +// IsPrivate indicates whether the container uses the a private userns. +func (n UsernsMode) IsPrivate() bool { + return !n.IsHost() +} + +// Valid indicates whether the userns is valid. +func (n UsernsMode) Valid() bool { + return n == "" || n.IsHost() +} + +// CgroupSpec represents the cgroup to use for the container. +type CgroupSpec string + +// IsContainer indicates whether the container is using another container cgroup +func (c CgroupSpec) IsContainer() bool { + _, ok := containerID(string(c)) + return ok +} + +// Valid indicates whether the cgroup spec is valid. +func (c CgroupSpec) Valid() bool { + // TODO(thaJeztah): align with PidMode, and consider container-mode without a container name/ID to be invalid. + return c == "" || c.IsContainer() +} + +// Container returns the ID or name of the container whose cgroup will be used. +func (c CgroupSpec) Container() (idOrName string) { + idOrName, _ = containerID(string(c)) + return idOrName +} + +// UTSMode represents the UTS namespace of the container. +type UTSMode string + +// IsPrivate indicates whether the container uses its private UTS namespace. +func (n UTSMode) IsPrivate() bool { + return !n.IsHost() +} + +// IsHost indicates whether the container uses the host's UTS namespace. +func (n UTSMode) IsHost() bool { + return n == "host" +} + +// Valid indicates whether the UTS namespace is valid. +func (n UTSMode) Valid() bool { + return n == "" || n.IsHost() +} + +// PidMode represents the pid namespace of the container. +type PidMode string + +// IsPrivate indicates whether the container uses its own new pid namespace. +func (n PidMode) IsPrivate() bool { + return !n.IsHost() && !n.IsContainer() +} + +// IsHost indicates whether the container uses the host's pid namespace. +func (n PidMode) IsHost() bool { + return n == "host" +} + +// IsContainer indicates whether the container uses a container's pid namespace. +func (n PidMode) IsContainer() bool { + _, ok := containerID(string(n)) + return ok +} + +// Valid indicates whether the pid namespace is valid. +func (n PidMode) Valid() bool { + return n == "" || n.IsHost() || validContainer(string(n)) +} + +// Container returns the name of the container whose pid namespace is going to be used. +func (n PidMode) Container() (idOrName string) { + idOrName, _ = containerID(string(n)) + return idOrName +} + +// DeviceRequest represents a request for devices from a device driver. +// Used by GPU device drivers. +type DeviceRequest struct { + Driver string // Name of device driver + Count int // Number of devices to request (-1 = All) + DeviceIDs []string // List of device IDs as recognizable by the device driver + Capabilities [][]string // An OR list of AND lists of device capabilities (e.g. "gpu") + Options map[string]string // Options to pass onto the device driver +} + +// DeviceMapping represents the device mapping between the host and the container. +type DeviceMapping struct { + PathOnHost string + PathInContainer string + CgroupPermissions string +} + +// RestartPolicy represents the restart policies of the container. +type RestartPolicy struct { + Name RestartPolicyMode + MaximumRetryCount int +} + +type RestartPolicyMode string + +const ( + RestartPolicyDisabled RestartPolicyMode = "no" + RestartPolicyAlways RestartPolicyMode = "always" + RestartPolicyOnFailure RestartPolicyMode = "on-failure" + RestartPolicyUnlessStopped RestartPolicyMode = "unless-stopped" +) + +// IsNone indicates whether the container has the "no" restart policy. +// This means the container will not automatically restart when exiting. +func (rp *RestartPolicy) IsNone() bool { + return rp.Name == RestartPolicyDisabled || rp.Name == "" +} + +// IsAlways indicates whether the container has the "always" restart policy. +// This means the container will automatically restart regardless of the exit status. +func (rp *RestartPolicy) IsAlways() bool { + return rp.Name == RestartPolicyAlways +} + +// IsOnFailure indicates whether the container has the "on-failure" restart policy. +// This means the container will automatically restart of exiting with a non-zero exit status. +func (rp *RestartPolicy) IsOnFailure() bool { + return rp.Name == RestartPolicyOnFailure +} + +// IsUnlessStopped indicates whether the container has the +// "unless-stopped" restart policy. This means the container will +// automatically restart unless user has put it to stopped state. +func (rp *RestartPolicy) IsUnlessStopped() bool { + return rp.Name == RestartPolicyUnlessStopped +} + +// IsSame compares two RestartPolicy to see if they are the same +func (rp *RestartPolicy) IsSame(tp *RestartPolicy) bool { + return rp.Name == tp.Name && rp.MaximumRetryCount == tp.MaximumRetryCount +} + +// ValidateRestartPolicy validates the given RestartPolicy. +func ValidateRestartPolicy(policy RestartPolicy) error { + switch policy.Name { + case RestartPolicyAlways, RestartPolicyUnlessStopped, RestartPolicyDisabled: + if policy.MaximumRetryCount != 0 { + msg := "invalid restart policy: maximum retry count can only be used with 'on-failure'" + if policy.MaximumRetryCount < 0 { + msg += " and cannot be negative" + } + return &errInvalidParameter{errors.New(msg)} + } + return nil + case RestartPolicyOnFailure: + if policy.MaximumRetryCount < 0 { + return &errInvalidParameter{errors.New("invalid restart policy: maximum retry count cannot be negative")} + } + return nil + case "": + // Versions before v25.0.0 created an empty restart-policy "name" as + // default. Allow an empty name with "any" MaximumRetryCount for + // backward-compatibility. + return nil + default: + return &errInvalidParameter{fmt.Errorf("invalid restart policy: unknown policy '%s'; use one of '%s', '%s', '%s', or '%s'", policy.Name, RestartPolicyDisabled, RestartPolicyAlways, RestartPolicyOnFailure, RestartPolicyUnlessStopped)} + } +} + +// LogMode is a type to define the available modes for logging +// These modes affect how logs are handled when log messages start piling up. +type LogMode string + +// Available logging modes +const ( + LogModeUnset LogMode = "" + LogModeBlocking LogMode = "blocking" + LogModeNonBlock LogMode = "non-blocking" +) + +// LogConfig represents the logging configuration of the container. +type LogConfig struct { + Type string + Config map[string]string +} + +// Ulimit is an alias for [units.Ulimit], which may be moving to a different +// location or become a local type. This alias is to help transitioning. +// +// Users are recommended to use this alias instead of using [units.Ulimit] directly. +type Ulimit = units.Ulimit + +// Resources contains container's resources (cgroups config, ulimits...) +type Resources struct { + // Applicable to all platforms + CPUShares int64 `json:"CpuShares"` // CPU shares (relative weight vs. other containers) + Memory int64 // Memory limit (in bytes) + NanoCPUs int64 `json:"NanoCpus"` // CPU quota in units of 10-9 CPUs. + + // Applicable to UNIX platforms + CgroupParent string // Parent cgroup. + BlkioWeight uint16 // Block IO weight (relative weight vs. other containers) + BlkioWeightDevice []*blkiodev.WeightDevice + BlkioDeviceReadBps []*blkiodev.ThrottleDevice + BlkioDeviceWriteBps []*blkiodev.ThrottleDevice + BlkioDeviceReadIOps []*blkiodev.ThrottleDevice + BlkioDeviceWriteIOps []*blkiodev.ThrottleDevice + CPUPeriod int64 `json:"CpuPeriod"` // CPU CFS (Completely Fair Scheduler) period + CPUQuota int64 `json:"CpuQuota"` // CPU CFS (Completely Fair Scheduler) quota + CPURealtimePeriod int64 `json:"CpuRealtimePeriod"` // CPU real-time period + CPURealtimeRuntime int64 `json:"CpuRealtimeRuntime"` // CPU real-time runtime + CpusetCpus string // CpusetCpus 0-2, 0,1 + CpusetMems string // CpusetMems 0-2, 0,1 + Devices []DeviceMapping // List of devices to map inside the container + DeviceCgroupRules []string // List of rule to be added to the device cgroup + DeviceRequests []DeviceRequest // List of device requests for device drivers + + // KernelMemory specifies the kernel memory limit (in bytes) for the container. + // Deprecated: kernel 5.4 deprecated kmem.limit_in_bytes. + KernelMemory int64 `json:",omitempty"` + KernelMemoryTCP int64 `json:",omitempty"` // Hard limit for kernel TCP buffer memory (in bytes) + MemoryReservation int64 // Memory soft limit (in bytes) + MemorySwap int64 // Total memory usage (memory + swap); set `-1` to enable unlimited swap + MemorySwappiness *int64 // Tuning container memory swappiness behaviour + OomKillDisable *bool // Whether to disable OOM Killer or not + PidsLimit *int64 // Setting PIDs limit for a container; Set `0` or `-1` for unlimited, or `null` to not change. + Ulimits []*Ulimit // List of ulimits to be set in the container + + // Applicable to Windows + CPUCount int64 `json:"CpuCount"` // CPU count + CPUPercent int64 `json:"CpuPercent"` // CPU percent + IOMaximumIOps uint64 // Maximum IOps for the container system drive + IOMaximumBandwidth uint64 // Maximum IO in bytes per second for the container system drive +} + +// UpdateConfig holds the mutable attributes of a Container. +// Those attributes can be updated at runtime. +type UpdateConfig struct { + // Contains container's resources (cgroups, ulimits) + Resources + RestartPolicy RestartPolicy +} + +// HostConfig the non-portable Config structure of a container. +// Here, "non-portable" means "dependent of the host we are running on". +// Portable information *should* appear in Config. +type HostConfig struct { + // Applicable to all platforms + Binds []string // List of volume bindings for this container + ContainerIDFile string // File (path) where the containerId is written + LogConfig LogConfig // Configuration of the logs for this container + NetworkMode NetworkMode // Network mode to use for the container + PortBindings nat.PortMap // Port mapping between the exposed port (container) and the host + RestartPolicy RestartPolicy // Restart policy to be used for the container + AutoRemove bool // Automatically remove container when it exits + VolumeDriver string // Name of the volume driver used to mount volumes + VolumesFrom []string // List of volumes to take from other container + ConsoleSize [2]uint // Initial console size (height,width) + Annotations map[string]string `json:",omitempty"` // Arbitrary non-identifying metadata attached to container and provided to the runtime + + // Applicable to UNIX platforms + CapAdd strslice.StrSlice // List of kernel capabilities to add to the container + CapDrop strslice.StrSlice // List of kernel capabilities to remove from the container + CgroupnsMode CgroupnsMode // Cgroup namespace mode to use for the container + DNS []string `json:"Dns"` // List of DNS server to lookup + DNSOptions []string `json:"DnsOptions"` // List of DNSOption to look for + DNSSearch []string `json:"DnsSearch"` // List of DNSSearch to look for + ExtraHosts []string // List of extra hosts + GroupAdd []string // List of additional groups that the container process will run as + IpcMode IpcMode // IPC namespace to use for the container + Cgroup CgroupSpec // Cgroup to use for the container + Links []string // List of links (in the name:alias form) + OomScoreAdj int // Container preference for OOM-killing + PidMode PidMode // PID namespace to use for the container + Privileged bool // Is the container in privileged mode + PublishAllPorts bool // Should docker publish all exposed port for the container + ReadonlyRootfs bool // Is the container root filesystem in read-only + SecurityOpt []string // List of string values to customize labels for MLS systems, such as SELinux. + StorageOpt map[string]string `json:",omitempty"` // Storage driver options per container. + Tmpfs map[string]string `json:",omitempty"` // List of tmpfs (mounts) used for the container + UTSMode UTSMode // UTS namespace to use for the container + UsernsMode UsernsMode // The user namespace to use for the container + ShmSize int64 // Total shm memory usage + Sysctls map[string]string `json:",omitempty"` // List of Namespaced sysctls used for the container + Runtime string `json:",omitempty"` // Runtime to use with this container + + // Applicable to Windows + Isolation Isolation // Isolation technology of the container (e.g. default, hyperv) + + // Contains container's resources (cgroups, ulimits) + Resources + + // Mounts specs used by the container + Mounts []mount.Mount `json:",omitempty"` + + // MaskedPaths is the list of paths to be masked inside the container (this overrides the default set of paths) + MaskedPaths []string + + // ReadonlyPaths is the list of paths to be set as read-only inside the container (this overrides the default set of paths) + ReadonlyPaths []string + + // Run a custom init inside the container, if null, use the daemon's configured settings + Init *bool `json:",omitempty"` +} + +// containerID splits "container:" values. It returns the container +// ID or name, and whether an ID/name was found. It returns an empty string and +// a "false" if the value does not have a "container:" prefix. Further validation +// of the returned, including checking if the value is empty, should be handled +// by the caller. +func containerID(val string) (idOrName string, ok bool) { + k, v, hasSep := strings.Cut(val, ":") + if !hasSep || k != "container" { + return "", false + } + return v, true +} + +// validContainer checks if the given value is a "container:" mode with +// a non-empty name/ID. +func validContainer(val string) bool { + id, ok := containerID(val) + return ok && id != "" +} diff --git a/vendor/github.com/moby/moby/api/types/container/hostconfig_unix.go b/vendor/github.com/moby/moby/api/types/container/hostconfig_unix.go new file mode 100644 index 0000000000..326a5da7eb --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/hostconfig_unix.go @@ -0,0 +1,45 @@ +//go:build !windows + +package container + +import "github.com/moby/moby/api/types/network" + +// IsValid indicates if an isolation technology is valid +func (i Isolation) IsValid() bool { + return i.IsDefault() +} + +// IsBridge indicates whether container uses the bridge network stack +func (n NetworkMode) IsBridge() bool { + return n == network.NetworkBridge +} + +// IsHost indicates whether container uses the host network stack. +func (n NetworkMode) IsHost() bool { + return n == network.NetworkHost +} + +// IsUserDefined indicates user-created network +func (n NetworkMode) IsUserDefined() bool { + return !n.IsDefault() && !n.IsBridge() && !n.IsHost() && !n.IsNone() && !n.IsContainer() +} + +// NetworkName returns the name of the network stack. +func (n NetworkMode) NetworkName() string { + switch { + case n.IsDefault(): + return network.NetworkDefault + case n.IsBridge(): + return network.NetworkBridge + case n.IsHost(): + return network.NetworkHost + case n.IsNone(): + return network.NetworkNone + case n.IsContainer(): + return "container" + case n.IsUserDefined(): + return n.UserDefined() + default: + return "" + } +} diff --git a/vendor/github.com/moby/moby/api/types/container/hostconfig_windows.go b/vendor/github.com/moby/moby/api/types/container/hostconfig_windows.go new file mode 100644 index 0000000000..977a376023 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/hostconfig_windows.go @@ -0,0 +1,47 @@ +package container + +import "github.com/moby/moby/api/types/network" + +// IsValid indicates if an isolation technology is valid +func (i Isolation) IsValid() bool { + return i.IsDefault() || i.IsHyperV() || i.IsProcess() +} + +// IsBridge indicates whether container uses the bridge network stack +// in windows it is given the name NAT +func (n NetworkMode) IsBridge() bool { + return n == network.NetworkNat +} + +// IsHost indicates whether container uses the host network stack. +// returns false as this is not supported by windows +func (n NetworkMode) IsHost() bool { + return false +} + +// IsUserDefined indicates user-created network +func (n NetworkMode) IsUserDefined() bool { + return !n.IsDefault() && !n.IsNone() && !n.IsBridge() && !n.IsContainer() +} + +// NetworkName returns the name of the network stack. +func (n NetworkMode) NetworkName() string { + switch { + case n.IsDefault(): + return network.NetworkDefault + case n.IsBridge(): + return network.NetworkNat + case n.IsHost(): + // Windows currently doesn't support host network-mode, so + // this would currently never happen.. + return network.NetworkHost + case n.IsNone(): + return network.NetworkNone + case n.IsContainer(): + return "container" + case n.IsUserDefined(): + return n.UserDefined() + default: + return "" + } +} diff --git a/vendor/github.com/moby/moby/api/types/container/network_settings.go b/vendor/github.com/moby/moby/api/types/container/network_settings.go new file mode 100644 index 0000000000..d7dee99e72 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/network_settings.go @@ -0,0 +1,56 @@ +package container + +import ( + "github.com/docker/go-connections/nat" + "github.com/moby/moby/api/types/network" +) + +// NetworkSettings exposes the network settings in the api +type NetworkSettings struct { + NetworkSettingsBase + DefaultNetworkSettings + Networks map[string]*network.EndpointSettings +} + +// NetworkSettingsBase holds networking state for a container when inspecting it. +type NetworkSettingsBase struct { + Bridge string // Bridge contains the name of the default bridge interface iff it was set through the daemon --bridge flag. + SandboxID string // SandboxID uniquely represents a container's network stack + SandboxKey string // SandboxKey identifies the sandbox + Ports nat.PortMap // Ports is a collection of PortBinding indexed by Port + + // HairpinMode specifies if hairpin NAT should be enabled on the virtual interface + // + // Deprecated: This field is never set and will be removed in a future release. + HairpinMode bool + // LinkLocalIPv6Address is an IPv6 unicast address using the link-local prefix + // + // Deprecated: This field is never set and will be removed in a future release. + LinkLocalIPv6Address string + // LinkLocalIPv6PrefixLen is the prefix length of an IPv6 unicast address + // + // Deprecated: This field is never set and will be removed in a future release. + LinkLocalIPv6PrefixLen int + SecondaryIPAddresses []network.Address // Deprecated: This field is never set and will be removed in a future release. + SecondaryIPv6Addresses []network.Address // Deprecated: This field is never set and will be removed in a future release. +} + +// DefaultNetworkSettings holds network information +// during the 2 release deprecation period. +// It will be removed in Docker 1.11. +type DefaultNetworkSettings struct { + EndpointID string // EndpointID uniquely represents a service endpoint in a Sandbox + Gateway string // Gateway holds the gateway address for the network + GlobalIPv6Address string // GlobalIPv6Address holds network's global IPv6 address + GlobalIPv6PrefixLen int // GlobalIPv6PrefixLen represents mask length of network's global IPv6 address + IPAddress string // IPAddress holds the IPv4 address for the network + IPPrefixLen int // IPPrefixLen represents mask length of network's IPv4 address + IPv6Gateway string // IPv6Gateway holds gateway address specific for IPv6 + MacAddress string // MacAddress holds the MAC address for the network +} + +// NetworkSettingsSummary provides a summary of container's networks +// in /containers/json +type NetworkSettingsSummary struct { + Networks map[string]*network.EndpointSettings +} diff --git a/vendor/github.com/moby/moby/api/types/container/options.go b/vendor/github.com/moby/moby/api/types/container/options.go new file mode 100644 index 0000000000..b94152cb47 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/options.go @@ -0,0 +1,67 @@ +package container + +import "github.com/moby/moby/api/types/filters" + +// ResizeOptions holds parameters to resize a TTY. +// It can be used to resize container TTYs and +// exec process TTYs too. +type ResizeOptions struct { + Height uint + Width uint +} + +// AttachOptions holds parameters to attach to a container. +type AttachOptions struct { + Stream bool + Stdin bool + Stdout bool + Stderr bool + DetachKeys string + Logs bool +} + +// CommitOptions holds parameters to commit changes into a container. +type CommitOptions struct { + Reference string + Comment string + Author string + Changes []string + Pause bool + Config *Config +} + +// RemoveOptions holds parameters to remove containers. +type RemoveOptions struct { + RemoveVolumes bool + RemoveLinks bool + Force bool +} + +// StartOptions holds parameters to start containers. +type StartOptions struct { + CheckpointID string + CheckpointDir string +} + +// ListOptions holds parameters to list containers with. +type ListOptions struct { + Size bool + All bool + Latest bool + Since string + Before string + Limit int + Filters filters.Args +} + +// LogsOptions holds parameters to filter logs with. +type LogsOptions struct { + ShowStdout bool + ShowStderr bool + Since string + Until string + Timestamps bool + Follow bool + Tail string + Details bool +} diff --git a/vendor/github.com/moby/moby/api/types/container/port.go b/vendor/github.com/moby/moby/api/types/container/port.go new file mode 100644 index 0000000000..895043cfe9 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/port.go @@ -0,0 +1,23 @@ +package container + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// Port An open port on a container +// swagger:model Port +type Port struct { + + // Host IP address that the container's port is mapped to + IP string `json:"IP,omitempty"` + + // Port on the container + // Required: true + PrivatePort uint16 `json:"PrivatePort"` + + // Port exposed on the host + PublicPort uint16 `json:"PublicPort,omitempty"` + + // type + // Required: true + Type string `json:"Type"` +} diff --git a/vendor/github.com/moby/moby/api/types/container/state.go b/vendor/github.com/moby/moby/api/types/container/state.go new file mode 100644 index 0000000000..78d5c4fe85 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/state.go @@ -0,0 +1,64 @@ +package container + +import ( + "fmt" + "strings" +) + +// ContainerState is a string representation of the container's current state. +// +// It currently is an alias for string, but may become a distinct type in the future. +type ContainerState = string + +const ( + StateCreated ContainerState = "created" // StateCreated indicates the container is created, but not (yet) started. + StateRunning ContainerState = "running" // StateRunning indicates that the container is running. + StatePaused ContainerState = "paused" // StatePaused indicates that the container's current state is paused. + StateRestarting ContainerState = "restarting" // StateRestarting indicates that the container is currently restarting. + StateRemoving ContainerState = "removing" // StateRemoving indicates that the container is being removed. + StateExited ContainerState = "exited" // StateExited indicates that the container exited. + StateDead ContainerState = "dead" // StateDead indicates that the container failed to be deleted. Containers in this state are attempted to be cleaned up when the daemon restarts. +) + +var validStates = []ContainerState{ + StateCreated, StateRunning, StatePaused, StateRestarting, StateRemoving, StateExited, StateDead, +} + +// ValidateContainerState checks if the provided string is a valid +// container [ContainerState]. +func ValidateContainerState(s ContainerState) error { + switch s { + case StateCreated, StateRunning, StatePaused, StateRestarting, StateRemoving, StateExited, StateDead: + return nil + default: + return errInvalidParameter{error: fmt.Errorf("invalid value for state (%s): must be one of %s", s, strings.Join(validStates, ", "))} + } +} + +// StateStatus is used to return container wait results. +// Implements exec.ExitCode interface. +// This type is needed as State include a sync.Mutex field which make +// copying it unsafe. +type StateStatus struct { + exitCode int + err error +} + +// ExitCode returns current exitcode for the state. +func (s StateStatus) ExitCode() int { + return s.exitCode +} + +// Err returns current error for the state. Returns nil if the container had +// exited on its own. +func (s StateStatus) Err() error { + return s.err +} + +// NewStateStatus returns a new StateStatus with the given exit code and error. +func NewStateStatus(exitCode int, err error) StateStatus { + return StateStatus{ + exitCode: exitCode, + err: err, + } +} diff --git a/vendor/github.com/moby/moby/api/types/container/stats.go b/vendor/github.com/moby/moby/api/types/container/stats.go new file mode 100644 index 0000000000..3bfeb4849f --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/stats.go @@ -0,0 +1,177 @@ +package container + +import "time" + +// ThrottlingData stores CPU throttling stats of one running container. +// Not used on Windows. +type ThrottlingData struct { + // Number of periods with throttling active + Periods uint64 `json:"periods"` + // Number of periods when the container hits its throttling limit. + ThrottledPeriods uint64 `json:"throttled_periods"` + // Aggregate time the container was throttled for in nanoseconds. + ThrottledTime uint64 `json:"throttled_time"` +} + +// CPUUsage stores All CPU stats aggregated since container inception. +type CPUUsage struct { + // Total CPU time consumed. + // Units: nanoseconds (Linux) + // Units: 100's of nanoseconds (Windows) + TotalUsage uint64 `json:"total_usage"` + + // Total CPU time consumed per core (Linux). Not used on Windows. + // Units: nanoseconds. + PercpuUsage []uint64 `json:"percpu_usage,omitempty"` + + // Time spent by tasks of the cgroup in kernel mode (Linux). + // Time spent by all container processes in kernel mode (Windows). + // Units: nanoseconds (Linux). + // Units: 100's of nanoseconds (Windows). Not populated for Hyper-V Containers. + UsageInKernelmode uint64 `json:"usage_in_kernelmode"` + + // Time spent by tasks of the cgroup in user mode (Linux). + // Time spent by all container processes in user mode (Windows). + // Units: nanoseconds (Linux). + // Units: 100's of nanoseconds (Windows). Not populated for Hyper-V Containers + UsageInUsermode uint64 `json:"usage_in_usermode"` +} + +// CPUStats aggregates and wraps all CPU related info of container +type CPUStats struct { + // CPU Usage. Linux and Windows. + CPUUsage CPUUsage `json:"cpu_usage"` + + // System Usage. Linux only. + SystemUsage uint64 `json:"system_cpu_usage,omitempty"` + + // Online CPUs. Linux only. + OnlineCPUs uint32 `json:"online_cpus,omitempty"` + + // Throttling Data. Linux only. + ThrottlingData ThrottlingData `json:"throttling_data,omitempty"` +} + +// MemoryStats aggregates all memory stats since container inception on Linux. +// Windows returns stats for commit and private working set only. +type MemoryStats struct { + // Linux Memory Stats + + // current res_counter usage for memory + Usage uint64 `json:"usage,omitempty"` + // maximum usage ever recorded. + MaxUsage uint64 `json:"max_usage,omitempty"` + // TODO(vishh): Export these as stronger types. + // all the stats exported via memory.stat. + Stats map[string]uint64 `json:"stats,omitempty"` + // number of times memory usage hits limits. + Failcnt uint64 `json:"failcnt,omitempty"` + Limit uint64 `json:"limit,omitempty"` + + // Windows Memory Stats + // See https://technet.microsoft.com/en-us/magazine/ff382715.aspx + + // committed bytes + Commit uint64 `json:"commitbytes,omitempty"` + // peak committed bytes + CommitPeak uint64 `json:"commitpeakbytes,omitempty"` + // private working set + PrivateWorkingSet uint64 `json:"privateworkingset,omitempty"` +} + +// BlkioStatEntry is one small entity to store a piece of Blkio stats +// Not used on Windows. +type BlkioStatEntry struct { + Major uint64 `json:"major"` + Minor uint64 `json:"minor"` + Op string `json:"op"` + Value uint64 `json:"value"` +} + +// BlkioStats stores All IO service stats for data read and write. +// This is a Linux specific structure as the differences between expressing +// block I/O on Windows and Linux are sufficiently significant to make +// little sense attempting to morph into a combined structure. +type BlkioStats struct { + // number of bytes transferred to and from the block device + IoServiceBytesRecursive []BlkioStatEntry `json:"io_service_bytes_recursive"` + IoServicedRecursive []BlkioStatEntry `json:"io_serviced_recursive"` + IoQueuedRecursive []BlkioStatEntry `json:"io_queue_recursive"` + IoServiceTimeRecursive []BlkioStatEntry `json:"io_service_time_recursive"` + IoWaitTimeRecursive []BlkioStatEntry `json:"io_wait_time_recursive"` + IoMergedRecursive []BlkioStatEntry `json:"io_merged_recursive"` + IoTimeRecursive []BlkioStatEntry `json:"io_time_recursive"` + SectorsRecursive []BlkioStatEntry `json:"sectors_recursive"` +} + +// StorageStats is the disk I/O stats for read/write on Windows. +type StorageStats struct { + ReadCountNormalized uint64 `json:"read_count_normalized,omitempty"` + ReadSizeBytes uint64 `json:"read_size_bytes,omitempty"` + WriteCountNormalized uint64 `json:"write_count_normalized,omitempty"` + WriteSizeBytes uint64 `json:"write_size_bytes,omitempty"` +} + +// NetworkStats aggregates the network stats of one container +type NetworkStats struct { + // Bytes received. Windows and Linux. + RxBytes uint64 `json:"rx_bytes"` + // Packets received. Windows and Linux. + RxPackets uint64 `json:"rx_packets"` + // Received errors. Not used on Windows. Note that we don't `omitempty` this + // field as it is expected in the >=v1.21 API stats structure. + RxErrors uint64 `json:"rx_errors"` + // Incoming packets dropped. Windows and Linux. + RxDropped uint64 `json:"rx_dropped"` + // Bytes sent. Windows and Linux. + TxBytes uint64 `json:"tx_bytes"` + // Packets sent. Windows and Linux. + TxPackets uint64 `json:"tx_packets"` + // Sent errors. Not used on Windows. Note that we don't `omitempty` this + // field as it is expected in the >=v1.21 API stats structure. + TxErrors uint64 `json:"tx_errors"` + // Outgoing packets dropped. Windows and Linux. + TxDropped uint64 `json:"tx_dropped"` + // Endpoint ID. Not used on Linux. + EndpointID string `json:"endpoint_id,omitempty"` + // Instance ID. Not used on Linux. + InstanceID string `json:"instance_id,omitempty"` +} + +// PidsStats contains the stats of a container's pids +type PidsStats struct { + // Current is the number of pids in the cgroup + Current uint64 `json:"current,omitempty"` + // Limit is the hard limit on the number of pids in the cgroup. + // A "Limit" of 0 means that there is no limit. + Limit uint64 `json:"limit,omitempty"` +} + +// Stats is Ultimate struct aggregating all types of stats of one container +// +// Deprecated: use [StatsResponse] instead. This type will be removed in the next release. +type Stats = StatsResponse + +// StatsResponse aggregates all types of stats of one container. +type StatsResponse struct { + Name string `json:"name,omitempty"` + ID string `json:"id,omitempty"` + + // Common stats + Read time.Time `json:"read"` + PreRead time.Time `json:"preread"` + + // Linux specific stats, not populated on Windows. + PidsStats PidsStats `json:"pids_stats,omitempty"` + BlkioStats BlkioStats `json:"blkio_stats,omitempty"` + + // Windows specific stats, not populated on Linux. + NumProcs uint32 `json:"num_procs"` + StorageStats StorageStats `json:"storage_stats,omitempty"` + + // Shared stats + CPUStats CPUStats `json:"cpu_stats,omitempty"` + PreCPUStats CPUStats `json:"precpu_stats,omitempty"` // "Pre"="Previous" + MemoryStats MemoryStats `json:"memory_stats,omitempty"` + Networks map[string]NetworkStats `json:"networks,omitempty"` +} diff --git a/vendor/github.com/moby/moby/api/types/container/top_response.go b/vendor/github.com/moby/moby/api/types/container/top_response.go new file mode 100644 index 0000000000..b4bae5ef03 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/top_response.go @@ -0,0 +1,18 @@ +package container + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// TopResponse ContainerTopResponse +// +// Container "top" response. +// swagger:model TopResponse +type TopResponse struct { + + // Each process running in the container, where each process + // is an array of values corresponding to the titles. + Processes [][]string `json:"Processes"` + + // The ps column titles + Titles []string `json:"Titles"` +} diff --git a/vendor/github.com/moby/moby/api/types/container/update_response.go b/vendor/github.com/moby/moby/api/types/container/update_response.go new file mode 100644 index 0000000000..e2b5bf5ac0 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/update_response.go @@ -0,0 +1,14 @@ +package container + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// UpdateResponse ContainerUpdateResponse +// +// Response for a successful container-update. +// swagger:model UpdateResponse +type UpdateResponse struct { + + // Warnings encountered when updating the container. + Warnings []string `json:"Warnings"` +} diff --git a/vendor/github.com/moby/moby/api/types/container/wait_exit_error.go b/vendor/github.com/moby/moby/api/types/container/wait_exit_error.go new file mode 100644 index 0000000000..ab56d4eed8 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/wait_exit_error.go @@ -0,0 +1,12 @@ +package container + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// WaitExitError container waiting error, if any +// swagger:model WaitExitError +type WaitExitError struct { + + // Details of an error + Message string `json:"Message,omitempty"` +} diff --git a/vendor/github.com/moby/moby/api/types/container/wait_response.go b/vendor/github.com/moby/moby/api/types/container/wait_response.go new file mode 100644 index 0000000000..84fc6afddc --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/wait_response.go @@ -0,0 +1,18 @@ +package container + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// WaitResponse ContainerWaitResponse +// +// OK response to ContainerWait operation +// swagger:model WaitResponse +type WaitResponse struct { + + // error + Error *WaitExitError `json:"Error,omitempty"` + + // Exit code of the container + // Required: true + StatusCode int64 `json:"StatusCode"` +} diff --git a/vendor/github.com/moby/moby/api/types/container/waitcondition.go b/vendor/github.com/moby/moby/api/types/container/waitcondition.go new file mode 100644 index 0000000000..64820fe358 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/container/waitcondition.go @@ -0,0 +1,22 @@ +package container + +// WaitCondition is a type used to specify a container state for which +// to wait. +type WaitCondition string + +// Possible WaitCondition Values. +// +// WaitConditionNotRunning (default) is used to wait for any of the non-running +// states: "created", "exited", "dead", "removing", or "removed". +// +// WaitConditionNextExit is used to wait for the next time the state changes +// to a non-running state. If the state is currently "created" or "exited", +// this would cause Wait() to block until either the container runs and exits +// or is removed. +// +// WaitConditionRemoved is used to wait for the container to be removed. +const ( + WaitConditionNotRunning WaitCondition = "not-running" + WaitConditionNextExit WaitCondition = "next-exit" + WaitConditionRemoved WaitCondition = "removed" +) diff --git a/vendor/github.com/moby/moby/api/types/error_response.go b/vendor/github.com/moby/moby/api/types/error_response.go new file mode 100644 index 0000000000..dc942d9d9e --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/error_response.go @@ -0,0 +1,13 @@ +package types + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// ErrorResponse Represents an error. +// swagger:model ErrorResponse +type ErrorResponse struct { + + // The error message. + // Required: true + Message string `json:"message"` +} diff --git a/vendor/github.com/moby/moby/api/types/error_response_ext.go b/vendor/github.com/moby/moby/api/types/error_response_ext.go new file mode 100644 index 0000000000..f84f034cd5 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/error_response_ext.go @@ -0,0 +1,6 @@ +package types + +// Error returns the error message +func (e ErrorResponse) Error() string { + return e.Message +} diff --git a/vendor/github.com/moby/moby/api/types/events/events.go b/vendor/github.com/moby/moby/api/types/events/events.go new file mode 100644 index 0000000000..d5bf3059d6 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/events/events.go @@ -0,0 +1,139 @@ +package events + +import "github.com/moby/moby/api/types/filters" + +// Type is used for event-types. +type Type string + +// List of known event types. +const ( + BuilderEventType Type = "builder" // BuilderEventType is the event type that the builder generates. + ConfigEventType Type = "config" // ConfigEventType is the event type that configs generate. + ContainerEventType Type = "container" // ContainerEventType is the event type that containers generate. + DaemonEventType Type = "daemon" // DaemonEventType is the event type that daemon generate. + ImageEventType Type = "image" // ImageEventType is the event type that images generate. + NetworkEventType Type = "network" // NetworkEventType is the event type that networks generate. + NodeEventType Type = "node" // NodeEventType is the event type that nodes generate. + PluginEventType Type = "plugin" // PluginEventType is the event type that plugins generate. + SecretEventType Type = "secret" // SecretEventType is the event type that secrets generate. + ServiceEventType Type = "service" // ServiceEventType is the event type that services generate. + VolumeEventType Type = "volume" // VolumeEventType is the event type that volumes generate. +) + +// Action is used for event-actions. +type Action string + +const ( + ActionCreate Action = "create" + ActionStart Action = "start" + ActionRestart Action = "restart" + ActionStop Action = "stop" + ActionCheckpoint Action = "checkpoint" + ActionPause Action = "pause" + ActionUnPause Action = "unpause" + ActionAttach Action = "attach" + ActionDetach Action = "detach" + ActionResize Action = "resize" + ActionUpdate Action = "update" + ActionRename Action = "rename" + ActionKill Action = "kill" + ActionDie Action = "die" + ActionOOM Action = "oom" + ActionDestroy Action = "destroy" + ActionRemove Action = "remove" + ActionCommit Action = "commit" + ActionTop Action = "top" + ActionCopy Action = "copy" + ActionArchivePath Action = "archive-path" + ActionExtractToDir Action = "extract-to-dir" + ActionExport Action = "export" + ActionImport Action = "import" + ActionSave Action = "save" + ActionLoad Action = "load" + ActionTag Action = "tag" + ActionUnTag Action = "untag" + ActionPush Action = "push" + ActionPull Action = "pull" + ActionPrune Action = "prune" + ActionDelete Action = "delete" + ActionEnable Action = "enable" + ActionDisable Action = "disable" + ActionConnect Action = "connect" + ActionDisconnect Action = "disconnect" + ActionReload Action = "reload" + ActionMount Action = "mount" + ActionUnmount Action = "unmount" + + // ActionExecCreate is the prefix used for exec_create events. These + // event-actions are commonly followed by a colon and space (": "), + // and the command that's defined for the exec, for example: + // + // exec_create: /bin/sh -c 'echo hello' + // + // This is far from ideal; it's a compromise to allow filtering and + // to preserve backward-compatibility. + ActionExecCreate Action = "exec_create" + // ActionExecStart is the prefix used for exec_create events. These + // event-actions are commonly followed by a colon and space (": "), + // and the command that's defined for the exec, for example: + // + // exec_start: /bin/sh -c 'echo hello' + // + // This is far from ideal; it's a compromise to allow filtering and + // to preserve backward-compatibility. + ActionExecStart Action = "exec_start" + ActionExecDie Action = "exec_die" + ActionExecDetach Action = "exec_detach" + + // ActionHealthStatus is the prefix to use for health_status events. + // + // Health-status events can either have a pre-defined status, in which + // case the "health_status" action is followed by a colon, or can be + // "free-form", in which case they're followed by the output of the + // health-check output. + // + // This is far form ideal, and a compromise to allow filtering, and + // to preserve backward-compatibility. + ActionHealthStatus Action = "health_status" + ActionHealthStatusRunning Action = "health_status: running" + ActionHealthStatusHealthy Action = "health_status: healthy" + ActionHealthStatusUnhealthy Action = "health_status: unhealthy" +) + +// Actor describes something that generates events, +// like a container, or a network, or a volume. +// It has a defined name and a set of attributes. +// The container attributes are its labels, other actors +// can generate these attributes from other properties. +type Actor struct { + ID string + Attributes map[string]string +} + +// Message represents the information an event contains +type Message struct { + // Deprecated: use Action instead. + // Information from JSONMessage. + // With data only in container events. + Status string `json:"status,omitempty"` + // Deprecated: use Actor.ID instead. + ID string `json:"id,omitempty"` + // Deprecated: use Actor.Attributes["image"] instead. + From string `json:"from,omitempty"` + + Type Type + Action Action + Actor Actor + // Engine events are local scope. Cluster events are swarm scope. + Scope string `json:"scope,omitempty"` + + Time int64 `json:"time,omitempty"` + TimeNano int64 `json:"timeNano,omitempty"` +} + +// ListOptions holds parameters to filter events with. +type ListOptions struct { + Since string + Until string + Filters filters.Args +} diff --git a/vendor/github.com/moby/moby/api/types/filters/errors.go b/vendor/github.com/moby/moby/api/types/filters/errors.go new file mode 100644 index 0000000000..b8a690d67a --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/filters/errors.go @@ -0,0 +1,24 @@ +package filters + +import "fmt" + +// invalidFilter indicates that the provided filter or its value is invalid +type invalidFilter struct { + Filter string + Value []string +} + +func (e invalidFilter) Error() string { + msg := "invalid filter" + if e.Filter != "" { + msg += " '" + e.Filter + if e.Value != nil { + msg = fmt.Sprintf("%s=%s", msg, e.Value) + } + msg += "'" + } + return msg +} + +// InvalidParameter marks this error as ErrInvalidParameter +func (e invalidFilter) InvalidParameter() {} diff --git a/vendor/github.com/moby/moby/api/types/filters/parse.go b/vendor/github.com/moby/moby/api/types/filters/parse.go new file mode 100644 index 0000000000..097a8a35f1 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/filters/parse.go @@ -0,0 +1,336 @@ +/* +Package filters provides tools for encoding a mapping of keys to a set of +multiple values. +*/ +package filters + +import ( + "encoding/json" + "regexp" + "strings" + + "github.com/moby/moby/api/types/versions" +) + +// Args stores a mapping of keys to a set of multiple values. +type Args struct { + fields map[string]map[string]bool +} + +// KeyValuePair are used to initialize a new Args +type KeyValuePair struct { + Key string + Value string +} + +// Arg creates a new KeyValuePair for initializing Args +func Arg(key, value string) KeyValuePair { + return KeyValuePair{Key: key, Value: value} +} + +// NewArgs returns a new Args populated with the initial args +func NewArgs(initialArgs ...KeyValuePair) Args { + args := Args{fields: map[string]map[string]bool{}} + for _, arg := range initialArgs { + args.Add(arg.Key, arg.Value) + } + return args +} + +// Keys returns all the keys in list of Args +func (args Args) Keys() []string { + keys := make([]string, 0, len(args.fields)) + for k := range args.fields { + keys = append(keys, k) + } + return keys +} + +// MarshalJSON returns a JSON byte representation of the Args +func (args Args) MarshalJSON() ([]byte, error) { + if len(args.fields) == 0 { + return []byte("{}"), nil + } + return json.Marshal(args.fields) +} + +// ToJSON returns the Args as a JSON encoded string +func ToJSON(a Args) (string, error) { + if a.Len() == 0 { + return "", nil + } + buf, err := json.Marshal(a) + return string(buf), err +} + +// ToParamWithVersion encodes Args as a JSON string. If version is less than 1.22 +// then the encoded format will use an older legacy format where the values are a +// list of strings, instead of a set. +// +// Deprecated: do not use in any new code; use ToJSON instead +func ToParamWithVersion(version string, a Args) (string, error) { + if a.Len() == 0 { + return "", nil + } + + if version != "" && versions.LessThan(version, "1.22") { + buf, err := json.Marshal(convertArgsToSlice(a.fields)) + return string(buf), err + } + + return ToJSON(a) +} + +// FromJSON decodes a JSON encoded string into Args +func FromJSON(p string) (Args, error) { + args := NewArgs() + + if p == "" { + return args, nil + } + + raw := []byte(p) + err := json.Unmarshal(raw, &args) + if err == nil { + return args, nil + } + + // Fallback to parsing arguments in the legacy slice format + deprecated := map[string][]string{} + if legacyErr := json.Unmarshal(raw, &deprecated); legacyErr != nil { + return args, &invalidFilter{} + } + + args.fields = deprecatedArgs(deprecated) + return args, nil +} + +// UnmarshalJSON populates the Args from JSON encode bytes +func (args Args) UnmarshalJSON(raw []byte) error { + return json.Unmarshal(raw, &args.fields) +} + +// Get returns the list of values associated with the key +func (args Args) Get(key string) []string { + values := args.fields[key] + if values == nil { + return make([]string, 0) + } + slice := make([]string, 0, len(values)) + for key := range values { + slice = append(slice, key) + } + return slice +} + +// Add a new value to the set of values +func (args Args) Add(key, value string) { + if _, ok := args.fields[key]; ok { + args.fields[key][value] = true + } else { + args.fields[key] = map[string]bool{value: true} + } +} + +// Del removes a value from the set +func (args Args) Del(key, value string) { + if _, ok := args.fields[key]; ok { + delete(args.fields[key], value) + if len(args.fields[key]) == 0 { + delete(args.fields, key) + } + } +} + +// Len returns the number of keys in the mapping +func (args Args) Len() int { + return len(args.fields) +} + +// MatchKVList returns true if all the pairs in sources exist as key=value +// pairs in the mapping at key, or if there are no values at key. +func (args Args) MatchKVList(key string, sources map[string]string) bool { + fieldValues := args.fields[key] + + // do not filter if there is no filter set or cannot determine filter + if len(fieldValues) == 0 { + return true + } + + if len(sources) == 0 { + return false + } + + for value := range fieldValues { + testK, testV, hasValue := strings.Cut(value, "=") + + v, ok := sources[testK] + if !ok { + return false + } + if hasValue && testV != v { + return false + } + } + + return true +} + +// Match returns true if any of the values at key match the source string +func (args Args) Match(field, source string) bool { + if args.ExactMatch(field, source) { + return true + } + + fieldValues := args.fields[field] + for name2match := range fieldValues { + match, err := regexp.MatchString(name2match, source) + if err != nil { + continue + } + if match { + return true + } + } + return false +} + +// GetBoolOrDefault returns a boolean value of the key if the key is present +// and is interpretable as a boolean value. Otherwise the default value is returned. +// Error is not nil only if the filter values are not valid boolean or are conflicting. +func (args Args) GetBoolOrDefault(key string, defaultValue bool) (bool, error) { + fieldValues, ok := args.fields[key] + if !ok { + return defaultValue, nil + } + + if len(fieldValues) == 0 { + return defaultValue, &invalidFilter{key, nil} + } + + isFalse := fieldValues["0"] || fieldValues["false"] + isTrue := fieldValues["1"] || fieldValues["true"] + if isFalse == isTrue { + // Either no or conflicting truthy/falsy value were provided + return defaultValue, &invalidFilter{key, args.Get(key)} + } + return isTrue, nil +} + +// ExactMatch returns true if the source matches exactly one of the values. +func (args Args) ExactMatch(key, source string) bool { + fieldValues, ok := args.fields[key] + // do not filter if there is no filter set or cannot determine filter + if !ok || len(fieldValues) == 0 { + return true + } + + // try to match full name value to avoid O(N) regular expression matching + return fieldValues[source] +} + +// UniqueExactMatch returns true if there is only one value and the source +// matches exactly the value. +func (args Args) UniqueExactMatch(key, source string) bool { + fieldValues := args.fields[key] + // do not filter if there is no filter set or cannot determine filter + if len(fieldValues) == 0 { + return true + } + if len(args.fields[key]) != 1 { + return false + } + + // try to match full name value to avoid O(N) regular expression matching + return fieldValues[source] +} + +// FuzzyMatch returns true if the source matches exactly one value, or the +// source has one of the values as a prefix. +func (args Args) FuzzyMatch(key, source string) bool { + if args.ExactMatch(key, source) { + return true + } + + fieldValues := args.fields[key] + for prefix := range fieldValues { + if strings.HasPrefix(source, prefix) { + return true + } + } + return false +} + +// Contains returns true if the key exists in the mapping +func (args Args) Contains(field string) bool { + _, ok := args.fields[field] + return ok +} + +// Validate compared the set of accepted keys against the keys in the mapping. +// An error is returned if any mapping keys are not in the accepted set. +func (args Args) Validate(accepted map[string]bool) error { + for name := range args.fields { + if !accepted[name] { + return &invalidFilter{name, nil} + } + } + return nil +} + +// WalkValues iterates over the list of values for a key in the mapping and calls +// op() for each value. If op returns an error the iteration stops and the +// error is returned. +func (args Args) WalkValues(field string, op func(value string) error) error { + if _, ok := args.fields[field]; !ok { + return nil + } + for v := range args.fields[field] { + if err := op(v); err != nil { + return err + } + } + return nil +} + +// Clone returns a copy of args. +func (args Args) Clone() (newArgs Args) { + newArgs.fields = make(map[string]map[string]bool, len(args.fields)) + for k, m := range args.fields { + var mm map[string]bool + if m != nil { + mm = make(map[string]bool, len(m)) + for kk, v := range m { + mm[kk] = v + } + } + newArgs.fields[k] = mm + } + return newArgs +} + +func deprecatedArgs(d map[string][]string) map[string]map[string]bool { + m := map[string]map[string]bool{} + for k, v := range d { + values := map[string]bool{} + for _, vv := range v { + values[vv] = true + } + m[k] = values + } + return m +} + +func convertArgsToSlice(f map[string]map[string]bool) map[string][]string { + m := map[string][]string{} + for k, v := range f { + values := []string{} + for kk := range v { + if v[kk] { + values = append(values, kk) + } + } + m[k] = values + } + return m +} diff --git a/vendor/github.com/moby/moby/api/types/image/delete_response.go b/vendor/github.com/moby/moby/api/types/image/delete_response.go new file mode 100644 index 0000000000..998620dc6a --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/image/delete_response.go @@ -0,0 +1,15 @@ +package image + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// DeleteResponse delete response +// swagger:model DeleteResponse +type DeleteResponse struct { + + // The image ID of an image that was deleted + Deleted string `json:"Deleted,omitempty"` + + // The image ID of an image that was untagged + Untagged string `json:"Untagged,omitempty"` +} diff --git a/vendor/github.com/moby/moby/api/types/image/disk_usage.go b/vendor/github.com/moby/moby/api/types/image/disk_usage.go new file mode 100644 index 0000000000..b29d925cac --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/image/disk_usage.go @@ -0,0 +1,8 @@ +package image + +// DiskUsage contains disk usage for images. +type DiskUsage struct { + TotalSize int64 + Reclaimable int64 + Items []*Summary +} diff --git a/vendor/github.com/moby/moby/api/types/image/image.go b/vendor/github.com/moby/moby/api/types/image/image.go new file mode 100644 index 0000000000..abb7ffd805 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/image/image.go @@ -0,0 +1,47 @@ +package image + +import ( + "io" + "time" +) + +// Metadata contains engine-local data about the image. +type Metadata struct { + // LastTagTime is the date and time at which the image was last tagged. + LastTagTime time.Time `json:",omitempty"` +} + +// PruneReport contains the response for Engine API: +// POST "/images/prune" +type PruneReport struct { + ImagesDeleted []DeleteResponse + SpaceReclaimed uint64 +} + +// LoadResponse returns information to the client about a load process. +// +// TODO(thaJeztah): remove this type, and just use an io.ReadCloser +// +// This type was added in https://github.com/moby/moby/pull/18878, related +// to https://github.com/moby/moby/issues/19177; +// +// Make docker load to output json when the response content type is json +// Swarm hijacks the response from docker load and returns JSON rather +// than plain text like the Engine does. This makes the API library to return +// information to figure that out. +// +// However the "load" endpoint unconditionally returns JSON; +// https://github.com/moby/moby/blob/7b9d2ef6e5518a3d3f3cc418459f8df786cfbbd1/api/server/router/image/image_routes.go#L248-L255 +// +// PR https://github.com/moby/moby/pull/21959 made the response-type depend +// on whether "quiet" was set, but this logic got changed in a follow-up +// https://github.com/moby/moby/pull/25557, which made the JSON response-type +// unconditionally, but the output produced depend on whether"quiet" was set. +// +// We should deprecated the "quiet" option, as it's really a client +// responsibility. +type LoadResponse struct { + // Body must be closed to avoid a resource leak + Body io.ReadCloser + JSON bool +} diff --git a/vendor/github.com/moby/moby/api/types/image/image_history.go b/vendor/github.com/moby/moby/api/types/image/image_history.go new file mode 100644 index 0000000000..a6cdab84d8 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/image/image_history.go @@ -0,0 +1,36 @@ +package image + +// ---------------------------------------------------------------------------- +// Code generated by `swagger generate operation`. DO NOT EDIT. +// +// See hack/generate-swagger-api.sh +// ---------------------------------------------------------------------------- + +// HistoryResponseItem individual image layer information in response to ImageHistory operation +// swagger:model HistoryResponseItem +type HistoryResponseItem struct { + + // comment + // Required: true + Comment string `json:"Comment"` + + // created + // Required: true + Created int64 `json:"Created"` + + // created by + // Required: true + CreatedBy string `json:"CreatedBy"` + + // Id + // Required: true + ID string `json:"Id"` + + // size + // Required: true + Size int64 `json:"Size"` + + // tags + // Required: true + Tags []string `json:"Tags"` +} diff --git a/vendor/github.com/moby/moby/api/types/image/image_inspect.go b/vendor/github.com/moby/moby/api/types/image/image_inspect.go new file mode 100644 index 0000000000..4335f733d5 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/image/image_inspect.go @@ -0,0 +1,142 @@ +package image + +import ( + dockerspec "github.com/moby/docker-image-spec/specs-go/v1" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/storage" + ocispec "github.com/opencontainers/image-spec/specs-go/v1" +) + +// RootFS returns Image's RootFS description including the layer IDs. +type RootFS struct { + Type string `json:",omitempty"` + Layers []string `json:",omitempty"` +} + +// InspectResponse contains response of Engine API: +// GET "/images/{name:.*}/json" +type InspectResponse struct { + // ID is the content-addressable ID of an image. + // + // This identifier is a content-addressable digest calculated from the + // image's configuration (which includes the digests of layers used by + // the image). + // + // Note that this digest differs from the `RepoDigests` below, which + // holds digests of image manifests that reference the image. + ID string `json:"Id"` + + // RepoTags is a list of image names/tags in the local image cache that + // reference this image. + // + // Multiple image tags can refer to the same image, and this list may be + // empty if no tags reference the image, in which case the image is + // "untagged", in which case it can still be referenced by its ID. + RepoTags []string + + // RepoDigests is a list of content-addressable digests of locally available + // image manifests that the image is referenced from. Multiple manifests can + // refer to the same image. + // + // These digests are usually only available if the image was either pulled + // from a registry, or if the image was pushed to a registry, which is when + // the manifest is generated and its digest calculated. + RepoDigests []string + + // Parent is the ID of the parent image. + // + // Depending on how the image was created, this field may be empty and + // is only set for images that were built/created locally. This field + // is empty if the image was pulled from an image registry. + Parent string + + // Comment is an optional message that can be set when committing or + // importing the image. + Comment string + + // Created is the date and time at which the image was created, formatted in + // RFC 3339 nano-seconds (time.RFC3339Nano). + // + // This information is only available if present in the image, + // and omitted otherwise. + Created string `json:",omitempty"` + + // Container is the ID of the container that was used to create the image. + // + // Depending on how the image was created, this field may be empty. + // + // Deprecated: this field is omitted in API v1.45, but kept for backward compatibility. + Container string `json:",omitempty"` + + // ContainerConfig is an optional field containing the configuration of the + // container that was last committed when creating the image. + // + // Previous versions of Docker builder used this field to store build cache, + // and it is not in active use anymore. + // + // Deprecated: this field is omitted in API v1.45, but kept for backward compatibility. + ContainerConfig *container.Config `json:",omitempty"` + + // DockerVersion is the version of Docker that was used to build the image. + // + // Depending on how the image was created, this field may be empty. + DockerVersion string + + // Author is the name of the author that was specified when committing the + // image, or as specified through MAINTAINER (deprecated) in the Dockerfile. + Author string + Config *dockerspec.DockerOCIImageConfig + + // Architecture is the hardware CPU architecture that the image runs on. + Architecture string + + // Variant is the CPU architecture variant (presently ARM-only). + Variant string `json:",omitempty"` + + // OS is the Operating System the image is built to run on. + Os string + + // OsVersion is the version of the Operating System the image is built to + // run on (especially for Windows). + OsVersion string `json:",omitempty"` + + // Size is the total size of the image including all layers it is composed of. + Size int64 + + // VirtualSize is the total size of the image including all layers it is + // composed of. + // + // Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. + VirtualSize int64 `json:"VirtualSize,omitempty"` + + // GraphDriver holds information about the storage driver used to store the + // container's and image's filesystem. + GraphDriver storage.DriverData + + // RootFS contains information about the image's RootFS, including the + // layer IDs. + RootFS RootFS + + // Metadata of the image in the local cache. + // + // This information is local to the daemon, and not part of the image itself. + Metadata Metadata + + // Descriptor is the OCI descriptor of the image target. + // It's only set if the daemon provides a multi-platform image store. + // + // WARNING: This is experimental and may change at any time without any backward + // compatibility. + Descriptor *ocispec.Descriptor `json:"Descriptor,omitempty"` + + // Manifests is a list of image manifests available in this image. It + // provides a more detailed view of the platform-specific image manifests or + // other image-attached data like build attestations. + // + // Only available if the daemon provides a multi-platform image store, the client + // requests manifests AND does not request a specific platform. + // + // WARNING: This is experimental and may change at any time without any backward + // compatibility. + Manifests []ManifestSummary `json:"Manifests,omitempty"` +} diff --git a/vendor/github.com/moby/moby/api/types/image/manifest.go b/vendor/github.com/moby/moby/api/types/image/manifest.go new file mode 100644 index 0000000000..db8a00830e --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/image/manifest.go @@ -0,0 +1,99 @@ +package image + +import ( + "github.com/opencontainers/go-digest" + ocispec "github.com/opencontainers/image-spec/specs-go/v1" +) + +type ManifestKind string + +const ( + ManifestKindImage ManifestKind = "image" + ManifestKindAttestation ManifestKind = "attestation" + ManifestKindUnknown ManifestKind = "unknown" +) + +type ManifestSummary struct { + // ID is the content-addressable ID of an image and is the same as the + // digest of the image manifest. + // + // Required: true + ID string `json:"ID"` + + // Descriptor is the OCI descriptor of the image. + // + // Required: true + Descriptor ocispec.Descriptor `json:"Descriptor"` + + // Indicates whether all the child content (image config, layers) is + // fully available locally + // + // Required: true + Available bool `json:"Available"` + + // Size is the size information of the content related to this manifest. + // Note: These sizes only take the locally available content into account. + // + // Required: true + Size struct { + // Content is the size (in bytes) of all the locally present + // content in the content store (e.g. image config, layers) + // referenced by this manifest and its children. + // This only includes blobs in the content store. + Content int64 `json:"Content"` + + // Total is the total size (in bytes) of all the locally present + // data (both distributable and non-distributable) that's related to + // this manifest and its children. + // This equal to the sum of [Content] size AND all the sizes in the + // [Size] struct present in the Kind-specific data struct. + // For example, for an image kind (Kind == ManifestKindImage), + // this would include the size of the image content and unpacked + // image snapshots ([Size.Content] + [ImageData.Size.Unpacked]). + Total int64 `json:"Total"` + } `json:"Size"` + + // Kind is the kind of the image manifest. + // + // Required: true + Kind ManifestKind `json:"Kind"` + + // Fields below are specific to the kind of the image manifest. + + // Present only if Kind == ManifestKindImage. + ImageData *ImageProperties `json:"ImageData,omitempty"` + + // Present only if Kind == ManifestKindAttestation. + AttestationData *AttestationProperties `json:"AttestationData,omitempty"` +} + +type ImageProperties struct { + // Platform is the OCI platform object describing the platform of the image. + // + // Required: true + Platform ocispec.Platform `json:"Platform"` + + Size struct { + // Unpacked is the size (in bytes) of the locally unpacked + // (uncompressed) image content that's directly usable by the containers + // running this image. + // It's independent of the distributable content - e.g. + // the image might still have an unpacked data that's still used by + // some container even when the distributable/compressed content is + // already gone. + // + // Required: true + Unpacked int64 `json:"Unpacked"` + } + + // Containers is an array containing the IDs of the containers that are + // using this image. + // + // Required: true + Containers []string `json:"Containers"` +} + +type AttestationProperties struct { + // For is the digest of the image manifest that this attestation is for. + For digest.Digest `json:"For"` +} diff --git a/vendor/github.com/moby/moby/api/types/image/opts.go b/vendor/github.com/moby/moby/api/types/image/opts.go new file mode 100644 index 0000000000..fb397d492b --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/image/opts.go @@ -0,0 +1,124 @@ +package image + +import ( + "context" + "io" + + "github.com/moby/moby/api/types/filters" + ocispec "github.com/opencontainers/image-spec/specs-go/v1" +) + +// ImportSource holds source information for ImageImport +type ImportSource struct { + Source io.Reader // Source is the data to send to the server to create this image from. You must set SourceName to "-" to leverage this. + SourceName string // SourceName is the name of the image to pull. Set to "-" to leverage the Source attribute. +} + +// ImportOptions holds information to import images from the client host. +type ImportOptions struct { + Tag string // Tag is the name to tag this image with. This attribute is deprecated. + Message string // Message is the message to tag the image with + Changes []string // Changes are the raw changes to apply to this image + Platform string // Platform is the target platform of the image +} + +// CreateOptions holds information to create images. +type CreateOptions struct { + RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry. + Platform string // Platform is the target platform of the image if it needs to be pulled from the registry. +} + +// PullOptions holds information to pull images. +type PullOptions struct { + All bool + RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry + + // PrivilegeFunc is a function that clients can supply to retry operations + // after getting an authorization error. This function returns the registry + // authentication header value in base64 encoded format, or an error if the + // privilege request fails. + // + // For details, refer to [github.com/docker/docker/api/types/registry.RequestAuthConfig]. + PrivilegeFunc func(context.Context) (string, error) + Platform string +} + +// PushOptions holds information to push images. +type PushOptions struct { + All bool + RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry + + // PrivilegeFunc is a function that clients can supply to retry operations + // after getting an authorization error. This function returns the registry + // authentication header value in base64 encoded format, or an error if the + // privilege request fails. + // + // For details, refer to [github.com/docker/docker/api/types/registry.RequestAuthConfig]. + PrivilegeFunc func(context.Context) (string, error) + + // Platform is an optional field that selects a specific platform to push + // when the image is a multi-platform image. + // Using this will only push a single platform-specific manifest. + Platform *ocispec.Platform `json:",omitempty"` +} + +// ListOptions holds parameters to list images with. +type ListOptions struct { + // All controls whether all images in the graph are filtered, or just + // the heads. + All bool + + // Filters is a JSON-encoded set of filter arguments. + Filters filters.Args + + // SharedSize indicates whether the shared size of images should be computed. + SharedSize bool + + // ContainerCount indicates whether container count should be computed. + // + // Deprecated: This field has been unused and is no longer required and will be removed in a future version. + ContainerCount bool + + // Manifests indicates whether the image manifests should be returned. + Manifests bool +} + +// RemoveOptions holds parameters to remove images. +type RemoveOptions struct { + Platforms []ocispec.Platform + Force bool + PruneChildren bool +} + +// HistoryOptions holds parameters to get image history. +type HistoryOptions struct { + // Platform from the manifest list to use for history. + Platform *ocispec.Platform +} + +// LoadOptions holds parameters to load images. +type LoadOptions struct { + // Quiet suppresses progress output + Quiet bool + + // Platforms selects the platforms to load if the image is a + // multi-platform image and has multiple variants. + Platforms []ocispec.Platform +} + +type InspectOptions struct { + // Manifests returns the image manifests. + Manifests bool + + // Platform selects the specific platform of a multi-platform image to inspect. + // + // This option is only available for API version 1.49 and up. + Platform *ocispec.Platform +} + +// SaveOptions holds parameters to save images. +type SaveOptions struct { + // Platforms selects the platforms to save if the image is a + // multi-platform image and has multiple variants. + Platforms []ocispec.Platform +} diff --git a/vendor/github.com/moby/moby/api/types/image/summary.go b/vendor/github.com/moby/moby/api/types/image/summary.go new file mode 100644 index 0000000000..c5ae6ab9ca --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/image/summary.go @@ -0,0 +1,101 @@ +package image + +import ocispec "github.com/opencontainers/image-spec/specs-go/v1" + +type Summary struct { + + // Number of containers using this image. Includes both stopped and running + // containers. + // + // This size is not calculated by default, and depends on which API endpoint + // is used. `-1` indicates that the value has not been set / calculated. + // + // Required: true + Containers int64 `json:"Containers"` + + // Date and time at which the image was created as a Unix timestamp + // (number of seconds since EPOCH). + // + // Required: true + Created int64 `json:"Created"` + + // ID is the content-addressable ID of an image. + // + // This identifier is a content-addressable digest calculated from the + // image's configuration (which includes the digests of layers used by + // the image). + // + // Note that this digest differs from the `RepoDigests` below, which + // holds digests of image manifests that reference the image. + // + // Required: true + ID string `json:"Id"` + + // User-defined key/value metadata. + // Required: true + Labels map[string]string `json:"Labels"` + + // ID of the parent image. + // + // Depending on how the image was created, this field may be empty and + // is only set for images that were built/created locally. This field + // is empty if the image was pulled from an image registry. + // + // Required: true + ParentID string `json:"ParentId"` + + // Descriptor is the OCI descriptor of the image target. + // It's only set if the daemon provides a multi-platform image store. + // + // WARNING: This is experimental and may change at any time without any backward + // compatibility. + Descriptor *ocispec.Descriptor `json:"Descriptor,omitempty"` + + // Manifests is a list of image manifests available in this image. It + // provides a more detailed view of the platform-specific image manifests or + // other image-attached data like build attestations. + // + // WARNING: This is experimental and may change at any time without any backward + // compatibility. + Manifests []ManifestSummary `json:"Manifests,omitempty"` + + // List of content-addressable digests of locally available image manifests + // that the image is referenced from. Multiple manifests can refer to the + // same image. + // + // These digests are usually only available if the image was either pulled + // from a registry, or if the image was pushed to a registry, which is when + // the manifest is generated and its digest calculated. + // + // Required: true + RepoDigests []string `json:"RepoDigests"` + + // List of image names/tags in the local image cache that reference this + // image. + // + // Multiple image tags can refer to the same image, and this list may be + // empty if no tags reference the image, in which case the image is + // "untagged", in which case it can still be referenced by its ID. + // + // Required: true + RepoTags []string `json:"RepoTags"` + + // Total size of image layers that are shared between this image and other + // images. + // + // This size is not calculated by default. `-1` indicates that the value + // has not been set / calculated. + // + // Required: true + SharedSize int64 `json:"SharedSize"` + + // Total size of the image including all layers it is composed of. + // + // Required: true + Size int64 `json:"Size"` + + // Total size of the image including all layers it is composed of. + // + // Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. + VirtualSize int64 `json:"VirtualSize,omitempty"` +} diff --git a/vendor/github.com/moby/moby/api/types/mount/mount.go b/vendor/github.com/moby/moby/api/types/mount/mount.go new file mode 100644 index 0000000000..090d436c62 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/mount/mount.go @@ -0,0 +1,157 @@ +package mount + +import ( + "os" +) + +// Type represents the type of a mount. +type Type string + +// Type constants +const ( + // TypeBind is the type for mounting host dir + TypeBind Type = "bind" + // TypeVolume is the type for remote storage volumes + TypeVolume Type = "volume" + // TypeTmpfs is the type for mounting tmpfs + TypeTmpfs Type = "tmpfs" + // TypeNamedPipe is the type for mounting Windows named pipes + TypeNamedPipe Type = "npipe" + // TypeCluster is the type for Swarm Cluster Volumes. + TypeCluster Type = "cluster" + // TypeImage is the type for mounting another image's filesystem + TypeImage Type = "image" +) + +// Mount represents a mount (volume). +type Mount struct { + Type Type `json:",omitempty"` + // Source specifies the name of the mount. Depending on mount type, this + // may be a volume name or a host path, or even ignored. + // Source is not supported for tmpfs (must be an empty value) + Source string `json:",omitempty"` + Target string `json:",omitempty"` + ReadOnly bool `json:",omitempty"` // attempts recursive read-only if possible + Consistency Consistency `json:",omitempty"` + + BindOptions *BindOptions `json:",omitempty"` + VolumeOptions *VolumeOptions `json:",omitempty"` + ImageOptions *ImageOptions `json:",omitempty"` + TmpfsOptions *TmpfsOptions `json:",omitempty"` + ClusterOptions *ClusterOptions `json:",omitempty"` +} + +// Propagation represents the propagation of a mount. +type Propagation string + +const ( + // PropagationRPrivate RPRIVATE + PropagationRPrivate Propagation = "rprivate" + // PropagationPrivate PRIVATE + PropagationPrivate Propagation = "private" + // PropagationRShared RSHARED + PropagationRShared Propagation = "rshared" + // PropagationShared SHARED + PropagationShared Propagation = "shared" + // PropagationRSlave RSLAVE + PropagationRSlave Propagation = "rslave" + // PropagationSlave SLAVE + PropagationSlave Propagation = "slave" +) + +// Propagations is the list of all valid mount propagations +var Propagations = []Propagation{ + PropagationRPrivate, + PropagationPrivate, + PropagationRShared, + PropagationShared, + PropagationRSlave, + PropagationSlave, +} + +// Consistency represents the consistency requirements of a mount. +type Consistency string + +const ( + // ConsistencyFull guarantees bind mount-like consistency + ConsistencyFull Consistency = "consistent" + // ConsistencyCached mounts can cache read data and FS structure + ConsistencyCached Consistency = "cached" + // ConsistencyDelegated mounts can cache read and written data and structure + ConsistencyDelegated Consistency = "delegated" + // ConsistencyDefault provides "consistent" behavior unless overridden + ConsistencyDefault Consistency = "default" +) + +// BindOptions defines options specific to mounts of type "bind". +type BindOptions struct { + Propagation Propagation `json:",omitempty"` + NonRecursive bool `json:",omitempty"` + CreateMountpoint bool `json:",omitempty"` + // ReadOnlyNonRecursive makes the mount non-recursively read-only, but still leaves the mount recursive + // (unless NonRecursive is set to true in conjunction). + ReadOnlyNonRecursive bool `json:",omitempty"` + // ReadOnlyForceRecursive raises an error if the mount cannot be made recursively read-only. + ReadOnlyForceRecursive bool `json:",omitempty"` +} + +// VolumeOptions represents the options for a mount of type volume. +type VolumeOptions struct { + NoCopy bool `json:",omitempty"` + Labels map[string]string `json:",omitempty"` + Subpath string `json:",omitempty"` + DriverConfig *Driver `json:",omitempty"` +} + +type ImageOptions struct { + Subpath string `json:",omitempty"` +} + +// Driver represents a volume driver. +type Driver struct { + Name string `json:",omitempty"` + Options map[string]string `json:",omitempty"` +} + +// TmpfsOptions defines options specific to mounts of type "tmpfs". +type TmpfsOptions struct { + // Size sets the size of the tmpfs, in bytes. + // + // This will be converted to an operating system specific value + // depending on the host. For example, on linux, it will be converted to + // use a 'k', 'm' or 'g' syntax. BSD, though not widely supported with + // docker, uses a straight byte value. + // + // Percentages are not supported. + SizeBytes int64 `json:",omitempty"` + // Mode of the tmpfs upon creation + Mode os.FileMode `json:",omitempty"` + // Options to be passed to the tmpfs mount. An array of arrays. Flag + // options should be provided as 1-length arrays. Other types should be + // provided as 2-length arrays, where the first item is the key and the + // second the value. + Options [][]string `json:",omitempty"` + // TODO(stevvooe): There are several more tmpfs flags, specified in the + // daemon, that are accepted. Only the most basic are added for now. + // + // From https://github.com/moby/sys/blob/mount/v0.1.1/mount/flags.go#L47-L56 + // + // var validFlags = map[string]bool{ + // "": true, + // "size": true, X + // "mode": true, X + // "uid": true, + // "gid": true, + // "nr_inodes": true, + // "nr_blocks": true, + // "mpol": true, + // } + // + // Some of these may be straightforward to add, but others, such as + // uid/gid have implications in a clustered system. +} + +// ClusterOptions specifies options for a Cluster volume. +type ClusterOptions struct { + // intentionally empty +} diff --git a/vendor/github.com/moby/moby/api/types/network/create_response.go b/vendor/github.com/moby/moby/api/types/network/create_response.go new file mode 100644 index 0000000000..c32b35bff5 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/network/create_response.go @@ -0,0 +1,19 @@ +package network + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// CreateResponse NetworkCreateResponse +// +// OK response to NetworkCreate operation +// swagger:model CreateResponse +type CreateResponse struct { + + // The ID of the created network. + // Required: true + ID string `json:"Id"` + + // Warnings encountered when creating the container + // Required: true + Warning string `json:"Warning"` +} diff --git a/vendor/github.com/moby/moby/api/types/network/endpoint.go b/vendor/github.com/moby/moby/api/types/network/endpoint.go new file mode 100644 index 0000000000..cdc06c6c90 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/network/endpoint.go @@ -0,0 +1,151 @@ +package network + +import ( + "errors" + "fmt" + "net" +) + +// EndpointSettings stores the network endpoint details +type EndpointSettings struct { + // Configurations + IPAMConfig *EndpointIPAMConfig + Links []string + Aliases []string // Aliases holds the list of extra, user-specified DNS names for this endpoint. + // MacAddress may be used to specify a MAC address when the container is created. + // Once the container is running, it becomes operational data (it may contain a + // generated address). + MacAddress string + DriverOpts map[string]string + + // GwPriority determines which endpoint will provide the default gateway + // for the container. The endpoint with the highest priority will be used. + // If multiple endpoints have the same priority, they are lexicographically + // sorted based on their network name, and the one that sorts first is picked. + GwPriority int + // Operational data + NetworkID string + EndpointID string + Gateway string + IPAddress string + IPPrefixLen int + IPv6Gateway string + GlobalIPv6Address string + GlobalIPv6PrefixLen int + // DNSNames holds all the (non fully qualified) DNS names associated to this endpoint. First entry is used to + // generate PTR records. + DNSNames []string +} + +// Copy makes a deep copy of `EndpointSettings` +func (es *EndpointSettings) Copy() *EndpointSettings { + epCopy := *es + if es.IPAMConfig != nil { + epCopy.IPAMConfig = es.IPAMConfig.Copy() + } + + if es.Links != nil { + links := make([]string, 0, len(es.Links)) + epCopy.Links = append(links, es.Links...) + } + + if es.Aliases != nil { + aliases := make([]string, 0, len(es.Aliases)) + epCopy.Aliases = append(aliases, es.Aliases...) + } + + if len(es.DNSNames) > 0 { + epCopy.DNSNames = make([]string, len(es.DNSNames)) + copy(epCopy.DNSNames, es.DNSNames) + } + + return &epCopy +} + +// EndpointIPAMConfig represents IPAM configurations for the endpoint +type EndpointIPAMConfig struct { + IPv4Address string `json:",omitempty"` + IPv6Address string `json:",omitempty"` + LinkLocalIPs []string `json:",omitempty"` +} + +// Copy makes a copy of the endpoint ipam config +func (cfg *EndpointIPAMConfig) Copy() *EndpointIPAMConfig { + cfgCopy := *cfg + cfgCopy.LinkLocalIPs = make([]string, 0, len(cfg.LinkLocalIPs)) + cfgCopy.LinkLocalIPs = append(cfgCopy.LinkLocalIPs, cfg.LinkLocalIPs...) + return &cfgCopy +} + +// NetworkSubnet describes a user-defined subnet for a specific network. It's only used to validate if an +// EndpointIPAMConfig is valid for a specific network. +type NetworkSubnet interface { + // Contains checks whether the NetworkSubnet contains [addr]. + Contains(addr net.IP) bool + // IsStatic checks whether the subnet was statically allocated (ie. user-defined). + IsStatic() bool +} + +// IsInRange checks whether static IP addresses are valid in a specific network. +func (cfg *EndpointIPAMConfig) IsInRange(v4Subnets []NetworkSubnet, v6Subnets []NetworkSubnet) error { + var errs []error + + if err := validateEndpointIPAddress(cfg.IPv4Address, v4Subnets); err != nil { + errs = append(errs, err) + } + if err := validateEndpointIPAddress(cfg.IPv6Address, v6Subnets); err != nil { + errs = append(errs, err) + } + + return errJoin(errs...) +} + +func validateEndpointIPAddress(epAddr string, ipamSubnets []NetworkSubnet) error { + if epAddr == "" { + return nil + } + + var staticSubnet bool + parsedAddr := net.ParseIP(epAddr) + for _, subnet := range ipamSubnets { + if subnet.IsStatic() { + staticSubnet = true + if subnet.Contains(parsedAddr) { + return nil + } + } + } + + if staticSubnet { + return fmt.Errorf("no configured subnet or ip-range contain the IP address %s", epAddr) + } + + return errors.New("user specified IP address is supported only when connecting to networks with user configured subnets") +} + +// Validate checks whether cfg is valid. +func (cfg *EndpointIPAMConfig) Validate() error { + if cfg == nil { + return nil + } + + var errs []error + + if cfg.IPv4Address != "" { + if addr := net.ParseIP(cfg.IPv4Address); addr == nil || addr.To4() == nil || addr.IsUnspecified() { + errs = append(errs, fmt.Errorf("invalid IPv4 address: %s", cfg.IPv4Address)) + } + } + if cfg.IPv6Address != "" { + if addr := net.ParseIP(cfg.IPv6Address); addr == nil || addr.To4() != nil || addr.IsUnspecified() { + errs = append(errs, fmt.Errorf("invalid IPv6 address: %s", cfg.IPv6Address)) + } + } + for _, addr := range cfg.LinkLocalIPs { + if parsed := net.ParseIP(addr); parsed == nil || parsed.IsUnspecified() { + errs = append(errs, fmt.Errorf("invalid link-local IP address: %s", addr)) + } + } + + return errJoin(errs...) +} diff --git a/vendor/github.com/moby/moby/api/types/network/ipam.go b/vendor/github.com/moby/moby/api/types/network/ipam.go new file mode 100644 index 0000000000..f9a9ff9b35 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/network/ipam.go @@ -0,0 +1,173 @@ +package network + +import ( + "errors" + "fmt" + "net/netip" + "strings" +) + +// IPAM represents IP Address Management +type IPAM struct { + Driver string + Options map[string]string // Per network IPAM driver options + Config []IPAMConfig +} + +// IPAMConfig represents IPAM configurations +type IPAMConfig struct { + Subnet string `json:",omitempty"` + IPRange string `json:",omitempty"` + Gateway string `json:",omitempty"` + AuxAddress map[string]string `json:"AuxiliaryAddresses,omitempty"` +} + +type ipFamily string + +const ( + ip4 ipFamily = "IPv4" + ip6 ipFamily = "IPv6" +) + +// ValidateIPAM checks whether the network's IPAM passed as argument is valid. It returns a joinError of the list of +// errors found. +func ValidateIPAM(ipam *IPAM, enableIPv6 bool) error { + if ipam == nil { + return nil + } + + var errs []error + for _, cfg := range ipam.Config { + subnet, err := netip.ParsePrefix(cfg.Subnet) + if err != nil { + errs = append(errs, fmt.Errorf("invalid subnet %s: invalid CIDR block notation", cfg.Subnet)) + continue + } + subnetFamily := ip4 + if subnet.Addr().Is6() { + subnetFamily = ip6 + } + + if !enableIPv6 && subnetFamily == ip6 { + continue + } + + if subnet != subnet.Masked() { + errs = append(errs, fmt.Errorf("invalid subnet %s: it should be %s", subnet, subnet.Masked())) + } + + if ipRangeErrs := validateIPRange(cfg.IPRange, subnet, subnetFamily); len(ipRangeErrs) > 0 { + errs = append(errs, ipRangeErrs...) + } + + if err := validateAddress(cfg.Gateway, subnet, subnetFamily); err != nil { + errs = append(errs, fmt.Errorf("invalid gateway %s: %w", cfg.Gateway, err)) + } + + for auxName, aux := range cfg.AuxAddress { + if err := validateAddress(aux, subnet, subnetFamily); err != nil { + errs = append(errs, fmt.Errorf("invalid auxiliary address %s: %w", auxName, err)) + } + } + } + + if err := errJoin(errs...); err != nil { + return fmt.Errorf("invalid network config:\n%w", err) + } + + return nil +} + +func validateIPRange(ipRange string, subnet netip.Prefix, subnetFamily ipFamily) []error { + if ipRange == "" { + return nil + } + prefix, err := netip.ParsePrefix(ipRange) + if err != nil { + return []error{fmt.Errorf("invalid ip-range %s: invalid CIDR block notation", ipRange)} + } + family := ip4 + if prefix.Addr().Is6() { + family = ip6 + } + + if family != subnetFamily { + return []error{fmt.Errorf("invalid ip-range %s: parent subnet is an %s block", ipRange, subnetFamily)} + } + + var errs []error + if prefix.Bits() < subnet.Bits() { + errs = append(errs, fmt.Errorf("invalid ip-range %s: CIDR block is bigger than its parent subnet %s", ipRange, subnet)) + } + if prefix != prefix.Masked() { + errs = append(errs, fmt.Errorf("invalid ip-range %s: it should be %s", prefix, prefix.Masked())) + } + if !subnet.Overlaps(prefix) { + errs = append(errs, fmt.Errorf("invalid ip-range %s: parent subnet %s doesn't contain ip-range", ipRange, subnet)) + } + + return errs +} + +func validateAddress(address string, subnet netip.Prefix, subnetFamily ipFamily) error { + if address == "" { + return nil + } + addr, err := netip.ParseAddr(address) + if err != nil { + return errors.New("invalid address") + } + family := ip4 + if addr.Is6() { + family = ip6 + } + + if family != subnetFamily { + return fmt.Errorf("parent subnet is an %s block", subnetFamily) + } + if !subnet.Contains(addr) { + return fmt.Errorf("parent subnet %s doesn't contain this address", subnet) + } + + return nil +} + +func errJoin(errs ...error) error { + n := 0 + for _, err := range errs { + if err != nil { + n++ + } + } + if n == 0 { + return nil + } + e := &joinError{ + errs: make([]error, 0, n), + } + for _, err := range errs { + if err != nil { + e.errs = append(e.errs, err) + } + } + return e +} + +type joinError struct { + errs []error +} + +func (e *joinError) Error() string { + if len(e.errs) == 1 { + return strings.TrimSpace(e.errs[0].Error()) + } + stringErrs := make([]string, 0, len(e.errs)) + for _, subErr := range e.errs { + stringErrs = append(stringErrs, strings.ReplaceAll(subErr.Error(), "\n", "\n\t")) + } + return "* " + strings.Join(stringErrs, "\n* ") +} + +func (e *joinError) Unwrap() []error { + return e.errs +} diff --git a/vendor/github.com/moby/moby/api/types/network/network.go b/vendor/github.com/moby/moby/api/types/network/network.go new file mode 100644 index 0000000000..f9a206f189 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/network/network.go @@ -0,0 +1,168 @@ +package network + +import ( + "time" + + "github.com/moby/moby/api/types/filters" +) + +const ( + // NetworkDefault is a platform-independent alias to choose the platform-specific default network stack. + NetworkDefault = "default" + // NetworkHost is the name of the predefined network used when the NetworkMode host is selected (only available on Linux) + NetworkHost = "host" + // NetworkNone is the name of the predefined network used when the NetworkMode none is selected (available on both Linux and Windows) + NetworkNone = "none" + // NetworkBridge is the name of the default network on Linux + NetworkBridge = "bridge" + // NetworkNat is the name of the default network on Windows + NetworkNat = "nat" +) + +// CreateRequest is the request message sent to the server for network create call. +type CreateRequest struct { + CreateOptions + Name string // Name is the requested name of the network. + + // Deprecated: CheckDuplicate is deprecated since API v1.44, but it defaults to true when sent by the client + // package to older daemons. + CheckDuplicate *bool `json:",omitempty"` +} + +// CreateOptions holds options to create a network. +type CreateOptions struct { + Driver string // Driver is the driver-name used to create the network (e.g. `bridge`, `overlay`) + Scope string // Scope describes the level at which the network exists (e.g. `swarm` for cluster-wide or `local` for machine level). + EnableIPv4 *bool `json:",omitempty"` // EnableIPv4 represents whether to enable IPv4. + EnableIPv6 *bool `json:",omitempty"` // EnableIPv6 represents whether to enable IPv6. + IPAM *IPAM // IPAM is the network's IP Address Management. + Internal bool // Internal represents if the network is used internal only. + Attachable bool // Attachable represents if the global scope is manually attachable by regular containers from workers in swarm mode. + Ingress bool // Ingress indicates the network is providing the routing-mesh for the swarm cluster. + ConfigOnly bool // ConfigOnly creates a config-only network. Config-only networks are place-holder networks for network configurations to be used by other networks. ConfigOnly networks cannot be used directly to run containers or services. + ConfigFrom *ConfigReference // ConfigFrom specifies the source which will provide the configuration for this network. The specified network must be a config-only network; see [CreateOptions.ConfigOnly]. + Options map[string]string // Options specifies the network-specific options to use for when creating the network. + Labels map[string]string // Labels holds metadata specific to the network being created. +} + +// ListOptions holds parameters to filter the list of networks with. +type ListOptions struct { + Filters filters.Args +} + +// InspectOptions holds parameters to inspect network. +type InspectOptions struct { + Scope string + Verbose bool +} + +// ConnectOptions represents the data to be used to connect a container to the +// network. +type ConnectOptions struct { + Container string + EndpointConfig *EndpointSettings `json:",omitempty"` +} + +// DisconnectOptions represents the data to be used to disconnect a container +// from the network. +type DisconnectOptions struct { + Container string + Force bool +} + +// Inspect is the body of the "get network" http response message. +type Inspect struct { + Name string // Name is the name of the network + ID string `json:"Id"` // ID uniquely identifies a network on a single machine + Created time.Time // Created is the time the network created + Scope string // Scope describes the level at which the network exists (e.g. `swarm` for cluster-wide or `local` for machine level) + Driver string // Driver is the Driver name used to create the network (e.g. `bridge`, `overlay`) + EnableIPv4 bool // EnableIPv4 represents whether IPv4 is enabled + EnableIPv6 bool // EnableIPv6 represents whether IPv6 is enabled + IPAM IPAM // IPAM is the network's IP Address Management + Internal bool // Internal represents if the network is used internal only + Attachable bool // Attachable represents if the global scope is manually attachable by regular containers from workers in swarm mode. + Ingress bool // Ingress indicates the network is providing the routing-mesh for the swarm cluster. + ConfigFrom ConfigReference // ConfigFrom specifies the source which will provide the configuration for this network. + ConfigOnly bool // ConfigOnly networks are place-holder networks for network configurations to be used by other networks. ConfigOnly networks cannot be used directly to run containers or services. + Containers map[string]EndpointResource // Containers contains endpoints belonging to the network + Options map[string]string // Options holds the network specific options to use for when creating the network + Labels map[string]string // Labels holds metadata specific to the network being created + Peers []PeerInfo `json:",omitempty"` // List of peer nodes for an overlay network + Services map[string]ServiceInfo `json:",omitempty"` +} + +// Summary is used as response when listing networks. It currently is an alias +// for [Inspect], but may diverge in the future, as not all information may +// be included when listing networks. +type Summary = Inspect + +// Address represents an IP address +type Address struct { + Addr string + PrefixLen int +} + +// PeerInfo represents one peer of an overlay network +type PeerInfo struct { + Name string + IP string +} + +// Task carries the information about one backend task +type Task struct { + Name string + EndpointID string + EndpointIP string + Info map[string]string +} + +// ServiceInfo represents service parameters with the list of service's tasks +type ServiceInfo struct { + VIP string + Ports []string + LocalLBIndex int + Tasks []Task +} + +// EndpointResource contains network resources allocated and used for a +// container in a network. +type EndpointResource struct { + Name string + EndpointID string + MacAddress string + IPv4Address string + IPv6Address string +} + +// NetworkingConfig represents the container's networking configuration for each of its interfaces +// Carries the networking configs specified in the `docker run` and `docker network connect` commands +type NetworkingConfig struct { + EndpointsConfig map[string]*EndpointSettings // Endpoint configs for each connecting network +} + +// ConfigReference specifies the source which provides a network's configuration +type ConfigReference struct { + Network string +} + +var acceptedFilters = map[string]bool{ + "dangling": true, + "driver": true, + "id": true, + "label": true, + "name": true, + "scope": true, + "type": true, +} + +// ValidateFilters validates the list of filter args with the available filters. +func ValidateFilters(filter filters.Args) error { + return filter.Validate(acceptedFilters) +} + +// PruneReport contains the response for Engine API: +// POST "/networks/prune" +type PruneReport struct { + NetworksDeleted []string +} diff --git a/vendor/github.com/moby/moby/api/types/plugin.go b/vendor/github.com/moby/moby/api/types/plugin.go new file mode 100644 index 0000000000..abae48b9ab --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/plugin.go @@ -0,0 +1,203 @@ +package types + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// Plugin A plugin for the Engine API +// swagger:model Plugin +type Plugin struct { + + // config + // Required: true + Config PluginConfig `json:"Config"` + + // True if the plugin is running. False if the plugin is not running, only installed. + // Required: true + Enabled bool `json:"Enabled"` + + // Id + ID string `json:"Id,omitempty"` + + // name + // Required: true + Name string `json:"Name"` + + // plugin remote reference used to push/pull the plugin + PluginReference string `json:"PluginReference,omitempty"` + + // settings + // Required: true + Settings PluginSettings `json:"Settings"` +} + +// PluginConfig The config of a plugin. +// swagger:model PluginConfig +type PluginConfig struct { + + // args + // Required: true + Args PluginConfigArgs `json:"Args"` + + // description + // Required: true + Description string `json:"Description"` + + // Docker Version used to create the plugin + DockerVersion string `json:"DockerVersion,omitempty"` + + // documentation + // Required: true + Documentation string `json:"Documentation"` + + // entrypoint + // Required: true + Entrypoint []string `json:"Entrypoint"` + + // env + // Required: true + Env []PluginEnv `json:"Env"` + + // interface + // Required: true + Interface PluginConfigInterface `json:"Interface"` + + // ipc host + // Required: true + IpcHost bool `json:"IpcHost"` + + // linux + // Required: true + Linux PluginConfigLinux `json:"Linux"` + + // mounts + // Required: true + Mounts []PluginMount `json:"Mounts"` + + // network + // Required: true + Network PluginConfigNetwork `json:"Network"` + + // pid host + // Required: true + PidHost bool `json:"PidHost"` + + // propagated mount + // Required: true + PropagatedMount string `json:"PropagatedMount"` + + // user + User PluginConfigUser `json:"User,omitempty"` + + // work dir + // Required: true + WorkDir string `json:"WorkDir"` + + // rootfs + Rootfs *PluginConfigRootfs `json:"rootfs,omitempty"` +} + +// PluginConfigArgs plugin config args +// swagger:model PluginConfigArgs +type PluginConfigArgs struct { + + // description + // Required: true + Description string `json:"Description"` + + // name + // Required: true + Name string `json:"Name"` + + // settable + // Required: true + Settable []string `json:"Settable"` + + // value + // Required: true + Value []string `json:"Value"` +} + +// PluginConfigInterface The interface between Docker and the plugin +// swagger:model PluginConfigInterface +type PluginConfigInterface struct { + + // Protocol to use for clients connecting to the plugin. + ProtocolScheme string `json:"ProtocolScheme,omitempty"` + + // socket + // Required: true + Socket string `json:"Socket"` + + // types + // Required: true + Types []PluginInterfaceType `json:"Types"` +} + +// PluginConfigLinux plugin config linux +// swagger:model PluginConfigLinux +type PluginConfigLinux struct { + + // allow all devices + // Required: true + AllowAllDevices bool `json:"AllowAllDevices"` + + // capabilities + // Required: true + Capabilities []string `json:"Capabilities"` + + // devices + // Required: true + Devices []PluginDevice `json:"Devices"` +} + +// PluginConfigNetwork plugin config network +// swagger:model PluginConfigNetwork +type PluginConfigNetwork struct { + + // type + // Required: true + Type string `json:"Type"` +} + +// PluginConfigRootfs plugin config rootfs +// swagger:model PluginConfigRootfs +type PluginConfigRootfs struct { + + // diff ids + DiffIds []string `json:"diff_ids"` + + // type + Type string `json:"type,omitempty"` +} + +// PluginConfigUser plugin config user +// swagger:model PluginConfigUser +type PluginConfigUser struct { + + // g ID + GID uint32 `json:"GID,omitempty"` + + // UID + UID uint32 `json:"UID,omitempty"` +} + +// PluginSettings Settings that can be modified by users. +// swagger:model PluginSettings +type PluginSettings struct { + + // args + // Required: true + Args []string `json:"Args"` + + // devices + // Required: true + Devices []PluginDevice `json:"Devices"` + + // env + // Required: true + Env []string `json:"Env"` + + // mounts + // Required: true + Mounts []PluginMount `json:"Mounts"` +} diff --git a/vendor/github.com/moby/moby/api/types/plugin_device.go b/vendor/github.com/moby/moby/api/types/plugin_device.go new file mode 100644 index 0000000000..5699010675 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/plugin_device.go @@ -0,0 +1,25 @@ +package types + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// PluginDevice plugin device +// swagger:model PluginDevice +type PluginDevice struct { + + // description + // Required: true + Description string `json:"Description"` + + // name + // Required: true + Name string `json:"Name"` + + // path + // Required: true + Path *string `json:"Path"` + + // settable + // Required: true + Settable []string `json:"Settable"` +} diff --git a/vendor/github.com/moby/moby/api/types/plugin_env.go b/vendor/github.com/moby/moby/api/types/plugin_env.go new file mode 100644 index 0000000000..32962dc2eb --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/plugin_env.go @@ -0,0 +1,25 @@ +package types + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// PluginEnv plugin env +// swagger:model PluginEnv +type PluginEnv struct { + + // description + // Required: true + Description string `json:"Description"` + + // name + // Required: true + Name string `json:"Name"` + + // settable + // Required: true + Settable []string `json:"Settable"` + + // value + // Required: true + Value *string `json:"Value"` +} diff --git a/vendor/github.com/moby/moby/api/types/plugin_interface_type.go b/vendor/github.com/moby/moby/api/types/plugin_interface_type.go new file mode 100644 index 0000000000..c82f204e87 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/plugin_interface_type.go @@ -0,0 +1,21 @@ +package types + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// PluginInterfaceType plugin interface type +// swagger:model PluginInterfaceType +type PluginInterfaceType struct { + + // capability + // Required: true + Capability string `json:"Capability"` + + // prefix + // Required: true + Prefix string `json:"Prefix"` + + // version + // Required: true + Version string `json:"Version"` +} diff --git a/vendor/github.com/moby/moby/api/types/plugin_mount.go b/vendor/github.com/moby/moby/api/types/plugin_mount.go new file mode 100644 index 0000000000..5c031cf8b5 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/plugin_mount.go @@ -0,0 +1,37 @@ +package types + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// PluginMount plugin mount +// swagger:model PluginMount +type PluginMount struct { + + // description + // Required: true + Description string `json:"Description"` + + // destination + // Required: true + Destination string `json:"Destination"` + + // name + // Required: true + Name string `json:"Name"` + + // options + // Required: true + Options []string `json:"Options"` + + // settable + // Required: true + Settable []string `json:"Settable"` + + // source + // Required: true + Source *string `json:"Source"` + + // type + // Required: true + Type string `json:"Type"` +} diff --git a/vendor/github.com/moby/moby/api/types/plugin_responses.go b/vendor/github.com/moby/moby/api/types/plugin_responses.go new file mode 100644 index 0000000000..18f743fcde --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/plugin_responses.go @@ -0,0 +1,71 @@ +package types + +import ( + "encoding/json" + "fmt" + "sort" +) + +// PluginsListResponse contains the response for the Engine API +type PluginsListResponse []*Plugin + +// UnmarshalJSON implements json.Unmarshaler for PluginInterfaceType +func (t *PluginInterfaceType) UnmarshalJSON(p []byte) error { + versionIndex := len(p) + prefixIndex := 0 + if len(p) < 2 || p[0] != '"' || p[len(p)-1] != '"' { + return fmt.Errorf("%q is not a plugin interface type", p) + } + p = p[1 : len(p)-1] +loop: + for i, b := range p { + switch b { + case '.': + prefixIndex = i + case '/': + versionIndex = i + break loop + } + } + t.Prefix = string(p[:prefixIndex]) + t.Capability = string(p[prefixIndex+1 : versionIndex]) + if versionIndex < len(p) { + t.Version = string(p[versionIndex+1:]) + } + return nil +} + +// MarshalJSON implements json.Marshaler for PluginInterfaceType +func (t *PluginInterfaceType) MarshalJSON() ([]byte, error) { + return json.Marshal(t.String()) +} + +// String implements fmt.Stringer for PluginInterfaceType +func (t PluginInterfaceType) String() string { + return fmt.Sprintf("%s.%s/%s", t.Prefix, t.Capability, t.Version) +} + +// PluginPrivilege describes a permission the user has to accept +// upon installing a plugin. +type PluginPrivilege struct { + Name string + Description string + Value []string +} + +// PluginPrivileges is a list of PluginPrivilege +type PluginPrivileges []PluginPrivilege + +func (s PluginPrivileges) Len() int { + return len(s) +} + +func (s PluginPrivileges) Less(i, j int) bool { + return s[i].Name < s[j].Name +} + +func (s PluginPrivileges) Swap(i, j int) { + sort.Strings(s[i].Value) + sort.Strings(s[j].Value) + s[i], s[j] = s[j], s[i] +} diff --git a/vendor/github.com/moby/moby/api/types/plugins/logdriver/entry.pb.go b/vendor/github.com/moby/moby/api/types/plugins/logdriver/entry.pb.go new file mode 100644 index 0000000000..167d1d5f88 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/plugins/logdriver/entry.pb.go @@ -0,0 +1,755 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: entry.proto + +package logdriver + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type LogEntry struct { + Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` + TimeNano int64 `protobuf:"varint,2,opt,name=time_nano,json=timeNano,proto3" json:"time_nano,omitempty"` + Line []byte `protobuf:"bytes,3,opt,name=line,proto3" json:"line,omitempty"` + Partial bool `protobuf:"varint,4,opt,name=partial,proto3" json:"partial,omitempty"` + PartialLogMetadata *PartialLogEntryMetadata `protobuf:"bytes,5,opt,name=partial_log_metadata,json=partialLogMetadata,proto3" json:"partial_log_metadata,omitempty"` +} + +func (m *LogEntry) Reset() { *m = LogEntry{} } +func (m *LogEntry) String() string { return proto.CompactTextString(m) } +func (*LogEntry) ProtoMessage() {} +func (*LogEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_daa6c5b6c627940f, []int{0} +} +func (m *LogEntry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LogEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LogEntry.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LogEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_LogEntry.Merge(m, src) +} +func (m *LogEntry) XXX_Size() int { + return m.Size() +} +func (m *LogEntry) XXX_DiscardUnknown() { + xxx_messageInfo_LogEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_LogEntry proto.InternalMessageInfo + +func (m *LogEntry) GetSource() string { + if m != nil { + return m.Source + } + return "" +} + +func (m *LogEntry) GetTimeNano() int64 { + if m != nil { + return m.TimeNano + } + return 0 +} + +func (m *LogEntry) GetLine() []byte { + if m != nil { + return m.Line + } + return nil +} + +func (m *LogEntry) GetPartial() bool { + if m != nil { + return m.Partial + } + return false +} + +func (m *LogEntry) GetPartialLogMetadata() *PartialLogEntryMetadata { + if m != nil { + return m.PartialLogMetadata + } + return nil +} + +type PartialLogEntryMetadata struct { + Last bool `protobuf:"varint,1,opt,name=last,proto3" json:"last,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + Ordinal int32 `protobuf:"varint,3,opt,name=ordinal,proto3" json:"ordinal,omitempty"` +} + +func (m *PartialLogEntryMetadata) Reset() { *m = PartialLogEntryMetadata{} } +func (m *PartialLogEntryMetadata) String() string { return proto.CompactTextString(m) } +func (*PartialLogEntryMetadata) ProtoMessage() {} +func (*PartialLogEntryMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_daa6c5b6c627940f, []int{1} +} +func (m *PartialLogEntryMetadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PartialLogEntryMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PartialLogEntryMetadata.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PartialLogEntryMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_PartialLogEntryMetadata.Merge(m, src) +} +func (m *PartialLogEntryMetadata) XXX_Size() int { + return m.Size() +} +func (m *PartialLogEntryMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_PartialLogEntryMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_PartialLogEntryMetadata proto.InternalMessageInfo + +func (m *PartialLogEntryMetadata) GetLast() bool { + if m != nil { + return m.Last + } + return false +} + +func (m *PartialLogEntryMetadata) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *PartialLogEntryMetadata) GetOrdinal() int32 { + if m != nil { + return m.Ordinal + } + return 0 +} + +func init() { + proto.RegisterType((*LogEntry)(nil), "LogEntry") + proto.RegisterType((*PartialLogEntryMetadata)(nil), "PartialLogEntryMetadata") +} + +func init() { proto.RegisterFile("entry.proto", fileDescriptor_daa6c5b6c627940f) } + +var fileDescriptor_daa6c5b6c627940f = []byte{ + // 250 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xbd, 0x4a, 0x04, 0x31, + 0x14, 0x85, 0xe7, 0xce, 0xfe, 0x38, 0x73, 0x57, 0x2c, 0x82, 0x68, 0x40, 0x08, 0x61, 0xab, 0x54, + 0x5b, 0xe8, 0x1b, 0x08, 0x36, 0xa2, 0x22, 0x69, 0x2c, 0x87, 0xab, 0x13, 0x96, 0xc0, 0x6c, 0x32, + 0x64, 0x63, 0xe1, 0x5b, 0xf8, 0x3a, 0xbe, 0x81, 0xe5, 0x96, 0x96, 0x32, 0xf3, 0x22, 0x32, 0x71, + 0xc6, 0xce, 0xee, 0x9c, 0xf3, 0xa5, 0xf8, 0x72, 0x71, 0x65, 0x5c, 0x0c, 0x6f, 0x9b, 0x36, 0xf8, + 0xe8, 0xd7, 0x1f, 0x80, 0xc5, 0x9d, 0xdf, 0xde, 0x0c, 0x13, 0x3b, 0xc3, 0xe5, 0xde, 0xbf, 0x86, + 0x17, 0xc3, 0x41, 0x82, 0x2a, 0xf5, 0xd8, 0xd8, 0x05, 0x96, 0xd1, 0xee, 0x4c, 0xe5, 0xc8, 0x79, + 0x9e, 0x4b, 0x50, 0x33, 0x5d, 0x0c, 0xc3, 0x03, 0x39, 0xcf, 0x18, 0xce, 0x1b, 0xeb, 0x0c, 0x9f, + 0x49, 0x50, 0xc7, 0x3a, 0x65, 0xc6, 0xf1, 0xa8, 0xa5, 0x10, 0x2d, 0x35, 0x7c, 0x2e, 0x41, 0x15, + 0x7a, 0xaa, 0xec, 0x16, 0x4f, 0xc7, 0x58, 0x35, 0x7e, 0x5b, 0xed, 0x4c, 0xa4, 0x9a, 0x22, 0xf1, + 0x85, 0x04, 0xb5, 0xba, 0xe4, 0x9b, 0xc7, 0x5f, 0x38, 0x29, 0xdd, 0x8f, 0x5c, 0xb3, 0xf6, 0x0f, + 0x4c, 0xdb, 0xfa, 0x09, 0xcf, 0xff, 0x79, 0x9e, 0xa4, 0x68, 0x1f, 0xd3, 0x3f, 0x0a, 0x9d, 0x32, + 0x3b, 0xc1, 0xdc, 0xd6, 0x49, 0xbf, 0xd4, 0xb9, 0xad, 0x07, 0x49, 0x1f, 0x6a, 0xeb, 0xa8, 0x49, + 0xee, 0x0b, 0x3d, 0xd5, 0x6b, 0xfe, 0xd9, 0x09, 0x38, 0x74, 0x02, 0xbe, 0x3b, 0x01, 0xef, 0xbd, + 0xc8, 0x0e, 0xbd, 0xc8, 0xbe, 0x7a, 0x91, 0x3d, 0x2f, 0xd3, 0xd5, 0xae, 0x7e, 0x02, 0x00, 0x00, + 0xff, 0xff, 0xbb, 0x82, 0x62, 0xd5, 0x44, 0x01, 0x00, 0x00, +} + +func (m *LogEntry) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LogEntry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LogEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PartialLogMetadata != nil { + { + size, err := m.PartialLogMetadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEntry(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Partial { + i-- + if m.Partial { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if len(m.Line) > 0 { + i -= len(m.Line) + copy(dAtA[i:], m.Line) + i = encodeVarintEntry(dAtA, i, uint64(len(m.Line))) + i-- + dAtA[i] = 0x1a + } + if m.TimeNano != 0 { + i = encodeVarintEntry(dAtA, i, uint64(m.TimeNano)) + i-- + dAtA[i] = 0x10 + } + if len(m.Source) > 0 { + i -= len(m.Source) + copy(dAtA[i:], m.Source) + i = encodeVarintEntry(dAtA, i, uint64(len(m.Source))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PartialLogEntryMetadata) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PartialLogEntryMetadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PartialLogEntryMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Ordinal != 0 { + i = encodeVarintEntry(dAtA, i, uint64(m.Ordinal)) + i-- + dAtA[i] = 0x18 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintEntry(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0x12 + } + if m.Last { + i-- + if m.Last { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintEntry(dAtA []byte, offset int, v uint64) int { + offset -= sovEntry(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *LogEntry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Source) + if l > 0 { + n += 1 + l + sovEntry(uint64(l)) + } + if m.TimeNano != 0 { + n += 1 + sovEntry(uint64(m.TimeNano)) + } + l = len(m.Line) + if l > 0 { + n += 1 + l + sovEntry(uint64(l)) + } + if m.Partial { + n += 2 + } + if m.PartialLogMetadata != nil { + l = m.PartialLogMetadata.Size() + n += 1 + l + sovEntry(uint64(l)) + } + return n +} + +func (m *PartialLogEntryMetadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Last { + n += 2 + } + l = len(m.Id) + if l > 0 { + n += 1 + l + sovEntry(uint64(l)) + } + if m.Ordinal != 0 { + n += 1 + sovEntry(uint64(m.Ordinal)) + } + return n +} + +func sovEntry(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEntry(x uint64) (n int) { + return sovEntry(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *LogEntry) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LogEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LogEntry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEntry + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Source = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeNano", wireType) + } + m.TimeNano = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeNano |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Line", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthEntry + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Line = append(m.Line[:0], dAtA[iNdEx:postIndex]...) + if m.Line == nil { + m.Line = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Partial", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Partial = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PartialLogMetadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEntry + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PartialLogMetadata == nil { + m.PartialLogMetadata = &PartialLogEntryMetadata{} + } + if err := m.PartialLogMetadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEntry(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEntry + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PartialLogEntryMetadata) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PartialLogEntryMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PartialLogEntryMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Last", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Last = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEntry + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Ordinal", wireType) + } + m.Ordinal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Ordinal |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEntry(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEntry + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEntry(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEntry + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEntry + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEntry + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthEntry + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEntry + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEntry + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEntry = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEntry = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEntry = fmt.Errorf("proto: unexpected end of group") +) diff --git a/vendor/github.com/moby/moby/api/types/plugins/logdriver/entry.proto b/vendor/github.com/moby/moby/api/types/plugins/logdriver/entry.proto new file mode 100644 index 0000000000..75be3d6416 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/plugins/logdriver/entry.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +message LogEntry { + string source = 1; + int64 time_nano = 2; + bytes line = 3; + bool partial = 4; + PartialLogEntryMetadata partial_log_metadata = 5; +} + +message PartialLogEntryMetadata { + bool last = 1; + string id = 2; + int32 ordinal = 3; +} + diff --git a/vendor/github.com/moby/moby/api/types/plugins/logdriver/gen.go b/vendor/github.com/moby/moby/api/types/plugins/logdriver/gen.go new file mode 100644 index 0000000000..6092a9c195 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/plugins/logdriver/gen.go @@ -0,0 +1,3 @@ +//go:generate protoc --gogofaster_out=import_path=github.com/docker/docker/api/types/plugins/logdriver:. entry.proto + +package logdriver diff --git a/vendor/github.com/moby/moby/api/types/plugins/logdriver/io.go b/vendor/github.com/moby/moby/api/types/plugins/logdriver/io.go new file mode 100644 index 0000000000..8c1ed49dd6 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/plugins/logdriver/io.go @@ -0,0 +1,87 @@ +package logdriver + +import ( + "encoding/binary" + "io" +) + +const binaryEncodeLen = 4 + +// LogEntryEncoder encodes a LogEntry to a protobuf stream +// The stream should look like: +// +// [uint32 binary encoded message size][protobuf message] +// +// To decode an entry, read the first 4 bytes to get the size of the entry, +// then read `size` bytes from the stream. +type LogEntryEncoder interface { + Encode(*LogEntry) error +} + +// NewLogEntryEncoder creates a protobuf stream encoder for log entries. +// This is used to write out log entries to a stream. +func NewLogEntryEncoder(w io.Writer) LogEntryEncoder { + return &logEntryEncoder{ + w: w, + buf: make([]byte, 1024), + } +} + +type logEntryEncoder struct { + buf []byte + w io.Writer +} + +func (e *logEntryEncoder) Encode(l *LogEntry) error { + n := l.Size() + + total := n + binaryEncodeLen + if total > len(e.buf) { + e.buf = make([]byte, total) + } + binary.BigEndian.PutUint32(e.buf, uint32(n)) + + if _, err := l.MarshalTo(e.buf[binaryEncodeLen:]); err != nil { + return err + } + _, err := e.w.Write(e.buf[:total]) + return err +} + +// LogEntryDecoder decodes log entries from a stream +// It is expected that the wire format is as defined by LogEntryEncoder. +type LogEntryDecoder interface { + Decode(*LogEntry) error +} + +// NewLogEntryDecoder creates a new stream decoder for log entries +func NewLogEntryDecoder(r io.Reader) LogEntryDecoder { + return &logEntryDecoder{ + lenBuf: make([]byte, binaryEncodeLen), + buf: make([]byte, 1024), + r: r, + } +} + +type logEntryDecoder struct { + r io.Reader + lenBuf []byte + buf []byte +} + +func (d *logEntryDecoder) Decode(l *LogEntry) error { + _, err := io.ReadFull(d.r, d.lenBuf) + if err != nil { + return err + } + + size := int(binary.BigEndian.Uint32(d.lenBuf)) + if len(d.buf) < size { + d.buf = make([]byte, size) + } + + if _, err := io.ReadFull(d.r, d.buf[:size]); err != nil { + return err + } + return l.Unmarshal(d.buf[:size]) +} diff --git a/vendor/github.com/moby/moby/api/types/registry/authconfig.go b/vendor/github.com/moby/moby/api/types/registry/authconfig.go new file mode 100644 index 0000000000..97b9ac027a --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/registry/authconfig.go @@ -0,0 +1,128 @@ +package registry + +import ( + "bytes" + "context" + "encoding/base64" + "encoding/json" + "errors" + "fmt" + "io" +) + +// AuthHeader is the name of the header used to send encoded registry +// authorization credentials for registry operations (push/pull). +const AuthHeader = "X-Registry-Auth" + +// RequestAuthConfig is a function interface that clients can supply +// to retry operations after getting an authorization error. +// +// The function must return the [AuthHeader] value ([AuthConfig]), encoded +// in base64url format ([RFC4648, section 5]), which can be decoded by +// [DecodeAuthConfig]. +// +// It must return an error if the privilege request fails. +// +// [RFC4648, section 5]: https://tools.ietf.org/html/rfc4648#section-5 +type RequestAuthConfig func(context.Context) (string, error) + +// AuthConfig contains authorization information for connecting to a Registry. +type AuthConfig struct { + Username string `json:"username,omitempty"` + Password string `json:"password,omitempty"` + Auth string `json:"auth,omitempty"` + + // Email is an optional value associated with the username. + // This field is deprecated and will be removed in a later + // version of docker. + Email string `json:"email,omitempty"` + + ServerAddress string `json:"serveraddress,omitempty"` + + // IdentityToken is used to authenticate the user and get + // an access token for the registry. + IdentityToken string `json:"identitytoken,omitempty"` + + // RegistryToken is a bearer token to be sent to a registry + RegistryToken string `json:"registrytoken,omitempty"` +} + +// EncodeAuthConfig serializes the auth configuration as a base64url encoded +// ([RFC4648, section 5]) JSON string for sending through the X-Registry-Auth header. +// +// [RFC4648, section 5]: https://tools.ietf.org/html/rfc4648#section-5 +func EncodeAuthConfig(authConfig AuthConfig) (string, error) { + if authConfig == (AuthConfig{}) { + return "", nil + } + buf, err := json.Marshal(authConfig) + if err != nil { + return "", errInvalidParameter{err} + } + return base64.URLEncoding.EncodeToString(buf), nil +} + +// DecodeAuthConfig decodes base64url encoded ([RFC4648, section 5]) JSON +// authentication information as sent through the X-Registry-Auth header. +// +// This function always returns an [AuthConfig], even if an error occurs. It is up +// to the caller to decide if authentication is required, and if the error can +// be ignored. +// +// [RFC4648, section 5]: https://tools.ietf.org/html/rfc4648#section-5 +func DecodeAuthConfig(authEncoded string) (*AuthConfig, error) { + if authEncoded == "" { + return &AuthConfig{}, nil + } + + decoded, err := base64.URLEncoding.DecodeString(authEncoded) + if err != nil { + var e base64.CorruptInputError + if errors.As(err, &e) { + return &AuthConfig{}, invalid(errors.New("must be a valid base64url-encoded string")) + } + return &AuthConfig{}, invalid(err) + } + + if bytes.Equal(decoded, []byte("{}")) { + return &AuthConfig{}, nil + } + + return decodeAuthConfigFromReader(bytes.NewReader(decoded)) +} + +// DecodeAuthConfigBody decodes authentication information as sent as JSON in the +// body of a request. This function is to provide backward compatibility with old +// clients and API versions. Current clients and API versions expect authentication +// to be provided through the X-Registry-Auth header. +// +// Like [DecodeAuthConfig], this function always returns an [AuthConfig], even if an +// error occurs. It is up to the caller to decide if authentication is required, +// and if the error can be ignored. +// +// Deprecated: this function is no longer used and will be removed in the next release. +func DecodeAuthConfigBody(rdr io.ReadCloser) (*AuthConfig, error) { + return decodeAuthConfigFromReader(rdr) +} + +func decodeAuthConfigFromReader(rdr io.Reader) (*AuthConfig, error) { + authConfig := &AuthConfig{} + if err := json.NewDecoder(rdr).Decode(authConfig); err != nil { + // always return an (empty) AuthConfig to increase compatibility with + // the existing API. + return &AuthConfig{}, invalid(fmt.Errorf("invalid JSON: %w", err)) + } + return authConfig, nil +} + +func invalid(err error) error { + return errInvalidParameter{fmt.Errorf("invalid X-Registry-Auth header: %w", err)} +} + +type errInvalidParameter struct{ error } + +func (errInvalidParameter) InvalidParameter() {} + +func (e errInvalidParameter) Cause() error { return e.error } + +func (e errInvalidParameter) Unwrap() error { return e.error } diff --git a/vendor/github.com/moby/moby/api/types/registry/authenticate.go b/vendor/github.com/moby/moby/api/types/registry/authenticate.go new file mode 100644 index 0000000000..42cac4430a --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/registry/authenticate.go @@ -0,0 +1,21 @@ +package registry + +// ---------------------------------------------------------------------------- +// DO NOT EDIT THIS FILE +// This file was generated by `swagger generate operation` +// +// See hack/generate-swagger-api.sh +// ---------------------------------------------------------------------------- + +// AuthenticateOKBody authenticate o k body +// swagger:model AuthenticateOKBody +type AuthenticateOKBody struct { + + // An opaque token used to authenticate a user after a successful login + // Required: true + IdentityToken string `json:"IdentityToken"` + + // The status of the authentication + // Required: true + Status string `json:"Status"` +} diff --git a/vendor/github.com/moby/moby/api/types/registry/registry.go b/vendor/github.com/moby/moby/api/types/registry/registry.go new file mode 100644 index 0000000000..bcbee4ec82 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/registry/registry.go @@ -0,0 +1,119 @@ +// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: +//go:build go1.23 + +package registry + +import ( + "encoding/json" + "net" + + ocispec "github.com/opencontainers/image-spec/specs-go/v1" +) + +// ServiceConfig stores daemon registry services configuration. +type ServiceConfig struct { + InsecureRegistryCIDRs []*NetIPNet `json:"InsecureRegistryCIDRs"` + IndexConfigs map[string]*IndexInfo `json:"IndexConfigs"` + Mirrors []string + + // ExtraFields is for internal use to include deprecated fields on older API versions. + ExtraFields map[string]any `json:"-"` +} + +// MarshalJSON implements a custom marshaler to include legacy fields +// in API responses. +func (sc *ServiceConfig) MarshalJSON() ([]byte, error) { + type tmp ServiceConfig + base, err := json.Marshal((*tmp)(sc)) + if err != nil { + return nil, err + } + var merged map[string]any + _ = json.Unmarshal(base, &merged) + + for k, v := range sc.ExtraFields { + merged[k] = v + } + return json.Marshal(merged) +} + +// NetIPNet is the net.IPNet type, which can be marshalled and +// unmarshalled to JSON +type NetIPNet net.IPNet + +// String returns the CIDR notation of ipnet +func (ipnet *NetIPNet) String() string { + return (*net.IPNet)(ipnet).String() +} + +// MarshalJSON returns the JSON representation of the IPNet +func (ipnet *NetIPNet) MarshalJSON() ([]byte, error) { + return json.Marshal((*net.IPNet)(ipnet).String()) +} + +// UnmarshalJSON sets the IPNet from a byte array of JSON +func (ipnet *NetIPNet) UnmarshalJSON(b []byte) error { + var ipnetStr string + if err := json.Unmarshal(b, &ipnetStr); err != nil { + return err + } + _, cidr, err := net.ParseCIDR(ipnetStr) + if err != nil { + return err + } + *ipnet = NetIPNet(*cidr) + return nil +} + +// IndexInfo contains information about a registry +// +// RepositoryInfo Examples: +// +// { +// "Index" : { +// "Name" : "docker.io", +// "Mirrors" : ["https://registry-2.docker.io/v1/", "https://registry-3.docker.io/v1/"], +// "Secure" : true, +// "Official" : true, +// }, +// "RemoteName" : "library/debian", +// "LocalName" : "debian", +// "CanonicalName" : "docker.io/debian" +// "Official" : true, +// } +// +// { +// "Index" : { +// "Name" : "127.0.0.1:5000", +// "Mirrors" : [], +// "Secure" : false, +// "Official" : false, +// }, +// "RemoteName" : "user/repo", +// "LocalName" : "127.0.0.1:5000/user/repo", +// "CanonicalName" : "127.0.0.1:5000/user/repo", +// "Official" : false, +// } +type IndexInfo struct { + // Name is the name of the registry, such as "docker.io" + Name string + // Mirrors is a list of mirrors, expressed as URIs + Mirrors []string + // Secure is set to false if the registry is part of the list of + // insecure registries. Insecure registries accept HTTP and/or accept + // HTTPS with certificates from unknown CAs. + Secure bool + // Official indicates whether this is an official registry + Official bool +} + +// DistributionInspect describes the result obtained from contacting the +// registry to retrieve image metadata +type DistributionInspect struct { + // Descriptor contains information about the manifest, including + // the content addressable digest + Descriptor ocispec.Descriptor + // Platforms contains the list of platforms supported by the image, + // obtained by parsing the manifest + Platforms []ocispec.Platform +} diff --git a/vendor/github.com/moby/moby/api/types/registry/search.go b/vendor/github.com/moby/moby/api/types/registry/search.go new file mode 100644 index 0000000000..0bcb6abe29 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/registry/search.go @@ -0,0 +1,48 @@ +package registry + +import ( + "context" + + "github.com/moby/moby/api/types/filters" +) + +// SearchOptions holds parameters to search images with. +type SearchOptions struct { + RegistryAuth string + + // PrivilegeFunc is a function that clients can supply to retry operations + // after getting an authorization error. This function returns the registry + // authentication header value in base64 encoded format, or an error if the + // privilege request fails. + // + // For details, refer to [github.com/docker/docker/api/types/registry.RequestAuthConfig]. + PrivilegeFunc func(context.Context) (string, error) + Filters filters.Args + Limit int +} + +// SearchResult describes a search result returned from a registry +type SearchResult struct { + // StarCount indicates the number of stars this repository has + StarCount int `json:"star_count"` + // IsOfficial is true if the result is from an official repository. + IsOfficial bool `json:"is_official"` + // Name is the name of the repository + Name string `json:"name"` + // IsAutomated indicates whether the result is automated. + // + // Deprecated: the "is_automated" field is deprecated and will always be "false". + IsAutomated bool `json:"is_automated"` + // Description is a textual description of the repository + Description string `json:"description"` +} + +// SearchResults lists a collection search results returned from a registry +type SearchResults struct { + // Query contains the query string that generated the search results + Query string `json:"query"` + // NumResults indicates the number of results the query returned + NumResults int `json:"num_results"` + // Results is a slice containing the actual results for the search + Results []SearchResult `json:"results"` +} diff --git a/vendor/github.com/moby/moby/api/types/storage/driver_data.go b/vendor/github.com/moby/moby/api/types/storage/driver_data.go new file mode 100644 index 0000000000..009e213095 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/storage/driver_data.go @@ -0,0 +1,23 @@ +package storage + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// DriverData Information about the storage driver used to store the container's and +// image's filesystem. +// +// swagger:model DriverData +type DriverData struct { + + // Low-level storage metadata, provided as key/value pairs. + // + // This information is driver-specific, and depends on the storage-driver + // in use, and should be used for informational purposes only. + // + // Required: true + Data map[string]string `json:"Data"` + + // Name of the storage driver. + // Required: true + Name string `json:"Name"` +} diff --git a/vendor/github.com/moby/moby/api/types/strslice/strslice.go b/vendor/github.com/moby/moby/api/types/strslice/strslice.go new file mode 100644 index 0000000000..bad493fb89 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/strslice/strslice.go @@ -0,0 +1,30 @@ +package strslice + +import "encoding/json" + +// StrSlice represents a string or an array of strings. +// We need to override the json decoder to accept both options. +type StrSlice []string + +// UnmarshalJSON decodes the byte slice whether it's a string or an array of +// strings. This method is needed to implement json.Unmarshaler. +func (e *StrSlice) UnmarshalJSON(b []byte) error { + if len(b) == 0 { + // With no input, we preserve the existing value by returning nil and + // leaving the target alone. This allows defining default values for + // the type. + return nil + } + + p := make([]string, 0, 1) + if err := json.Unmarshal(b, &p); err != nil { + var s string + if err := json.Unmarshal(b, &s); err != nil { + return err + } + p = append(p, s) + } + + *e = p + return nil +} diff --git a/vendor/github.com/moby/moby/api/types/swarm/common.go b/vendor/github.com/moby/moby/api/types/swarm/common.go new file mode 100644 index 0000000000..b42812e03f --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/swarm/common.go @@ -0,0 +1,48 @@ +package swarm + +import ( + "strconv" + "time" +) + +// Version represents the internal object version. +type Version struct { + Index uint64 `json:",omitempty"` +} + +// String implements fmt.Stringer interface. +func (v Version) String() string { + return strconv.FormatUint(v.Index, 10) +} + +// Meta is a base object inherited by most of the other once. +type Meta struct { + Version Version `json:",omitempty"` + CreatedAt time.Time `json:",omitempty"` + UpdatedAt time.Time `json:",omitempty"` +} + +// Annotations represents how to describe an object. +type Annotations struct { + Name string `json:",omitempty"` + Labels map[string]string `json:"Labels"` +} + +// Driver represents a driver (network, logging, secrets backend). +type Driver struct { + Name string `json:",omitempty"` + Options map[string]string `json:",omitempty"` +} + +// TLSInfo represents the TLS information about what CA certificate is trusted, +// and who the issuer for a TLS certificate is +type TLSInfo struct { + // TrustRoot is the trusted CA root certificate in PEM format + TrustRoot string `json:",omitempty"` + + // CertIssuer is the raw subject bytes of the issuer + CertIssuerSubject []byte `json:",omitempty"` + + // CertIssuerPublicKey is the raw public key bytes of the issuer + CertIssuerPublicKey []byte `json:",omitempty"` +} diff --git a/vendor/github.com/moby/moby/api/types/swarm/config.go b/vendor/github.com/moby/moby/api/types/swarm/config.go new file mode 100644 index 0000000000..f8e7f4a6f9 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/swarm/config.go @@ -0,0 +1,62 @@ +package swarm + +import ( + "os" + + "github.com/moby/moby/api/types/filters" +) + +// Config represents a config. +type Config struct { + ID string + Meta + Spec ConfigSpec +} + +// ConfigSpec represents a config specification from a config in swarm +type ConfigSpec struct { + Annotations + + // Data is the data to store as a config. + // + // The maximum allowed size is 1000KB, as defined in [MaxConfigSize]. + // + // [MaxConfigSize]: https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize + Data []byte `json:",omitempty"` + + // Templating controls whether and how to evaluate the config payload as + // a template. If it is not set, no templating is used. + Templating *Driver `json:",omitempty"` +} + +// ConfigReferenceFileTarget is a file target in a config reference +type ConfigReferenceFileTarget struct { + Name string + UID string + GID string + Mode os.FileMode +} + +// ConfigReferenceRuntimeTarget is a target for a config specifying that it +// isn't mounted into the container but instead has some other purpose. +type ConfigReferenceRuntimeTarget struct{} + +// ConfigReference is a reference to a config in swarm +type ConfigReference struct { + File *ConfigReferenceFileTarget `json:",omitempty"` + Runtime *ConfigReferenceRuntimeTarget `json:",omitempty"` + ConfigID string + ConfigName string +} + +// ConfigCreateResponse contains the information returned to a client +// on the creation of a new config. +type ConfigCreateResponse struct { + // ID is the id of the created config. + ID string +} + +// ConfigListOptions holds parameters to list configs +type ConfigListOptions struct { + Filters filters.Args +} diff --git a/vendor/github.com/moby/moby/api/types/swarm/container.go b/vendor/github.com/moby/moby/api/types/swarm/container.go new file mode 100644 index 0000000000..bc8690d8cb --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/swarm/container.go @@ -0,0 +1,119 @@ +package swarm + +import ( + "time" + + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/mount" +) + +// DNSConfig specifies DNS related configurations in resolver configuration file (resolv.conf) +// Detailed documentation is available in: +// http://man7.org/linux/man-pages/man5/resolv.conf.5.html +// `nameserver`, `search`, `options` have been supported. +// TODO: `domain` is not supported yet. +type DNSConfig struct { + // Nameservers specifies the IP addresses of the name servers + Nameservers []string `json:",omitempty"` + // Search specifies the search list for host-name lookup + Search []string `json:",omitempty"` + // Options allows certain internal resolver variables to be modified + Options []string `json:",omitempty"` +} + +// SELinuxContext contains the SELinux labels of the container. +type SELinuxContext struct { + Disable bool + + User string + Role string + Type string + Level string +} + +// SeccompMode is the type used for the enumeration of possible seccomp modes +// in SeccompOpts +type SeccompMode string + +const ( + SeccompModeDefault SeccompMode = "default" + SeccompModeUnconfined SeccompMode = "unconfined" + SeccompModeCustom SeccompMode = "custom" +) + +// SeccompOpts defines the options for configuring seccomp on a swarm-managed +// container. +type SeccompOpts struct { + // Mode is the SeccompMode used for the container. + Mode SeccompMode `json:",omitempty"` + // Profile is the custom seccomp profile as a json object to be used with + // the container. Mode should be set to SeccompModeCustom when using a + // custom profile in this manner. + Profile []byte `json:",omitempty"` +} + +// AppArmorMode is type used for the enumeration of possible AppArmor modes in +// AppArmorOpts +type AppArmorMode string + +const ( + AppArmorModeDefault AppArmorMode = "default" + AppArmorModeDisabled AppArmorMode = "disabled" +) + +// AppArmorOpts defines the options for configuring AppArmor on a swarm-managed +// container. Currently, custom AppArmor profiles are not supported. +type AppArmorOpts struct { + Mode AppArmorMode `json:",omitempty"` +} + +// CredentialSpec for managed service account (Windows only) +type CredentialSpec struct { + Config string + File string + Registry string +} + +// Privileges defines the security options for the container. +type Privileges struct { + CredentialSpec *CredentialSpec + SELinuxContext *SELinuxContext + Seccomp *SeccompOpts `json:",omitempty"` + AppArmor *AppArmorOpts `json:",omitempty"` + NoNewPrivileges bool +} + +// ContainerSpec represents the spec of a container. +type ContainerSpec struct { + Image string `json:",omitempty"` + Labels map[string]string `json:",omitempty"` + Command []string `json:",omitempty"` + Args []string `json:",omitempty"` + Hostname string `json:",omitempty"` + Env []string `json:",omitempty"` + Dir string `json:",omitempty"` + User string `json:",omitempty"` + Groups []string `json:",omitempty"` + Privileges *Privileges `json:",omitempty"` + Init *bool `json:",omitempty"` + StopSignal string `json:",omitempty"` + TTY bool `json:",omitempty"` + OpenStdin bool `json:",omitempty"` + ReadOnly bool `json:",omitempty"` + Mounts []mount.Mount `json:",omitempty"` + StopGracePeriod *time.Duration `json:",omitempty"` + Healthcheck *container.HealthConfig `json:",omitempty"` + // The format of extra hosts on swarmkit is specified in: + // http://man7.org/linux/man-pages/man5/hosts.5.html + // IP_address canonical_hostname [aliases...] + Hosts []string `json:",omitempty"` + DNSConfig *DNSConfig `json:",omitempty"` + Secrets []*SecretReference `json:",omitempty"` + Configs []*ConfigReference `json:",omitempty"` + Isolation container.Isolation `json:",omitempty"` + Sysctls map[string]string `json:",omitempty"` + CapabilityAdd []string `json:",omitempty"` + CapabilityDrop []string `json:",omitempty"` + Ulimits []*container.Ulimit `json:",omitempty"` + OomScoreAdj int64 `json:",omitempty"` +} diff --git a/vendor/github.com/moby/moby/api/types/swarm/network.go b/vendor/github.com/moby/moby/api/types/swarm/network.go new file mode 100644 index 0000000000..95a5fb385a --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/swarm/network.go @@ -0,0 +1,121 @@ +package swarm + +import ( + "github.com/moby/moby/api/types/network" +) + +// Endpoint represents an endpoint. +type Endpoint struct { + Spec EndpointSpec `json:",omitempty"` + Ports []PortConfig `json:",omitempty"` + VirtualIPs []EndpointVirtualIP `json:",omitempty"` +} + +// EndpointSpec represents the spec of an endpoint. +type EndpointSpec struct { + Mode ResolutionMode `json:",omitempty"` + Ports []PortConfig `json:",omitempty"` +} + +// ResolutionMode represents a resolution mode. +type ResolutionMode string + +const ( + // ResolutionModeVIP VIP + ResolutionModeVIP ResolutionMode = "vip" + // ResolutionModeDNSRR DNSRR + ResolutionModeDNSRR ResolutionMode = "dnsrr" +) + +// PortConfig represents the config of a port. +type PortConfig struct { + Name string `json:",omitempty"` + Protocol PortConfigProtocol `json:",omitempty"` + // TargetPort is the port inside the container + TargetPort uint32 `json:",omitempty"` + // PublishedPort is the port on the swarm hosts + PublishedPort uint32 `json:",omitempty"` + // PublishMode is the mode in which port is published + PublishMode PortConfigPublishMode `json:",omitempty"` +} + +// PortConfigPublishMode represents the mode in which the port is to +// be published. +type PortConfigPublishMode string + +const ( + // PortConfigPublishModeIngress is used for ports published + // for ingress load balancing using routing mesh. + PortConfigPublishModeIngress PortConfigPublishMode = "ingress" + // PortConfigPublishModeHost is used for ports published + // for direct host level access on the host where the task is running. + PortConfigPublishModeHost PortConfigPublishMode = "host" +) + +// PortConfigProtocol represents the protocol of a port. +type PortConfigProtocol string + +const ( + // TODO(stevvooe): These should be used generally, not just for PortConfig. + + // PortConfigProtocolTCP TCP + PortConfigProtocolTCP PortConfigProtocol = "tcp" + // PortConfigProtocolUDP UDP + PortConfigProtocolUDP PortConfigProtocol = "udp" + // PortConfigProtocolSCTP SCTP + PortConfigProtocolSCTP PortConfigProtocol = "sctp" +) + +// EndpointVirtualIP represents the virtual ip of a port. +type EndpointVirtualIP struct { + NetworkID string `json:",omitempty"` + Addr string `json:",omitempty"` +} + +// Network represents a network. +type Network struct { + ID string + Meta + Spec NetworkSpec `json:",omitempty"` + DriverState Driver `json:",omitempty"` + IPAMOptions *IPAMOptions `json:",omitempty"` +} + +// NetworkSpec represents the spec of a network. +type NetworkSpec struct { + Annotations + DriverConfiguration *Driver `json:",omitempty"` + IPv6Enabled bool `json:",omitempty"` + Internal bool `json:",omitempty"` + Attachable bool `json:",omitempty"` + Ingress bool `json:",omitempty"` + IPAMOptions *IPAMOptions `json:",omitempty"` + ConfigFrom *network.ConfigReference `json:",omitempty"` + Scope string `json:",omitempty"` +} + +// NetworkAttachmentConfig represents the configuration of a network attachment. +type NetworkAttachmentConfig struct { + Target string `json:",omitempty"` + Aliases []string `json:",omitempty"` + DriverOpts map[string]string `json:",omitempty"` +} + +// NetworkAttachment represents a network attachment. +type NetworkAttachment struct { + Network Network `json:",omitempty"` + Addresses []string `json:",omitempty"` +} + +// IPAMOptions represents ipam options. +type IPAMOptions struct { + Driver Driver `json:",omitempty"` + Configs []IPAMConfig `json:",omitempty"` +} + +// IPAMConfig represents ipam configuration. +type IPAMConfig struct { + Subnet string `json:",omitempty"` + Range string `json:",omitempty"` + Gateway string `json:",omitempty"` +} diff --git a/vendor/github.com/moby/moby/api/types/swarm/node.go b/vendor/github.com/moby/moby/api/types/swarm/node.go new file mode 100644 index 0000000000..f0638f13cb --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/swarm/node.go @@ -0,0 +1,151 @@ +package swarm + +import "github.com/moby/moby/api/types/filters" + +// Node represents a node. +type Node struct { + ID string + Meta + // Spec defines the desired state of the node as specified by the user. + // The system will honor this and will *never* modify it. + Spec NodeSpec `json:",omitempty"` + // Description encapsulates the properties of the Node as reported by the + // agent. + Description NodeDescription `json:",omitempty"` + // Status provides the current status of the node, as seen by the manager. + Status NodeStatus `json:",omitempty"` + // ManagerStatus provides the current status of the node's manager + // component, if the node is a manager. + ManagerStatus *ManagerStatus `json:",omitempty"` +} + +// NodeSpec represents the spec of a node. +type NodeSpec struct { + Annotations + Role NodeRole `json:",omitempty"` + Availability NodeAvailability `json:",omitempty"` +} + +// NodeRole represents the role of a node. +type NodeRole string + +const ( + // NodeRoleWorker WORKER + NodeRoleWorker NodeRole = "worker" + // NodeRoleManager MANAGER + NodeRoleManager NodeRole = "manager" +) + +// NodeAvailability represents the availability of a node. +type NodeAvailability string + +const ( + // NodeAvailabilityActive ACTIVE + NodeAvailabilityActive NodeAvailability = "active" + // NodeAvailabilityPause PAUSE + NodeAvailabilityPause NodeAvailability = "pause" + // NodeAvailabilityDrain DRAIN + NodeAvailabilityDrain NodeAvailability = "drain" +) + +// NodeDescription represents the description of a node. +type NodeDescription struct { + Hostname string `json:",omitempty"` + Platform Platform `json:",omitempty"` + Resources Resources `json:",omitempty"` + Engine EngineDescription `json:",omitempty"` + TLSInfo TLSInfo `json:",omitempty"` + CSIInfo []NodeCSIInfo `json:",omitempty"` +} + +// Platform represents the platform (Arch/OS). +type Platform struct { + Architecture string `json:",omitempty"` + OS string `json:",omitempty"` +} + +// EngineDescription represents the description of an engine. +type EngineDescription struct { + EngineVersion string `json:",omitempty"` + Labels map[string]string `json:",omitempty"` + Plugins []PluginDescription `json:",omitempty"` +} + +// NodeCSIInfo represents information about a CSI plugin available on the node +type NodeCSIInfo struct { + // PluginName is the name of the CSI plugin. + PluginName string `json:",omitempty"` + // NodeID is the ID of the node as reported by the CSI plugin. This is + // different from the swarm node ID. + NodeID string `json:",omitempty"` + // MaxVolumesPerNode is the maximum number of volumes that may be published + // to this node + MaxVolumesPerNode int64 `json:",omitempty"` + // AccessibleTopology indicates the location of this node in the CSI + // plugin's topology + AccessibleTopology *Topology `json:",omitempty"` +} + +// PluginDescription represents the description of an engine plugin. +type PluginDescription struct { + Type string `json:",omitempty"` + Name string `json:",omitempty"` +} + +// NodeStatus represents the status of a node. +type NodeStatus struct { + State NodeState `json:",omitempty"` + Message string `json:",omitempty"` + Addr string `json:",omitempty"` +} + +// Reachability represents the reachability of a node. +type Reachability string + +const ( + // ReachabilityUnknown UNKNOWN + ReachabilityUnknown Reachability = "unknown" + // ReachabilityUnreachable UNREACHABLE + ReachabilityUnreachable Reachability = "unreachable" + // ReachabilityReachable REACHABLE + ReachabilityReachable Reachability = "reachable" +) + +// ManagerStatus represents the status of a manager. +type ManagerStatus struct { + Leader bool `json:",omitempty"` + Reachability Reachability `json:",omitempty"` + Addr string `json:",omitempty"` +} + +// NodeState represents the state of a node. +type NodeState string + +const ( + // NodeStateUnknown UNKNOWN + NodeStateUnknown NodeState = "unknown" + // NodeStateDown DOWN + NodeStateDown NodeState = "down" + // NodeStateReady READY + NodeStateReady NodeState = "ready" + // NodeStateDisconnected DISCONNECTED + NodeStateDisconnected NodeState = "disconnected" +) + +// Topology defines the CSI topology of this node. This type is a duplicate of +// github.com/docker/docker/api/types.Topology. Because the type definition +// is so simple and to avoid complicated structure or circular imports, we just +// duplicate it here. See that type for full documentation +type Topology struct { + Segments map[string]string `json:",omitempty"` +} + +// NodeListOptions holds parameters to list nodes with. +type NodeListOptions struct { + Filters filters.Args +} + +// NodeRemoveOptions holds parameters to remove nodes with. +type NodeRemoveOptions struct { + Force bool +} diff --git a/vendor/github.com/moby/moby/api/types/swarm/runtime.go b/vendor/github.com/moby/moby/api/types/swarm/runtime.go new file mode 100644 index 0000000000..8a28320f7b --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/swarm/runtime.go @@ -0,0 +1,27 @@ +package swarm + +// RuntimeType is the type of runtime used for the TaskSpec +type RuntimeType string + +// RuntimeURL is the proto type url +type RuntimeURL string + +const ( + // RuntimeContainer is the container based runtime + RuntimeContainer RuntimeType = "container" + // RuntimePlugin is the plugin based runtime + RuntimePlugin RuntimeType = "plugin" + // RuntimeNetworkAttachment is the network attachment runtime + RuntimeNetworkAttachment RuntimeType = "attachment" + + // RuntimeURLContainer is the proto url for the container type + RuntimeURLContainer RuntimeURL = "types.docker.com/RuntimeContainer" + // RuntimeURLPlugin is the proto url for the plugin type + RuntimeURLPlugin RuntimeURL = "types.docker.com/RuntimePlugin" +) + +// NetworkAttachmentSpec represents the runtime spec type for network +// attachment tasks +type NetworkAttachmentSpec struct { + ContainerID string +} diff --git a/vendor/github.com/moby/moby/api/types/swarm/runtime/gen.go b/vendor/github.com/moby/moby/api/types/swarm/runtime/gen.go new file mode 100644 index 0000000000..90e572cf9c --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/swarm/runtime/gen.go @@ -0,0 +1,3 @@ +//go:generate protoc --gogofaster_out=import_path=github.com/docker/docker/api/types/swarm/runtime:. plugin.proto + +package runtime diff --git a/vendor/github.com/moby/moby/api/types/swarm/runtime/plugin.pb.go b/vendor/github.com/moby/moby/api/types/swarm/runtime/plugin.pb.go new file mode 100644 index 0000000000..32aaf0d519 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/swarm/runtime/plugin.pb.go @@ -0,0 +1,808 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: plugin.proto + +package runtime + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// PluginSpec defines the base payload which clients can specify for creating +// a service with the plugin runtime. +type PluginSpec struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Remote string `protobuf:"bytes,2,opt,name=remote,proto3" json:"remote,omitempty"` + Privileges []*PluginPrivilege `protobuf:"bytes,3,rep,name=privileges,proto3" json:"privileges,omitempty"` + Disabled bool `protobuf:"varint,4,opt,name=disabled,proto3" json:"disabled,omitempty"` + Env []string `protobuf:"bytes,5,rep,name=env,proto3" json:"env,omitempty"` +} + +func (m *PluginSpec) Reset() { *m = PluginSpec{} } +func (m *PluginSpec) String() string { return proto.CompactTextString(m) } +func (*PluginSpec) ProtoMessage() {} +func (*PluginSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_22a625af4bc1cc87, []int{0} +} +func (m *PluginSpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PluginSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PluginSpec.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PluginSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_PluginSpec.Merge(m, src) +} +func (m *PluginSpec) XXX_Size() int { + return m.Size() +} +func (m *PluginSpec) XXX_DiscardUnknown() { + xxx_messageInfo_PluginSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_PluginSpec proto.InternalMessageInfo + +func (m *PluginSpec) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *PluginSpec) GetRemote() string { + if m != nil { + return m.Remote + } + return "" +} + +func (m *PluginSpec) GetPrivileges() []*PluginPrivilege { + if m != nil { + return m.Privileges + } + return nil +} + +func (m *PluginSpec) GetDisabled() bool { + if m != nil { + return m.Disabled + } + return false +} + +func (m *PluginSpec) GetEnv() []string { + if m != nil { + return m.Env + } + return nil +} + +// PluginPrivilege describes a permission the user has to accept +// upon installing a plugin. +type PluginPrivilege struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Value []string `protobuf:"bytes,3,rep,name=value,proto3" json:"value,omitempty"` +} + +func (m *PluginPrivilege) Reset() { *m = PluginPrivilege{} } +func (m *PluginPrivilege) String() string { return proto.CompactTextString(m) } +func (*PluginPrivilege) ProtoMessage() {} +func (*PluginPrivilege) Descriptor() ([]byte, []int) { + return fileDescriptor_22a625af4bc1cc87, []int{1} +} +func (m *PluginPrivilege) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PluginPrivilege) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PluginPrivilege.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PluginPrivilege) XXX_Merge(src proto.Message) { + xxx_messageInfo_PluginPrivilege.Merge(m, src) +} +func (m *PluginPrivilege) XXX_Size() int { + return m.Size() +} +func (m *PluginPrivilege) XXX_DiscardUnknown() { + xxx_messageInfo_PluginPrivilege.DiscardUnknown(m) +} + +var xxx_messageInfo_PluginPrivilege proto.InternalMessageInfo + +func (m *PluginPrivilege) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *PluginPrivilege) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *PluginPrivilege) GetValue() []string { + if m != nil { + return m.Value + } + return nil +} + +func init() { + proto.RegisterType((*PluginSpec)(nil), "PluginSpec") + proto.RegisterType((*PluginPrivilege)(nil), "PluginPrivilege") +} + +func init() { proto.RegisterFile("plugin.proto", fileDescriptor_22a625af4bc1cc87) } + +var fileDescriptor_22a625af4bc1cc87 = []byte{ + // 225 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0xc8, 0x29, 0x4d, + 0xcf, 0xcc, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x57, 0x9a, 0xc1, 0xc8, 0xc5, 0x15, 0x00, 0x16, + 0x08, 0x2e, 0x48, 0x4d, 0x16, 0x12, 0xe2, 0x62, 0xc9, 0x4b, 0xcc, 0x4d, 0x95, 0x60, 0x54, 0x60, + 0xd4, 0xe0, 0x0c, 0x02, 0xb3, 0x85, 0xc4, 0xb8, 0xd8, 0x8a, 0x52, 0x73, 0xf3, 0x4b, 0x52, 0x25, + 0x98, 0xc0, 0xa2, 0x50, 0x9e, 0x90, 0x01, 0x17, 0x57, 0x41, 0x51, 0x66, 0x59, 0x66, 0x4e, 0x6a, + 0x7a, 0x6a, 0xb1, 0x04, 0xb3, 0x02, 0xb3, 0x06, 0xb7, 0x91, 0x80, 0x1e, 0xc4, 0xb0, 0x00, 0x98, + 0x44, 0x10, 0x92, 0x1a, 0x21, 0x29, 0x2e, 0x8e, 0x94, 0xcc, 0xe2, 0xc4, 0xa4, 0x9c, 0xd4, 0x14, + 0x09, 0x16, 0x05, 0x46, 0x0d, 0x8e, 0x20, 0x38, 0x5f, 0x48, 0x80, 0x8b, 0x39, 0x35, 0xaf, 0x4c, + 0x82, 0x55, 0x81, 0x59, 0x83, 0x33, 0x08, 0xc4, 0x54, 0x8a, 0xe5, 0xe2, 0x47, 0x33, 0x0c, 0xab, + 0xf3, 0x14, 0xb8, 0xb8, 0x53, 0x52, 0x8b, 0x93, 0x8b, 0x32, 0x0b, 0x4a, 0x32, 0xf3, 0xf3, 0xa0, + 0x6e, 0x44, 0x16, 0x12, 0x12, 0xe1, 0x62, 0x2d, 0x4b, 0xcc, 0x29, 0x4d, 0x05, 0xbb, 0x91, 0x33, + 0x08, 0xc2, 0x71, 0x92, 0x38, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, + 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x24, 0x36, + 0x70, 0xd0, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x37, 0xea, 0xe2, 0xca, 0x2a, 0x01, 0x00, + 0x00, +} + +func (m *PluginSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PluginSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PluginSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Env) > 0 { + for iNdEx := len(m.Env) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Env[iNdEx]) + copy(dAtA[i:], m.Env[iNdEx]) + i = encodeVarintPlugin(dAtA, i, uint64(len(m.Env[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if m.Disabled { + i-- + if m.Disabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if len(m.Privileges) > 0 { + for iNdEx := len(m.Privileges) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Privileges[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPlugin(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Remote) > 0 { + i -= len(m.Remote) + copy(dAtA[i:], m.Remote) + i = encodeVarintPlugin(dAtA, i, uint64(len(m.Remote))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintPlugin(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PluginPrivilege) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PluginPrivilege) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PluginPrivilege) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + for iNdEx := len(m.Value) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Value[iNdEx]) + copy(dAtA[i:], m.Value[iNdEx]) + i = encodeVarintPlugin(dAtA, i, uint64(len(m.Value[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintPlugin(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintPlugin(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintPlugin(dAtA []byte, offset int, v uint64) int { + offset -= sovPlugin(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PluginSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovPlugin(uint64(l)) + } + l = len(m.Remote) + if l > 0 { + n += 1 + l + sovPlugin(uint64(l)) + } + if len(m.Privileges) > 0 { + for _, e := range m.Privileges { + l = e.Size() + n += 1 + l + sovPlugin(uint64(l)) + } + } + if m.Disabled { + n += 2 + } + if len(m.Env) > 0 { + for _, s := range m.Env { + l = len(s) + n += 1 + l + sovPlugin(uint64(l)) + } + } + return n +} + +func (m *PluginPrivilege) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovPlugin(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovPlugin(uint64(l)) + } + if len(m.Value) > 0 { + for _, s := range m.Value { + l = len(s) + n += 1 + l + sovPlugin(uint64(l)) + } + } + return n +} + +func sovPlugin(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozPlugin(x uint64) (n int) { + return sovPlugin(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *PluginSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlugin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PluginSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PluginSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlugin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPlugin + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPlugin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Remote", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlugin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPlugin + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPlugin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Remote = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Privileges", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlugin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPlugin + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPlugin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Privileges = append(m.Privileges, &PluginPrivilege{}) + if err := m.Privileges[len(m.Privileges)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Disabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlugin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Disabled = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Env", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlugin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPlugin + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPlugin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Env = append(m.Env, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPlugin(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPlugin + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PluginPrivilege) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlugin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PluginPrivilege: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PluginPrivilege: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlugin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPlugin + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPlugin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlugin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPlugin + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPlugin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlugin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPlugin + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPlugin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPlugin(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPlugin + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipPlugin(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPlugin + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPlugin + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPlugin + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthPlugin + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupPlugin + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthPlugin + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthPlugin = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPlugin = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupPlugin = fmt.Errorf("proto: unexpected end of group") +) diff --git a/vendor/github.com/moby/moby/api/types/swarm/runtime/plugin.proto b/vendor/github.com/moby/moby/api/types/swarm/runtime/plugin.proto new file mode 100644 index 0000000000..e311b36ba2 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/swarm/runtime/plugin.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +// PluginSpec defines the base payload which clients can specify for creating +// a service with the plugin runtime. +message PluginSpec { + string name = 1; + string remote = 2; + repeated PluginPrivilege privileges = 3; + bool disabled = 4; + repeated string env = 5; +} + +// PluginPrivilege describes a permission the user has to accept +// upon installing a plugin. +message PluginPrivilege { + string name = 1; + string description = 2; + repeated string value = 3; +} diff --git a/vendor/github.com/moby/moby/api/types/swarm/secret.go b/vendor/github.com/moby/moby/api/types/swarm/secret.go new file mode 100644 index 0000000000..3cf1cdba51 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/swarm/secret.go @@ -0,0 +1,66 @@ +package swarm + +import ( + "os" + + "github.com/moby/moby/api/types/filters" +) + +// Secret represents a secret. +type Secret struct { + ID string + Meta + Spec SecretSpec +} + +// SecretSpec represents a secret specification from a secret in swarm +type SecretSpec struct { + Annotations + + // Data is the data to store as a secret. It must be empty if a + // [Driver] is used, in which case the data is loaded from an external + // secret store. The maximum allowed size is 500KB, as defined in + // [MaxSecretSize]. + // + // This field is only used to create the secret, and is not returned + // by other endpoints. + // + // [MaxSecretSize]: https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize + Data []byte `json:",omitempty"` + + // Driver is the name of the secrets driver used to fetch the secret's + // value from an external secret store. If not set, the default built-in + // store is used. + Driver *Driver `json:",omitempty"` + + // Templating controls whether and how to evaluate the secret payload as + // a template. If it is not set, no templating is used. + Templating *Driver `json:",omitempty"` +} + +// SecretReferenceFileTarget is a file target in a secret reference +type SecretReferenceFileTarget struct { + Name string + UID string + GID string + Mode os.FileMode +} + +// SecretReference is a reference to a secret in swarm +type SecretReference struct { + File *SecretReferenceFileTarget + SecretID string + SecretName string +} + +// SecretCreateResponse contains the information returned to a client +// on the creation of a new secret. +type SecretCreateResponse struct { + // ID is the id of the created secret. + ID string +} + +// SecretListOptions holds parameters to list secrets +type SecretListOptions struct { + Filters filters.Args +} diff --git a/vendor/github.com/moby/moby/api/types/swarm/service.go b/vendor/github.com/moby/moby/api/types/swarm/service.go new file mode 100644 index 0000000000..58749aa355 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/swarm/service.go @@ -0,0 +1,272 @@ +package swarm + +import ( + "time" + + "github.com/moby/moby/api/types/filters" +) + +// Service represents a service. +type Service struct { + ID string + Meta + Spec ServiceSpec `json:",omitempty"` + PreviousSpec *ServiceSpec `json:",omitempty"` + Endpoint Endpoint `json:",omitempty"` + UpdateStatus *UpdateStatus `json:",omitempty"` + + // ServiceStatus is an optional, extra field indicating the number of + // desired and running tasks. It is provided primarily as a shortcut to + // calculating these values client-side, which otherwise would require + // listing all tasks for a service, an operation that could be + // computation and network expensive. + ServiceStatus *ServiceStatus `json:",omitempty"` + + // JobStatus is the status of a Service which is in one of ReplicatedJob or + // GlobalJob modes. It is absent on Replicated and Global services. + JobStatus *JobStatus `json:",omitempty"` +} + +// ServiceSpec represents the spec of a service. +type ServiceSpec struct { + Annotations + + // TaskTemplate defines how the service should construct new tasks when + // orchestrating this service. + TaskTemplate TaskSpec `json:",omitempty"` + Mode ServiceMode `json:",omitempty"` + UpdateConfig *UpdateConfig `json:",omitempty"` + RollbackConfig *UpdateConfig `json:",omitempty"` + + // Networks specifies which networks the service should attach to. + // + // Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. + Networks []NetworkAttachmentConfig `json:",omitempty"` + EndpointSpec *EndpointSpec `json:",omitempty"` +} + +// ServiceMode represents the mode of a service. +type ServiceMode struct { + Replicated *ReplicatedService `json:",omitempty"` + Global *GlobalService `json:",omitempty"` + ReplicatedJob *ReplicatedJob `json:",omitempty"` + GlobalJob *GlobalJob `json:",omitempty"` +} + +// UpdateState is the state of a service update. +type UpdateState string + +const ( + // UpdateStateUpdating is the updating state. + UpdateStateUpdating UpdateState = "updating" + // UpdateStatePaused is the paused state. + UpdateStatePaused UpdateState = "paused" + // UpdateStateCompleted is the completed state. + UpdateStateCompleted UpdateState = "completed" + // UpdateStateRollbackStarted is the state with a rollback in progress. + UpdateStateRollbackStarted UpdateState = "rollback_started" + // UpdateStateRollbackPaused is the state with a rollback in progress. + UpdateStateRollbackPaused UpdateState = "rollback_paused" + // UpdateStateRollbackCompleted is the state with a rollback in progress. + UpdateStateRollbackCompleted UpdateState = "rollback_completed" +) + +// UpdateStatus reports the status of a service update. +type UpdateStatus struct { + State UpdateState `json:",omitempty"` + StartedAt *time.Time `json:",omitempty"` + CompletedAt *time.Time `json:",omitempty"` + Message string `json:",omitempty"` +} + +// ReplicatedService is a kind of ServiceMode. +type ReplicatedService struct { + Replicas *uint64 `json:",omitempty"` +} + +// GlobalService is a kind of ServiceMode. +type GlobalService struct{} + +// ReplicatedJob is the a type of Service which executes a defined Tasks +// in parallel until the specified number of Tasks have succeeded. +type ReplicatedJob struct { + // MaxConcurrent indicates the maximum number of Tasks that should be + // executing simultaneously for this job at any given time. There may be + // fewer Tasks that MaxConcurrent executing simultaneously; for example, if + // there are fewer than MaxConcurrent tasks needed to reach + // TotalCompletions. + // + // If this field is empty, it will default to a max concurrency of 1. + MaxConcurrent *uint64 `json:",omitempty"` + + // TotalCompletions is the total number of Tasks desired to run to + // completion. + // + // If this field is empty, the value of MaxConcurrent will be used. + TotalCompletions *uint64 `json:",omitempty"` +} + +// GlobalJob is the type of a Service which executes a Task on every Node +// matching the Service's placement constraints. These tasks run to completion +// and then exit. +// +// This type is deliberately empty. +type GlobalJob struct{} + +const ( + // UpdateFailureActionPause PAUSE + UpdateFailureActionPause = "pause" + // UpdateFailureActionContinue CONTINUE + UpdateFailureActionContinue = "continue" + // UpdateFailureActionRollback ROLLBACK + UpdateFailureActionRollback = "rollback" + + // UpdateOrderStopFirst STOP_FIRST + UpdateOrderStopFirst = "stop-first" + // UpdateOrderStartFirst START_FIRST + UpdateOrderStartFirst = "start-first" +) + +// UpdateConfig represents the update configuration. +type UpdateConfig struct { + // Maximum number of tasks to be updated in one iteration. + // 0 means unlimited parallelism. + Parallelism uint64 + + // Amount of time between updates. + Delay time.Duration `json:",omitempty"` + + // FailureAction is the action to take when an update failures. + FailureAction string `json:",omitempty"` + + // Monitor indicates how long to monitor a task for failure after it is + // created. If the task fails by ending up in one of the states + // REJECTED, COMPLETED, or FAILED, within Monitor from its creation, + // this counts as a failure. If it fails after Monitor, it does not + // count as a failure. If Monitor is unspecified, a default value will + // be used. + Monitor time.Duration `json:",omitempty"` + + // MaxFailureRatio is the fraction of tasks that may fail during + // an update before the failure action is invoked. Any task created by + // the current update which ends up in one of the states REJECTED, + // COMPLETED or FAILED within Monitor from its creation counts as a + // failure. The number of failures is divided by the number of tasks + // being updated, and if this fraction is greater than + // MaxFailureRatio, the failure action is invoked. + // + // If the failure action is CONTINUE, there is no effect. + // If the failure action is PAUSE, no more tasks will be updated until + // another update is started. + MaxFailureRatio float32 + + // Order indicates the order of operations when rolling out an updated + // task. Either the old task is shut down before the new task is + // started, or the new task is started before the old task is shut down. + Order string +} + +// ServiceStatus represents the number of running tasks in a service and the +// number of tasks desired to be running. +type ServiceStatus struct { + // RunningTasks is the number of tasks for the service actually in the + // Running state + RunningTasks uint64 + + // DesiredTasks is the number of tasks desired to be running by the + // service. For replicated services, this is the replica count. For global + // services, this is computed by taking the number of tasks with desired + // state of not-Shutdown. + DesiredTasks uint64 + + // CompletedTasks is the number of tasks in the state Completed, if this + // service is in ReplicatedJob or GlobalJob mode. This field must be + // cross-referenced with the service type, because the default value of 0 + // may mean that a service is not in a job mode, or it may mean that the + // job has yet to complete any tasks. + CompletedTasks uint64 +} + +// JobStatus is the status of a job-type service. +type JobStatus struct { + // JobIteration is a value increased each time a Job is executed, + // successfully or otherwise. "Executed", in this case, means the job as a + // whole has been started, not that an individual Task has been launched. A + // job is "Executed" when its ServiceSpec is updated. JobIteration can be + // used to disambiguate Tasks belonging to different executions of a job. + // + // Though JobIteration will increase with each subsequent execution, it may + // not necessarily increase by 1, and so JobIteration should not be used to + // keep track of the number of times a job has been executed. + JobIteration Version + + // LastExecution is the time that the job was last executed, as observed by + // Swarm manager. + LastExecution time.Time `json:",omitempty"` +} + +// ServiceCreateOptions contains the options to use when creating a service. +type ServiceCreateOptions struct { + // EncodedRegistryAuth is the encoded registry authorization credentials to + // use when updating the service. + // + // This field follows the format of the X-Registry-Auth header. + EncodedRegistryAuth string + + // QueryRegistry indicates whether the service update requires + // contacting a registry. A registry may be contacted to retrieve + // the image digest and manifest, which in turn can be used to update + // platform or other information about the service. + QueryRegistry bool +} + +// Values for RegistryAuthFrom in ServiceUpdateOptions +const ( + RegistryAuthFromSpec = "spec" + RegistryAuthFromPreviousSpec = "previous-spec" +) + +// ServiceUpdateOptions contains the options to be used for updating services. +type ServiceUpdateOptions struct { + // EncodedRegistryAuth is the encoded registry authorization credentials to + // use when updating the service. + // + // This field follows the format of the X-Registry-Auth header. + EncodedRegistryAuth string + + // TODO(stevvooe): Consider moving the version parameter of ServiceUpdate + // into this field. While it does open API users up to racy writes, most + // users may not need that level of consistency in practice. + + // RegistryAuthFrom specifies where to find the registry authorization + // credentials if they are not given in EncodedRegistryAuth. Valid + // values are "spec" and "previous-spec". + RegistryAuthFrom string + + // Rollback indicates whether a server-side rollback should be + // performed. When this is set, the provided spec will be ignored. + // The valid values are "previous" and "none". An empty value is the + // same as "none". + Rollback string + + // QueryRegistry indicates whether the service update requires + // contacting a registry. A registry may be contacted to retrieve + // the image digest and manifest, which in turn can be used to update + // platform or other information about the service. + QueryRegistry bool +} + +// ServiceListOptions holds parameters to list services with. +type ServiceListOptions struct { + Filters filters.Args + + // Status indicates whether the server should include the service task + // count of running and desired tasks. + Status bool +} + +// ServiceInspectOptions holds parameters related to the "service inspect" +// operation. +type ServiceInspectOptions struct { + InsertDefaults bool +} diff --git a/vendor/github.com/moby/moby/api/types/swarm/service_create_response.go b/vendor/github.com/moby/moby/api/types/swarm/service_create_response.go new file mode 100644 index 0000000000..9a268ff1b9 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/swarm/service_create_response.go @@ -0,0 +1,20 @@ +package swarm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// ServiceCreateResponse contains the information returned to a client on the +// creation of a new service. +// +// swagger:model ServiceCreateResponse +type ServiceCreateResponse struct { + + // The ID of the created service. + ID string `json:"ID,omitempty"` + + // Optional warning message. + // + // FIXME(thaJeztah): this should have "omitempty" in the generated type. + // + Warnings []string `json:"Warnings"` +} diff --git a/vendor/github.com/moby/moby/api/types/swarm/service_update_response.go b/vendor/github.com/moby/moby/api/types/swarm/service_update_response.go new file mode 100644 index 0000000000..0417467dae --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/swarm/service_update_response.go @@ -0,0 +1,12 @@ +package swarm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// ServiceUpdateResponse service update response +// swagger:model ServiceUpdateResponse +type ServiceUpdateResponse struct { + + // Optional warning messages + Warnings []string `json:"Warnings"` +} diff --git a/vendor/github.com/moby/moby/api/types/swarm/swarm.go b/vendor/github.com/moby/moby/api/types/swarm/swarm.go new file mode 100644 index 0000000000..38f3e6666d --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/swarm/swarm.go @@ -0,0 +1,244 @@ +package swarm + +import ( + "time" +) + +// ClusterInfo represents info about the cluster for outputting in "info" +// it contains the same information as "Swarm", but without the JoinTokens +type ClusterInfo struct { + ID string + Meta + Spec Spec + TLSInfo TLSInfo + RootRotationInProgress bool + DefaultAddrPool []string + SubnetSize uint32 + DataPathPort uint32 +} + +// Swarm represents a swarm. +type Swarm struct { + ClusterInfo + JoinTokens JoinTokens +} + +// JoinTokens contains the tokens workers and managers need to join the swarm. +type JoinTokens struct { + // Worker is the join token workers may use to join the swarm. + Worker string + // Manager is the join token managers may use to join the swarm. + Manager string +} + +// Spec represents the spec of a swarm. +type Spec struct { + Annotations + + Orchestration OrchestrationConfig `json:",omitempty"` + Raft RaftConfig `json:",omitempty"` + Dispatcher DispatcherConfig `json:",omitempty"` + CAConfig CAConfig `json:",omitempty"` + TaskDefaults TaskDefaults `json:",omitempty"` + EncryptionConfig EncryptionConfig `json:",omitempty"` +} + +// OrchestrationConfig represents orchestration configuration. +type OrchestrationConfig struct { + // TaskHistoryRetentionLimit is the number of historic tasks to keep per instance or + // node. If negative, never remove completed or failed tasks. + TaskHistoryRetentionLimit *int64 `json:",omitempty"` +} + +// TaskDefaults parameterizes cluster-level task creation with default values. +type TaskDefaults struct { + // LogDriver selects the log driver to use for tasks created in the + // orchestrator if unspecified by a service. + // + // Updating this value will only have an affect on new tasks. Old tasks + // will continue use their previously configured log driver until + // recreated. + LogDriver *Driver `json:",omitempty"` +} + +// EncryptionConfig controls at-rest encryption of data and keys. +type EncryptionConfig struct { + // AutoLockManagers specifies whether or not managers TLS keys and raft data + // should be encrypted at rest in such a way that they must be unlocked + // before the manager node starts up again. + AutoLockManagers bool +} + +// RaftConfig represents raft configuration. +type RaftConfig struct { + // SnapshotInterval is the number of log entries between snapshots. + SnapshotInterval uint64 `json:",omitempty"` + + // KeepOldSnapshots is the number of snapshots to keep beyond the + // current snapshot. + KeepOldSnapshots *uint64 `json:",omitempty"` + + // LogEntriesForSlowFollowers is the number of log entries to keep + // around to sync up slow followers after a snapshot is created. + LogEntriesForSlowFollowers uint64 `json:",omitempty"` + + // ElectionTick is the number of ticks that a follower will wait for a message + // from the leader before becoming a candidate and starting an election. + // ElectionTick must be greater than HeartbeatTick. + // + // A tick currently defaults to one second, so these translate directly to + // seconds currently, but this is NOT guaranteed. + ElectionTick int + + // HeartbeatTick is the number of ticks between heartbeats. Every + // HeartbeatTick ticks, the leader will send a heartbeat to the + // followers. + // + // A tick currently defaults to one second, so these translate directly to + // seconds currently, but this is NOT guaranteed. + HeartbeatTick int +} + +// DispatcherConfig represents dispatcher configuration. +type DispatcherConfig struct { + // HeartbeatPeriod defines how often agent should send heartbeats to + // dispatcher. + HeartbeatPeriod time.Duration `json:",omitempty"` +} + +// CAConfig represents CA configuration. +type CAConfig struct { + // NodeCertExpiry is the duration certificates should be issued for + NodeCertExpiry time.Duration `json:",omitempty"` + + // ExternalCAs is a list of CAs to which a manager node will make + // certificate signing requests for node certificates. + ExternalCAs []*ExternalCA `json:",omitempty"` + + // SigningCACert and SigningCAKey specify the desired signing root CA and + // root CA key for the swarm. When inspecting the cluster, the key will + // be redacted. + SigningCACert string `json:",omitempty"` + SigningCAKey string `json:",omitempty"` + + // If this value changes, and there is no specified signing cert and key, + // then the swarm is forced to generate a new root certificate and key. + ForceRotate uint64 `json:",omitempty"` +} + +// ExternalCAProtocol represents type of external CA. +type ExternalCAProtocol string + +// ExternalCAProtocolCFSSL CFSSL +const ExternalCAProtocolCFSSL ExternalCAProtocol = "cfssl" + +// ExternalCA defines external CA to be used by the cluster. +type ExternalCA struct { + // Protocol is the protocol used by this external CA. + Protocol ExternalCAProtocol + + // URL is the URL where the external CA can be reached. + URL string + + // Options is a set of additional key/value pairs whose interpretation + // depends on the specified CA type. + Options map[string]string `json:",omitempty"` + + // CACert specifies which root CA is used by this external CA. This certificate must + // be in PEM format. + CACert string +} + +// InitRequest is the request used to init a swarm. +type InitRequest struct { + ListenAddr string + AdvertiseAddr string + DataPathAddr string + DataPathPort uint32 + ForceNewCluster bool + Spec Spec + AutoLockManagers bool + Availability NodeAvailability + DefaultAddrPool []string + SubnetSize uint32 +} + +// JoinRequest is the request used to join a swarm. +type JoinRequest struct { + ListenAddr string + AdvertiseAddr string + DataPathAddr string + RemoteAddrs []string + JoinToken string // accept by secret + Availability NodeAvailability +} + +// UnlockRequest is the request used to unlock a swarm. +type UnlockRequest struct { + // UnlockKey is the unlock key in ASCII-armored format. + UnlockKey string +} + +// LocalNodeState represents the state of the local node. +type LocalNodeState string + +const ( + // LocalNodeStateInactive INACTIVE + LocalNodeStateInactive LocalNodeState = "inactive" + // LocalNodeStatePending PENDING + LocalNodeStatePending LocalNodeState = "pending" + // LocalNodeStateActive ACTIVE + LocalNodeStateActive LocalNodeState = "active" + // LocalNodeStateError ERROR + LocalNodeStateError LocalNodeState = "error" + // LocalNodeStateLocked LOCKED + LocalNodeStateLocked LocalNodeState = "locked" +) + +// Info represents generic information about swarm. +type Info struct { + NodeID string + NodeAddr string + + LocalNodeState LocalNodeState + ControlAvailable bool + Error string + + RemoteManagers []Peer + Nodes int `json:",omitempty"` + Managers int `json:",omitempty"` + + Cluster *ClusterInfo `json:",omitempty"` + + Warnings []string `json:",omitempty"` +} + +// Status provides information about the current swarm status and role, +// obtained from the "Swarm" header in the API response. +type Status struct { + // NodeState represents the state of the node. + NodeState LocalNodeState + + // ControlAvailable indicates if the node is a swarm manager. + ControlAvailable bool +} + +// Peer represents a peer. +type Peer struct { + NodeID string + Addr string +} + +// UpdateFlags contains flags for SwarmUpdate. +type UpdateFlags struct { + RotateWorkerToken bool + RotateManagerToken bool + RotateManagerUnlockKey bool +} + +// UnlockKeyResponse contains the response for Engine API: +// GET /swarm/unlockkey +type UnlockKeyResponse struct { + // UnlockKey is the unlock key in ASCII-armored format. + UnlockKey string +} diff --git a/vendor/github.com/moby/moby/api/types/swarm/task.go b/vendor/github.com/moby/moby/api/types/swarm/task.go new file mode 100644 index 0000000000..aedf010551 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/swarm/task.go @@ -0,0 +1,231 @@ +package swarm + +import ( + "time" + + "github.com/moby/moby/api/types/filters" + "github.com/moby/moby/api/types/swarm/runtime" +) + +// TaskState represents the state of a task. +type TaskState string + +const ( + // TaskStateNew NEW + TaskStateNew TaskState = "new" + // TaskStateAllocated ALLOCATED + TaskStateAllocated TaskState = "allocated" + // TaskStatePending PENDING + TaskStatePending TaskState = "pending" + // TaskStateAssigned ASSIGNED + TaskStateAssigned TaskState = "assigned" + // TaskStateAccepted ACCEPTED + TaskStateAccepted TaskState = "accepted" + // TaskStatePreparing PREPARING + TaskStatePreparing TaskState = "preparing" + // TaskStateReady READY + TaskStateReady TaskState = "ready" + // TaskStateStarting STARTING + TaskStateStarting TaskState = "starting" + // TaskStateRunning RUNNING + TaskStateRunning TaskState = "running" + // TaskStateComplete COMPLETE + TaskStateComplete TaskState = "complete" + // TaskStateShutdown SHUTDOWN + TaskStateShutdown TaskState = "shutdown" + // TaskStateFailed FAILED + TaskStateFailed TaskState = "failed" + // TaskStateRejected REJECTED + TaskStateRejected TaskState = "rejected" + // TaskStateRemove REMOVE + TaskStateRemove TaskState = "remove" + // TaskStateOrphaned ORPHANED + TaskStateOrphaned TaskState = "orphaned" +) + +// Task represents a task. +type Task struct { + ID string + Meta + Annotations + + Spec TaskSpec `json:",omitempty"` + ServiceID string `json:",omitempty"` + Slot int `json:",omitempty"` + NodeID string `json:",omitempty"` + Status TaskStatus `json:",omitempty"` + DesiredState TaskState `json:",omitempty"` + NetworksAttachments []NetworkAttachment `json:",omitempty"` + GenericResources []GenericResource `json:",omitempty"` + + // JobIteration is the JobIteration of the Service that this Task was + // spawned from, if the Service is a ReplicatedJob or GlobalJob. This is + // used to determine which Tasks belong to which run of the job. This field + // is absent if the Service mode is Replicated or Global. + JobIteration *Version `json:",omitempty"` + + // Volumes is the list of VolumeAttachments for this task. It specifies + // which particular volumes are to be used by this particular task, and + // fulfilling what mounts in the spec. + Volumes []VolumeAttachment +} + +// TaskSpec represents the spec of a task. +type TaskSpec struct { + // ContainerSpec, NetworkAttachmentSpec, and PluginSpec are mutually exclusive. + // PluginSpec is only used when the `Runtime` field is set to `plugin` + // NetworkAttachmentSpec is used if the `Runtime` field is set to + // `attachment`. + ContainerSpec *ContainerSpec `json:",omitempty"` + PluginSpec *runtime.PluginSpec `json:",omitempty"` + NetworkAttachmentSpec *NetworkAttachmentSpec `json:",omitempty"` + + Resources *ResourceRequirements `json:",omitempty"` + RestartPolicy *RestartPolicy `json:",omitempty"` + Placement *Placement `json:",omitempty"` + Networks []NetworkAttachmentConfig `json:",omitempty"` + + // LogDriver specifies the LogDriver to use for tasks created from this + // spec. If not present, the one on cluster default on swarm.Spec will be + // used, finally falling back to the engine default if not specified. + LogDriver *Driver `json:",omitempty"` + + // ForceUpdate is a counter that triggers an update even if no relevant + // parameters have been changed. + ForceUpdate uint64 + + Runtime RuntimeType `json:",omitempty"` +} + +// Resources represents resources (CPU/Memory) which can be advertised by a +// node and requested to be reserved for a task. +type Resources struct { + NanoCPUs int64 `json:",omitempty"` + MemoryBytes int64 `json:",omitempty"` + GenericResources []GenericResource `json:",omitempty"` +} + +// Limit describes limits on resources which can be requested by a task. +type Limit struct { + NanoCPUs int64 `json:",omitempty"` + MemoryBytes int64 `json:",omitempty"` + Pids int64 `json:",omitempty"` +} + +// GenericResource represents a "user defined" resource which can +// be either an integer (e.g: SSD=3) or a string (e.g: SSD=sda1) +type GenericResource struct { + NamedResourceSpec *NamedGenericResource `json:",omitempty"` + DiscreteResourceSpec *DiscreteGenericResource `json:",omitempty"` +} + +// NamedGenericResource represents a "user defined" resource which is defined +// as a string. +// "Kind" is used to describe the Kind of a resource (e.g: "GPU", "FPGA", "SSD", ...) +// Value is used to identify the resource (GPU="UUID-1", FPGA="/dev/sdb5", ...) +type NamedGenericResource struct { + Kind string `json:",omitempty"` + Value string `json:",omitempty"` +} + +// DiscreteGenericResource represents a "user defined" resource which is defined +// as an integer +// "Kind" is used to describe the Kind of a resource (e.g: "GPU", "FPGA", "SSD", ...) +// Value is used to count the resource (SSD=5, HDD=3, ...) +type DiscreteGenericResource struct { + Kind string `json:",omitempty"` + Value int64 `json:",omitempty"` +} + +// ResourceRequirements represents resources requirements. +type ResourceRequirements struct { + Limits *Limit `json:",omitempty"` + Reservations *Resources `json:",omitempty"` +} + +// Placement represents orchestration parameters. +type Placement struct { + Constraints []string `json:",omitempty"` + Preferences []PlacementPreference `json:",omitempty"` + MaxReplicas uint64 `json:",omitempty"` + + // Platforms stores all the platforms that the image can run on. + // This field is used in the platform filter for scheduling. If empty, + // then the platform filter is off, meaning there are no scheduling restrictions. + Platforms []Platform `json:",omitempty"` +} + +// PlacementPreference provides a way to make the scheduler aware of factors +// such as topology. +type PlacementPreference struct { + Spread *SpreadOver +} + +// SpreadOver is a scheduling preference that instructs the scheduler to spread +// tasks evenly over groups of nodes identified by labels. +type SpreadOver struct { + // label descriptor, such as engine.labels.az + SpreadDescriptor string +} + +// RestartPolicy represents the restart policy. +type RestartPolicy struct { + Condition RestartPolicyCondition `json:",omitempty"` + Delay *time.Duration `json:",omitempty"` + MaxAttempts *uint64 `json:",omitempty"` + Window *time.Duration `json:",omitempty"` +} + +// RestartPolicyCondition represents when to restart. +type RestartPolicyCondition string + +const ( + // RestartPolicyConditionNone NONE + RestartPolicyConditionNone RestartPolicyCondition = "none" + // RestartPolicyConditionOnFailure ON_FAILURE + RestartPolicyConditionOnFailure RestartPolicyCondition = "on-failure" + // RestartPolicyConditionAny ANY + RestartPolicyConditionAny RestartPolicyCondition = "any" +) + +// TaskStatus represents the status of a task. +type TaskStatus struct { + Timestamp time.Time `json:",omitempty"` + State TaskState `json:",omitempty"` + Message string `json:",omitempty"` + Err string `json:",omitempty"` + ContainerStatus *ContainerStatus `json:",omitempty"` + PortStatus PortStatus `json:",omitempty"` +} + +// ContainerStatus represents the status of a container. +type ContainerStatus struct { + ContainerID string + PID int + ExitCode int +} + +// PortStatus represents the port status of a task's host ports whose +// service has published host ports +type PortStatus struct { + Ports []PortConfig `json:",omitempty"` +} + +// VolumeAttachment contains the associating a Volume to a Task. +type VolumeAttachment struct { + // ID is the Swarmkit ID of the Volume. This is not the CSI VolumeId. + ID string `json:",omitempty"` + + // Source, together with Target, indicates the Mount, as specified in the + // ContainerSpec, that this volume fulfills. + Source string `json:",omitempty"` + + // Target, together with Source, indicates the Mount, as specified + // in the ContainerSpec, that this volume fulfills. + Target string `json:",omitempty"` +} + +// TaskListOptions holds parameters to list tasks with. +type TaskListOptions struct { + Filters filters.Args +} diff --git a/vendor/github.com/moby/moby/api/types/system/disk_usage.go b/vendor/github.com/moby/moby/api/types/system/disk_usage.go new file mode 100644 index 0000000000..333a7c7fc4 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/system/disk_usage.go @@ -0,0 +1,17 @@ +package system + +import ( + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/volume" +) + +// DiskUsage contains response of Engine API for API 1.49 and greater: +// GET "/system/df" +type DiskUsage struct { + Images *image.DiskUsage + Containers *container.DiskUsage + Volumes *volume.DiskUsage + BuildCache *build.CacheDiskUsage +} diff --git a/vendor/github.com/moby/moby/api/types/system/info.go b/vendor/github.com/moby/moby/api/types/system/info.go new file mode 100644 index 0000000000..e9a4aa7c7f --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/system/info.go @@ -0,0 +1,170 @@ +package system + +import ( + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/registry" + "github.com/moby/moby/api/types/swarm" +) + +// Info contains response of Engine API: +// GET "/info" +type Info struct { + ID string + Containers int + ContainersRunning int + ContainersPaused int + ContainersStopped int + Images int + Driver string + DriverStatus [][2]string + SystemStatus [][2]string `json:",omitempty"` // SystemStatus is only propagated by the Swarm standalone API + Plugins PluginsInfo + MemoryLimit bool + SwapLimit bool + KernelMemory bool `json:",omitempty"` // Deprecated: kernel 5.4 deprecated kmem.limit_in_bytes + KernelMemoryTCP bool `json:",omitempty"` // KernelMemoryTCP is not supported on cgroups v2. + CPUCfsPeriod bool `json:"CpuCfsPeriod"` + CPUCfsQuota bool `json:"CpuCfsQuota"` + CPUShares bool + CPUSet bool + PidsLimit bool + IPv4Forwarding bool + Debug bool + NFd int + OomKillDisable bool + NGoroutines int + SystemTime string + LoggingDriver string + CgroupDriver string + CgroupVersion string `json:",omitempty"` + NEventsListener int + KernelVersion string + OperatingSystem string + OSVersion string + OSType string + Architecture string + IndexServerAddress string + RegistryConfig *registry.ServiceConfig + NCPU int + MemTotal int64 + GenericResources []swarm.GenericResource + DockerRootDir string + HTTPProxy string `json:"HttpProxy"` + HTTPSProxy string `json:"HttpsProxy"` + NoProxy string + Name string + Labels []string + ExperimentalBuild bool + ServerVersion string + Runtimes map[string]RuntimeWithStatus + DefaultRuntime string + Swarm swarm.Info + // LiveRestoreEnabled determines whether containers should be kept + // running when the daemon is shutdown or upon daemon start if + // running containers are detected + LiveRestoreEnabled bool + Isolation container.Isolation + InitBinary string + ContainerdCommit Commit + RuncCommit Commit + InitCommit Commit + SecurityOptions []string + ProductLicense string `json:",omitempty"` + DefaultAddressPools []NetworkAddressPool `json:",omitempty"` + FirewallBackend *FirewallInfo `json:"FirewallBackend,omitempty"` + CDISpecDirs []string + DiscoveredDevices []DeviceInfo `json:",omitempty"` + + Containerd *ContainerdInfo `json:",omitempty"` + + // Warnings contains a slice of warnings that occurred while collecting + // system information. These warnings are intended to be informational + // messages for the user, and are not intended to be parsed / used for + // other purposes, as they do not have a fixed format. + Warnings []string +} + +// ContainerdInfo holds information about the containerd instance used by the daemon. +type ContainerdInfo struct { + // Address is the path to the containerd socket. + Address string `json:",omitempty"` + // Namespaces is the containerd namespaces used by the daemon. + Namespaces ContainerdNamespaces +} + +// ContainerdNamespaces reflects the containerd namespaces used by the daemon. +// +// These namespaces can be configured in the daemon configuration, and are +// considered to be used exclusively by the daemon, +// +// As these namespaces are considered to be exclusively accessed +// by the daemon, it is not recommended to change these values, +// or to change them to a value that is used by other systems, +// such as cri-containerd. +type ContainerdNamespaces struct { + // Containers holds the default containerd namespace used for + // containers managed by the daemon. + // + // The default namespace for containers is "moby", but will be + // suffixed with the `.` of the remapped `root` if + // user-namespaces are enabled and the containerd image-store + // is used. + Containers string + + // Plugins holds the default containerd namespace used for + // plugins managed by the daemon. + // + // The default namespace for plugins is "moby", but will be + // suffixed with the `.` of the remapped `root` if + // user-namespaces are enabled and the containerd image-store + // is used. + Plugins string +} + +// PluginsInfo is a temp struct holding Plugins name +// registered with docker daemon. It is used by [Info] struct +type PluginsInfo struct { + // List of Volume plugins registered + Volume []string + // List of Network plugins registered + Network []string + // List of Authorization plugins registered + Authorization []string + // List of Log plugins registered + Log []string +} + +// Commit holds the Git-commit (SHA1) that a binary was built from, as reported +// in the version-string of external tools, such as containerd, or runC. +type Commit struct { + // ID is the actual commit ID or version of external tool. + ID string + + // Expected is the commit ID of external tool expected by dockerd as set at build time. + // + // Deprecated: this field is no longer used in API v1.49, but kept for backward-compatibility with older API versions. + Expected string `json:",omitempty"` +} + +// NetworkAddressPool is a temp struct used by [Info] struct. +type NetworkAddressPool struct { + Base string + Size int +} + +// FirewallInfo describes the firewall backend. +type FirewallInfo struct { + // Driver is the name of the firewall backend driver. + Driver string `json:"Driver"` + // Info is a list of label/value pairs, containing information related to the firewall. + Info [][2]string `json:"Info,omitempty"` +} + +// DeviceInfo represents a discoverable device from a device driver. +type DeviceInfo struct { + // Source indicates the origin device driver. + Source string `json:"Source"` + // ID is the unique identifier for the device. + // Example: CDI FQDN like "vendor.com/gpu=0", or other driver-specific device ID + ID string `json:"ID"` +} diff --git a/vendor/github.com/moby/moby/api/types/system/runtime.go b/vendor/github.com/moby/moby/api/types/system/runtime.go new file mode 100644 index 0000000000..d077295a0d --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/system/runtime.go @@ -0,0 +1,20 @@ +package system + +// Runtime describes an OCI runtime +type Runtime struct { + // "Legacy" runtime configuration for runc-compatible runtimes. + + Path string `json:"path,omitempty"` + Args []string `json:"runtimeArgs,omitempty"` + + // Shimv2 runtime configuration. Mutually exclusive with the legacy config above. + + Type string `json:"runtimeType,omitempty"` + Options map[string]interface{} `json:"options,omitempty"` +} + +// RuntimeWithStatus extends [Runtime] to hold [RuntimeStatus]. +type RuntimeWithStatus struct { + Runtime + Status map[string]string `json:"status,omitempty"` +} diff --git a/vendor/github.com/moby/moby/api/types/system/security_opts.go b/vendor/github.com/moby/moby/api/types/system/security_opts.go new file mode 100644 index 0000000000..edff3eb1ac --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/system/security_opts.go @@ -0,0 +1,48 @@ +package system + +import ( + "errors" + "fmt" + "strings" +) + +// SecurityOpt contains the name and options of a security option +type SecurityOpt struct { + Name string + Options []KeyValue +} + +// DecodeSecurityOptions decodes a security options string slice to a +// type-safe [SecurityOpt]. +func DecodeSecurityOptions(opts []string) ([]SecurityOpt, error) { + so := []SecurityOpt{} + for _, opt := range opts { + // support output from a < 1.13 docker daemon + if !strings.Contains(opt, "=") { + so = append(so, SecurityOpt{Name: opt}) + continue + } + secopt := SecurityOpt{} + for _, s := range strings.Split(opt, ",") { + k, v, ok := strings.Cut(s, "=") + if !ok { + return nil, fmt.Errorf("invalid security option %q", s) + } + if k == "" || v == "" { + return nil, errors.New("invalid empty security option") + } + if k == "name" { + secopt.Name = v + continue + } + secopt.Options = append(secopt.Options, KeyValue{Key: k, Value: v}) + } + so = append(so, secopt) + } + return so, nil +} + +// KeyValue holds a key/value pair. +type KeyValue struct { + Key, Value string +} diff --git a/vendor/github.com/moby/moby/api/types/time/timestamp.go b/vendor/github.com/moby/moby/api/types/time/timestamp.go new file mode 100644 index 0000000000..0e1df38a43 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/time/timestamp.go @@ -0,0 +1,131 @@ +package time + +import ( + "fmt" + "math" + "strconv" + "strings" + "time" +) + +// These are additional predefined layouts for use in Time.Format and Time.Parse +// with --since and --until parameters for `docker logs` and `docker events` +const ( + rFC3339Local = "2006-01-02T15:04:05" // RFC3339 with local timezone + rFC3339NanoLocal = "2006-01-02T15:04:05.999999999" // RFC3339Nano with local timezone + dateWithZone = "2006-01-02Z07:00" // RFC3339 with time at 00:00:00 + dateLocal = "2006-01-02" // RFC3339 with local timezone and time at 00:00:00 +) + +// GetTimestamp tries to parse given string as golang duration, +// then RFC3339 time and finally as a Unix timestamp. If +// any of these were successful, it returns a Unix timestamp +// as string otherwise returns the given value back. +// In case of duration input, the returned timestamp is computed +// as the given reference time minus the amount of the duration. +func GetTimestamp(value string, reference time.Time) (string, error) { + if d, err := time.ParseDuration(value); value != "0" && err == nil { + return strconv.FormatInt(reference.Add(-d).Unix(), 10), nil + } + + var format string + // if the string has a Z or a + or three dashes use parse otherwise use parseinlocation + parseInLocation := !strings.ContainsAny(value, "zZ+") && strings.Count(value, "-") != 3 + + if strings.Contains(value, ".") { + if parseInLocation { + format = rFC3339NanoLocal + } else { + format = time.RFC3339Nano + } + } else if strings.Contains(value, "T") { + // we want the number of colons in the T portion of the timestamp + tcolons := strings.Count(value, ":") + // if parseInLocation is off and we have a +/- zone offset (not Z) then + // there will be an extra colon in the input for the tz offset subtract that + // colon from the tcolons count + if !parseInLocation && !strings.ContainsAny(value, "zZ") && tcolons > 0 { + tcolons-- + } + if parseInLocation { + switch tcolons { + case 0: + format = "2006-01-02T15" + case 1: + format = "2006-01-02T15:04" + default: + format = rFC3339Local + } + } else { + switch tcolons { + case 0: + format = "2006-01-02T15Z07:00" + case 1: + format = "2006-01-02T15:04Z07:00" + default: + format = time.RFC3339 + } + } + } else if parseInLocation { + format = dateLocal + } else { + format = dateWithZone + } + + var t time.Time + var err error + + if parseInLocation { + t, err = time.ParseInLocation(format, value, time.FixedZone(reference.Zone())) + } else { + t, err = time.Parse(format, value) + } + + if err != nil { + // if there is a `-` then it's an RFC3339 like timestamp + if strings.Contains(value, "-") { + return "", err // was probably an RFC3339 like timestamp but the parser failed with an error + } + if _, _, err := parseTimestamp(value); err != nil { + return "", fmt.Errorf("failed to parse value as time or duration: %q", value) + } + return value, nil // unix timestamp in and out case (meaning: the value passed at the command line is already in the right format for passing to the server) + } + + return fmt.Sprintf("%d.%09d", t.Unix(), int64(t.Nanosecond())), nil +} + +// ParseTimestamps returns seconds and nanoseconds from a timestamp that has +// the format ("%d.%09d", time.Unix(), int64(time.Nanosecond())). +// If the incoming nanosecond portion is longer than 9 digits it is truncated. +// The expectation is that the seconds and nanoseconds will be used to create a +// time variable. For example: +// +// seconds, nanoseconds, _ := ParseTimestamp("1136073600.000000001",0) +// since := time.Unix(seconds, nanoseconds) +// +// returns seconds as defaultSeconds if value == "" +func ParseTimestamps(value string, defaultSeconds int64) (seconds int64, nanoseconds int64, _ error) { + if value == "" { + return defaultSeconds, 0, nil + } + return parseTimestamp(value) +} + +func parseTimestamp(value string) (seconds int64, nanoseconds int64, _ error) { + s, n, ok := strings.Cut(value, ".") + sec, err := strconv.ParseInt(s, 10, 64) + if err != nil { + return sec, 0, err + } + if !ok { + return sec, 0, nil + } + nsec, err := strconv.ParseInt(n, 10, 64) + if err != nil { + return sec, nsec, err + } + // should already be in nanoseconds but just in case convert n to nanoseconds + nsec = int64(float64(nsec) * math.Pow(float64(10), float64(9-len(n)))) + return sec, nsec, nil +} diff --git a/vendor/github.com/moby/moby/api/types/types.go b/vendor/github.com/moby/moby/api/types/types.go new file mode 100644 index 0000000000..83676e42e5 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/types.go @@ -0,0 +1,103 @@ +package types + +import ( + "github.com/moby/moby/api/types/build" + "github.com/moby/moby/api/types/container" + "github.com/moby/moby/api/types/image" + "github.com/moby/moby/api/types/swarm" + "github.com/moby/moby/api/types/volume" +) + +const ( + // MediaTypeRawStream is vendor specific MIME-Type set for raw TTY streams + MediaTypeRawStream = "application/vnd.docker.raw-stream" + + // MediaTypeMultiplexedStream is vendor specific MIME-Type set for stdin/stdout/stderr multiplexed streams + MediaTypeMultiplexedStream = "application/vnd.docker.multiplexed-stream" +) + +// Ping contains response of Engine API: +// GET "/_ping" +type Ping struct { + APIVersion string + OSType string + Experimental bool + BuilderVersion build.BuilderVersion + + // SwarmStatus provides information about the current swarm status of the + // engine, obtained from the "Swarm" header in the API response. + // + // It can be a nil struct if the API version does not provide this header + // in the ping response, or if an error occurred, in which case the client + // should use other ways to get the current swarm status, such as the /swarm + // endpoint. + SwarmStatus *swarm.Status +} + +// ComponentVersion describes the version information for a specific component. +type ComponentVersion struct { + Name string + Version string + Details map[string]string `json:",omitempty"` +} + +// Version contains response of Engine API: +// GET "/version" +type Version struct { + Platform struct{ Name string } `json:",omitempty"` + Components []ComponentVersion `json:",omitempty"` + + // The following fields are deprecated, they relate to the Engine component and are kept for backwards compatibility + + Version string + APIVersion string `json:"ApiVersion"` + MinAPIVersion string `json:"MinAPIVersion,omitempty"` + GitCommit string + GoVersion string + Os string + Arch string + KernelVersion string `json:",omitempty"` + Experimental bool `json:",omitempty"` + BuildTime string `json:",omitempty"` +} + +// DiskUsageObject represents an object type used for disk usage query filtering. +type DiskUsageObject string + +const ( + // ContainerObject represents a container DiskUsageObject. + ContainerObject DiskUsageObject = "container" + // ImageObject represents an image DiskUsageObject. + ImageObject DiskUsageObject = "image" + // VolumeObject represents a volume DiskUsageObject. + VolumeObject DiskUsageObject = "volume" + // BuildCacheObject represents a build-cache DiskUsageObject. + BuildCacheObject DiskUsageObject = "build-cache" +) + +// DiskUsageOptions holds parameters for system disk usage query. +type DiskUsageOptions struct { + // Types specifies what object types to include in the response. If empty, + // all object types are returned. + Types []DiskUsageObject +} + +// DiskUsage contains response of Engine API: +// GET "/system/df" +type DiskUsage struct { + LayersSize int64 + Images []*image.Summary + Containers []*container.Summary + Volumes []*volume.Volume + BuildCache []*build.CacheRecord + BuilderSize int64 `json:",omitempty"` // Deprecated: deprecated in API 1.38, and no longer used since API 1.40. +} + +// PushResult contains the tag, manifest digest, and manifest size from the +// push. It's used to signal this information to the trust code in the client +// so it can sign the manifest if necessary. +type PushResult struct { + Tag string + Digest string + Size int +} diff --git a/vendor/github.com/moby/moby/api/types/versions/compare.go b/vendor/github.com/moby/moby/api/types/versions/compare.go new file mode 100644 index 0000000000..1a0325c7ed --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/versions/compare.go @@ -0,0 +1,65 @@ +package versions + +import ( + "strconv" + "strings" +) + +// compare compares two version strings +// returns -1 if v1 < v2, 1 if v1 > v2, 0 otherwise. +func compare(v1, v2 string) int { + if v1 == v2 { + return 0 + } + var ( + currTab = strings.Split(v1, ".") + otherTab = strings.Split(v2, ".") + ) + + maxVer := len(currTab) + if len(otherTab) > maxVer { + maxVer = len(otherTab) + } + for i := 0; i < maxVer; i++ { + var currInt, otherInt int + + if len(currTab) > i { + currInt, _ = strconv.Atoi(currTab[i]) + } + if len(otherTab) > i { + otherInt, _ = strconv.Atoi(otherTab[i]) + } + if currInt > otherInt { + return 1 + } + if otherInt > currInt { + return -1 + } + } + return 0 +} + +// LessThan checks if a version is less than another +func LessThan(v, other string) bool { + return compare(v, other) == -1 +} + +// LessThanOrEqualTo checks if a version is less than or equal to another +func LessThanOrEqualTo(v, other string) bool { + return compare(v, other) <= 0 +} + +// GreaterThan checks if a version is greater than another +func GreaterThan(v, other string) bool { + return compare(v, other) == 1 +} + +// GreaterThanOrEqualTo checks if a version is greater than or equal to another +func GreaterThanOrEqualTo(v, other string) bool { + return compare(v, other) >= 0 +} + +// Equal checks if a version is equal to another +func Equal(v, other string) bool { + return compare(v, other) == 0 +} diff --git a/vendor/github.com/moby/moby/api/types/volume/cluster_volume.go b/vendor/github.com/moby/moby/api/types/volume/cluster_volume.go new file mode 100644 index 0000000000..07b75d12a0 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/volume/cluster_volume.go @@ -0,0 +1,420 @@ +package volume + +import ( + "github.com/moby/moby/api/types/swarm" +) + +// ClusterVolume contains options and information specific to, and only present +// on, Swarm CSI cluster volumes. +type ClusterVolume struct { + // ID is the Swarm ID of the volume. Because cluster volumes are Swarm + // objects, they have an ID, unlike non-cluster volumes, which only have a + // Name. This ID can be used to refer to the cluster volume. + ID string + + // Meta is the swarm metadata about this volume. + swarm.Meta + + // Spec is the cluster-specific options from which this volume is derived. + Spec ClusterVolumeSpec + + // PublishStatus contains the status of the volume as it pertains to its + // publishing on Nodes. + PublishStatus []*PublishStatus `json:",omitempty"` + + // Info is information about the global status of the volume. + Info *Info `json:",omitempty"` +} + +// ClusterVolumeSpec contains the spec used to create this volume. +type ClusterVolumeSpec struct { + // Group defines the volume group of this volume. Volumes belonging to the + // same group can be referred to by group name when creating Services. + // Referring to a volume by group instructs swarm to treat volumes in that + // group interchangeably for the purpose of scheduling. Volumes with an + // empty string for a group technically all belong to the same, emptystring + // group. + Group string `json:",omitempty"` + + // AccessMode defines how the volume is used by tasks. + AccessMode *AccessMode `json:",omitempty"` + + // AccessibilityRequirements specifies where in the cluster a volume must + // be accessible from. + // + // This field must be empty if the plugin does not support + // VOLUME_ACCESSIBILITY_CONSTRAINTS capabilities. If it is present but the + // plugin does not support it, volume will not be created. + // + // If AccessibilityRequirements is empty, but the plugin does support + // VOLUME_ACCESSIBILITY_CONSTRAINTS, then Swarmkit will assume the entire + // cluster is a valid target for the volume. + AccessibilityRequirements *TopologyRequirement `json:",omitempty"` + + // CapacityRange defines the desired capacity that the volume should be + // created with. If nil, the plugin will decide the capacity. + CapacityRange *CapacityRange `json:",omitempty"` + + // Secrets defines Swarm Secrets that are passed to the CSI storage plugin + // when operating on this volume. + Secrets []Secret `json:",omitempty"` + + // Availability is the Volume's desired availability. Analogous to Node + // Availability, this allows the user to take volumes offline in order to + // update or delete them. + Availability Availability `json:",omitempty"` +} + +// Availability specifies the availability of the volume. +type Availability string + +const ( + // AvailabilityActive indicates that the volume is active and fully + // schedulable on the cluster. + AvailabilityActive Availability = "active" + + // AvailabilityPause indicates that no new workloads should use the + // volume, but existing workloads can continue to use it. + AvailabilityPause Availability = "pause" + + // AvailabilityDrain indicates that all workloads using this volume + // should be rescheduled, and the volume unpublished from all nodes. + AvailabilityDrain Availability = "drain" +) + +// AccessMode defines the access mode of a volume. +type AccessMode struct { + // Scope defines the set of nodes this volume can be used on at one time. + Scope Scope `json:",omitempty"` + + // Sharing defines the number and way that different tasks can use this + // volume at one time. + Sharing SharingMode `json:",omitempty"` + + // MountVolume defines options for using this volume as a Mount-type + // volume. + // + // Either BlockVolume or MountVolume, but not both, must be present. + MountVolume *TypeMount `json:",omitempty"` + + // BlockVolume defines options for using this volume as a Block-type + // volume. + // + // Either BlockVolume or MountVolume, but not both, must be present. + BlockVolume *TypeBlock `json:",omitempty"` +} + +// Scope defines the Scope of a Cluster Volume. This is how many nodes a +// Volume can be accessed simultaneously on. +type Scope string + +const ( + // ScopeSingleNode indicates the volume can be used on one node at a + // time. + ScopeSingleNode Scope = "single" + + // ScopeMultiNode indicates the volume can be used on many nodes at + // the same time. + ScopeMultiNode Scope = "multi" +) + +// SharingMode defines the Sharing of a Cluster Volume. This is how Tasks using a +// Volume at the same time can use it. +type SharingMode string + +const ( + // SharingNone indicates that only one Task may use the Volume at a + // time. + SharingNone SharingMode = "none" + + // SharingReadOnly indicates that the Volume may be shared by any + // number of Tasks, but they must be read-only. + SharingReadOnly SharingMode = "readonly" + + // SharingOneWriter indicates that the Volume may be shared by any + // number of Tasks, but all after the first must be read-only. + SharingOneWriter SharingMode = "onewriter" + + // SharingAll means that the Volume may be shared by any number of + // Tasks, as readers or writers. + SharingAll SharingMode = "all" +) + +// TypeBlock defines options for using a volume as a block-type volume. +// +// Intentionally empty. +type TypeBlock struct{} + +// TypeMount contains options for using a volume as a Mount-type +// volume. +type TypeMount struct { + // FsType specifies the filesystem type for the mount volume. Optional. + FsType string `json:",omitempty"` + + // MountFlags defines flags to pass when mounting the volume. Optional. + MountFlags []string `json:",omitempty"` +} + +// TopologyRequirement expresses the user's requirements for a volume's +// accessible topology. +type TopologyRequirement struct { + // Requisite specifies a list of Topologies, at least one of which the + // volume must be accessible from. + // + // Taken verbatim from the CSI Spec: + // + // Specifies the list of topologies the provisioned volume MUST be + // accessible from. + // This field is OPTIONAL. If TopologyRequirement is specified either + // requisite or preferred or both MUST be specified. + // + // If requisite is specified, the provisioned volume MUST be + // accessible from at least one of the requisite topologies. + // + // Given + // x = number of topologies provisioned volume is accessible from + // n = number of requisite topologies + // The CO MUST ensure n >= 1. The SP MUST ensure x >= 1 + // If x==n, then the SP MUST make the provisioned volume available to + // all topologies from the list of requisite topologies. If it is + // unable to do so, the SP MUST fail the CreateVolume call. + // For example, if a volume should be accessible from a single zone, + // and requisite = + // {"region": "R1", "zone": "Z2"} + // then the provisioned volume MUST be accessible from the "region" + // "R1" and the "zone" "Z2". + // Similarly, if a volume should be accessible from two zones, and + // requisite = + // {"region": "R1", "zone": "Z2"}, + // {"region": "R1", "zone": "Z3"} + // then the provisioned volume MUST be accessible from the "region" + // "R1" and both "zone" "Z2" and "zone" "Z3". + // + // If xn, then the SP MUST make the provisioned volume available from + // all topologies from the list of requisite topologies and MAY choose + // the remaining x-n unique topologies from the list of all possible + // topologies. If it is unable to do so, the SP MUST fail the + // CreateVolume call. + // For example, if a volume should be accessible from two zones, and + // requisite = + // {"region": "R1", "zone": "Z2"} + // then the provisioned volume MUST be accessible from the "region" + // "R1" and the "zone" "Z2" and the SP may select the second zone + // independently, e.g. "R1/Z4". + Requisite []Topology `json:",omitempty"` + + // Preferred is a list of Topologies that the volume should attempt to be + // provisioned in. + // + // Taken from the CSI spec: + // + // Specifies the list of topologies the CO would prefer the volume to + // be provisioned in. + // + // This field is OPTIONAL. If TopologyRequirement is specified either + // requisite or preferred or both MUST be specified. + // + // An SP MUST attempt to make the provisioned volume available using + // the preferred topologies in order from first to last. + // + // If requisite is specified, all topologies in preferred list MUST + // also be present in the list of requisite topologies. + // + // If the SP is unable to make the provisioned volume available + // from any of the preferred topologies, the SP MAY choose a topology + // from the list of requisite topologies. + // If the list of requisite topologies is not specified, then the SP + // MAY choose from the list of all possible topologies. + // If the list of requisite topologies is specified and the SP is + // unable to make the provisioned volume available from any of the + // requisite topologies it MUST fail the CreateVolume call. + // + // Example 1: + // Given a volume should be accessible from a single zone, and + // requisite = + // {"region": "R1", "zone": "Z2"}, + // {"region": "R1", "zone": "Z3"} + // preferred = + // {"region": "R1", "zone": "Z3"} + // then the SP SHOULD first attempt to make the provisioned volume + // available from "zone" "Z3" in the "region" "R1" and fall back to + // "zone" "Z2" in the "region" "R1" if that is not possible. + // + // Example 2: + // Given a volume should be accessible from a single zone, and + // requisite = + // {"region": "R1", "zone": "Z2"}, + // {"region": "R1", "zone": "Z3"}, + // {"region": "R1", "zone": "Z4"}, + // {"region": "R1", "zone": "Z5"} + // preferred = + // {"region": "R1", "zone": "Z4"}, + // {"region": "R1", "zone": "Z2"} + // then the SP SHOULD first attempt to make the provisioned volume + // accessible from "zone" "Z4" in the "region" "R1" and fall back to + // "zone" "Z2" in the "region" "R1" if that is not possible. If that + // is not possible, the SP may choose between either the "zone" + // "Z3" or "Z5" in the "region" "R1". + // + // Example 3: + // Given a volume should be accessible from TWO zones (because an + // opaque parameter in CreateVolumeRequest, for example, specifies + // the volume is accessible from two zones, aka synchronously + // replicated), and + // requisite = + // {"region": "R1", "zone": "Z2"}, + // {"region": "R1", "zone": "Z3"}, + // {"region": "R1", "zone": "Z4"}, + // {"region": "R1", "zone": "Z5"} + // preferred = + // {"region": "R1", "zone": "Z5"}, + // {"region": "R1", "zone": "Z3"} + // then the SP SHOULD first attempt to make the provisioned volume + // accessible from the combination of the two "zones" "Z5" and "Z3" in + // the "region" "R1". If that's not possible, it should fall back to + // a combination of "Z5" and other possibilities from the list of + // requisite. If that's not possible, it should fall back to a + // combination of "Z3" and other possibilities from the list of + // requisite. If that's not possible, it should fall back to a + // combination of other possibilities from the list of requisite. + Preferred []Topology `json:",omitempty"` +} + +// Topology is a map of topological domains to topological segments. +// +// This description is taken verbatim from the CSI Spec: +// +// A topological domain is a sub-division of a cluster, like "region", +// "zone", "rack", etc. +// A topological segment is a specific instance of a topological domain, +// like "zone3", "rack3", etc. +// For example {"com.company/zone": "Z1", "com.company/rack": "R3"} +// Valid keys have two segments: an OPTIONAL prefix and name, separated +// by a slash (/), for example: "com.company.example/zone". +// The key name segment is REQUIRED. The prefix is OPTIONAL. +// The key name MUST be 63 characters or less, begin and end with an +// alphanumeric character ([a-z0-9A-Z]), and contain only dashes (-), +// underscores (_), dots (.), or alphanumerics in between, for example +// "zone". +// The key prefix MUST be 63 characters or less, begin and end with a +// lower-case alphanumeric character ([a-z0-9]), contain only +// dashes (-), dots (.), or lower-case alphanumerics in between, and +// follow domain name notation format +// (https://tools.ietf.org/html/rfc1035#section-2.3.1). +// The key prefix SHOULD include the plugin's host company name and/or +// the plugin name, to minimize the possibility of collisions with keys +// from other plugins. +// If a key prefix is specified, it MUST be identical across all +// topology keys returned by the SP (across all RPCs). +// Keys MUST be case-insensitive. Meaning the keys "Zone" and "zone" +// MUST not both exist. +// Each value (topological segment) MUST contain 1 or more strings. +// Each string MUST be 63 characters or less and begin and end with an +// alphanumeric character with '-', '_', '.', or alphanumerics in +// between. +type Topology struct { + Segments map[string]string `json:",omitempty"` +} + +// CapacityRange describes the minimum and maximum capacity a volume should be +// created with +type CapacityRange struct { + // RequiredBytes specifies that a volume must be at least this big. The + // value of 0 indicates an unspecified minimum. + RequiredBytes int64 + + // LimitBytes specifies that a volume must not be bigger than this. The + // value of 0 indicates an unspecified maximum + LimitBytes int64 +} + +// Secret represents a Swarm Secret value that must be passed to the CSI +// storage plugin when operating on this Volume. It represents one key-value +// pair of possibly many. +type Secret struct { + // Key is the name of the key of the key-value pair passed to the plugin. + Key string + + // Secret is the swarm Secret object from which to read data. This can be a + // Secret name or ID. The Secret data is retrieved by Swarm and used as the + // value of the key-value pair passed to the plugin. + Secret string +} + +// PublishState represents the state of a Volume as it pertains to its +// use on a particular Node. +type PublishState string + +const ( + // StatePending indicates that the volume should be published on + // this node, but the call to ControllerPublishVolume has not been + // successfully completed yet and the result recorded by swarmkit. + StatePending PublishState = "pending-publish" + + // StatePublished means the volume is published successfully to the node. + StatePublished PublishState = "published" + + // StatePendingNodeUnpublish indicates that the Volume should be + // unpublished on the Node, and we're waiting for confirmation that it has + // done so. After the Node has confirmed that the Volume has been + // unpublished, the state will move to StatePendingUnpublish. + StatePendingNodeUnpublish PublishState = "pending-node-unpublish" + + // StatePendingUnpublish means the volume is still published to the node + // by the controller, awaiting the operation to unpublish it. + StatePendingUnpublish PublishState = "pending-controller-unpublish" +) + +// PublishStatus represents the status of the volume as published to an +// individual node +type PublishStatus struct { + // NodeID is the ID of the swarm node this Volume is published to. + NodeID string `json:",omitempty"` + + // State is the publish state of the volume. + State PublishState `json:",omitempty"` + + // PublishContext is the PublishContext returned by the CSI plugin when + // a volume is published. + PublishContext map[string]string `json:",omitempty"` +} + +// Info contains information about the Volume as a whole as provided by +// the CSI storage plugin. +type Info struct { + // CapacityBytes is the capacity of the volume in bytes. A value of 0 + // indicates that the capacity is unknown. + CapacityBytes int64 `json:",omitempty"` + + // VolumeContext is the context originating from the CSI storage plugin + // when the Volume is created. + VolumeContext map[string]string `json:",omitempty"` + + // VolumeID is the ID of the Volume as seen by the CSI storage plugin. This + // is distinct from the Volume's Swarm ID, which is the ID used by all of + // the Docker Engine to refer to the Volume. If this field is blank, then + // the Volume has not been successfully created yet. + VolumeID string `json:",omitempty"` + + // AccessibleTopology is the topology this volume is actually accessible + // from. + AccessibleTopology []Topology `json:",omitempty"` +} diff --git a/vendor/github.com/moby/moby/api/types/volume/create_options.go b/vendor/github.com/moby/moby/api/types/volume/create_options.go new file mode 100644 index 0000000000..37c41a6096 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/volume/create_options.go @@ -0,0 +1,29 @@ +package volume + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// CreateOptions VolumeConfig +// +// Volume configuration +// swagger:model CreateOptions +type CreateOptions struct { + + // cluster volume spec + ClusterVolumeSpec *ClusterVolumeSpec `json:"ClusterVolumeSpec,omitempty"` + + // Name of the volume driver to use. + Driver string `json:"Driver,omitempty"` + + // A mapping of driver options and values. These options are + // passed directly to the driver and are driver specific. + // + DriverOpts map[string]string `json:"DriverOpts,omitempty"` + + // User-defined key/value metadata. + Labels map[string]string `json:"Labels,omitempty"` + + // The new volume's name. If not specified, Docker generates a name. + // + Name string `json:"Name,omitempty"` +} diff --git a/vendor/github.com/moby/moby/api/types/volume/disk_usage.go b/vendor/github.com/moby/moby/api/types/volume/disk_usage.go new file mode 100644 index 0000000000..3d716c6e00 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/volume/disk_usage.go @@ -0,0 +1,8 @@ +package volume + +// DiskUsage contains disk usage for volumes. +type DiskUsage struct { + TotalSize int64 + Reclaimable int64 + Items []*Volume +} diff --git a/vendor/github.com/moby/moby/api/types/volume/list_response.go b/vendor/github.com/moby/moby/api/types/volume/list_response.go new file mode 100644 index 0000000000..ca5192a2a9 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/volume/list_response.go @@ -0,0 +1,18 @@ +package volume + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// ListResponse VolumeListResponse +// +// Volume list response +// swagger:model ListResponse +type ListResponse struct { + + // List of volumes + Volumes []*Volume `json:"Volumes"` + + // Warnings that occurred when fetching the list of volumes. + // + Warnings []string `json:"Warnings"` +} diff --git a/vendor/github.com/moby/moby/api/types/volume/options.go b/vendor/github.com/moby/moby/api/types/volume/options.go new file mode 100644 index 0000000000..7237f2db8d --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/volume/options.go @@ -0,0 +1,15 @@ +package volume + +import "github.com/moby/moby/api/types/filters" + +// ListOptions holds parameters to list volumes. +type ListOptions struct { + Filters filters.Args +} + +// PruneReport contains the response for Engine API: +// POST "/volumes/prune" +type PruneReport struct { + VolumesDeleted []string + SpaceReclaimed uint64 +} diff --git a/vendor/github.com/moby/moby/api/types/volume/volume.go b/vendor/github.com/moby/moby/api/types/volume/volume.go new file mode 100644 index 0000000000..ea7d555e5b --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/volume/volume.go @@ -0,0 +1,75 @@ +package volume + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// Volume volume +// swagger:model Volume +type Volume struct { + + // cluster volume + ClusterVolume *ClusterVolume `json:"ClusterVolume,omitempty"` + + // Date/Time the volume was created. + CreatedAt string `json:"CreatedAt,omitempty"` + + // Name of the volume driver used by the volume. + // Required: true + Driver string `json:"Driver"` + + // User-defined key/value metadata. + // Required: true + Labels map[string]string `json:"Labels"` + + // Mount path of the volume on the host. + // Required: true + Mountpoint string `json:"Mountpoint"` + + // Name of the volume. + // Required: true + Name string `json:"Name"` + + // The driver specific options used when creating the volume. + // + // Required: true + Options map[string]string `json:"Options"` + + // The level at which the volume exists. Either `global` for cluster-wide, + // or `local` for machine level. + // + // Required: true + Scope string `json:"Scope"` + + // Low-level details about the volume, provided by the volume driver. + // Details are returned as a map with key/value pairs: + // `{"key":"value","key2":"value2"}`. + // + // The `Status` field is optional, and is omitted if the volume driver + // does not support this feature. + // + Status map[string]interface{} `json:"Status,omitempty"` + + // usage data + UsageData *UsageData `json:"UsageData,omitempty"` +} + +// UsageData Usage details about the volume. This information is used by the +// `GET /system/df` endpoint, and omitted in other endpoints. +// +// swagger:model UsageData +type UsageData struct { + + // The number of containers referencing this volume. This field + // is set to `-1` if the reference-count is not available. + // + // Required: true + RefCount int64 `json:"RefCount"` + + // Amount of disk space used by the volume (in bytes). This information + // is only available for volumes created with the `"local"` volume + // driver. For volumes created with other volume drivers, this field + // is set to `-1` ("not available") + // + // Required: true + Size int64 `json:"Size"` +} diff --git a/vendor/github.com/moby/moby/api/types/volume/volume_update.go b/vendor/github.com/moby/moby/api/types/volume/volume_update.go new file mode 100644 index 0000000000..c26ed44c6c --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/volume/volume_update.go @@ -0,0 +1,7 @@ +package volume + +// UpdateOptions is configuration to update a Volume with. +type UpdateOptions struct { + // Spec is the ClusterVolumeSpec to update the volume to. + Spec *ClusterVolumeSpec `json:"Spec,omitempty"` +} diff --git a/vendor/golang.org/x/mod/modfile/print.go b/vendor/golang.org/x/mod/modfile/print.go deleted file mode 100644 index 2a0123d4b9..0000000000 --- a/vendor/golang.org/x/mod/modfile/print.go +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Module file printer. - -package modfile - -import ( - "bytes" - "fmt" - "strings" -) - -// Format returns a go.mod file as a byte slice, formatted in standard style. -func Format(f *FileSyntax) []byte { - pr := &printer{} - pr.file(f) - - // remove trailing blank lines - b := pr.Bytes() - for len(b) > 0 && b[len(b)-1] == '\n' && (len(b) == 1 || b[len(b)-2] == '\n') { - b = b[:len(b)-1] - } - return b -} - -// A printer collects the state during printing of a file or expression. -type printer struct { - bytes.Buffer // output buffer - comment []Comment // pending end-of-line comments - margin int // left margin (indent), a number of tabs -} - -// printf prints to the buffer. -func (p *printer) printf(format string, args ...interface{}) { - fmt.Fprintf(p, format, args...) -} - -// indent returns the position on the current line, in bytes, 0-indexed. -func (p *printer) indent() int { - b := p.Bytes() - n := 0 - for n < len(b) && b[len(b)-1-n] != '\n' { - n++ - } - return n -} - -// newline ends the current line, flushing end-of-line comments. -func (p *printer) newline() { - if len(p.comment) > 0 { - p.printf(" ") - for i, com := range p.comment { - if i > 0 { - p.trim() - p.printf("\n") - for i := 0; i < p.margin; i++ { - p.printf("\t") - } - } - p.printf("%s", strings.TrimSpace(com.Token)) - } - p.comment = p.comment[:0] - } - - p.trim() - if b := p.Bytes(); len(b) == 0 || (len(b) >= 2 && b[len(b)-1] == '\n' && b[len(b)-2] == '\n') { - // skip the blank line at top of file or after a blank line - } else { - p.printf("\n") - } - for i := 0; i < p.margin; i++ { - p.printf("\t") - } -} - -// trim removes trailing spaces and tabs from the current line. -func (p *printer) trim() { - // Remove trailing spaces and tabs from line we're about to end. - b := p.Bytes() - n := len(b) - for n > 0 && (b[n-1] == '\t' || b[n-1] == ' ') { - n-- - } - p.Truncate(n) -} - -// file formats the given file into the print buffer. -func (p *printer) file(f *FileSyntax) { - for _, com := range f.Before { - p.printf("%s", strings.TrimSpace(com.Token)) - p.newline() - } - - for i, stmt := range f.Stmt { - switch x := stmt.(type) { - case *CommentBlock: - // comments already handled - p.expr(x) - - default: - p.expr(x) - p.newline() - } - - for _, com := range stmt.Comment().After { - p.printf("%s", strings.TrimSpace(com.Token)) - p.newline() - } - - if i+1 < len(f.Stmt) { - p.newline() - } - } -} - -func (p *printer) expr(x Expr) { - // Emit line-comments preceding this expression. - if before := x.Comment().Before; len(before) > 0 { - // Want to print a line comment. - // Line comments must be at the current margin. - p.trim() - if p.indent() > 0 { - // There's other text on the line. Start a new line. - p.printf("\n") - } - // Re-indent to margin. - for i := 0; i < p.margin; i++ { - p.printf("\t") - } - for _, com := range before { - p.printf("%s", strings.TrimSpace(com.Token)) - p.newline() - } - } - - switch x := x.(type) { - default: - panic(fmt.Errorf("printer: unexpected type %T", x)) - - case *CommentBlock: - // done - - case *LParen: - p.printf("(") - case *RParen: - p.printf(")") - - case *Line: - p.tokens(x.Token) - - case *LineBlock: - p.tokens(x.Token) - p.printf(" ") - p.expr(&x.LParen) - p.margin++ - for _, l := range x.Line { - p.newline() - p.expr(l) - } - p.margin-- - p.newline() - p.expr(&x.RParen) - } - - // Queue end-of-line comments for printing when we - // reach the end of the line. - p.comment = append(p.comment, x.Comment().Suffix...) -} - -func (p *printer) tokens(tokens []string) { - sep := "" - for _, t := range tokens { - if t == "," || t == ")" || t == "]" || t == "}" { - sep = "" - } - p.printf("%s%s", sep, t) - sep = " " - if t == "(" || t == "[" || t == "{" { - sep = "" - } - } -} diff --git a/vendor/golang.org/x/mod/modfile/read.go b/vendor/golang.org/x/mod/modfile/read.go deleted file mode 100644 index 2d7486804f..0000000000 --- a/vendor/golang.org/x/mod/modfile/read.go +++ /dev/null @@ -1,964 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package modfile - -import ( - "bytes" - "errors" - "fmt" - "os" - "strconv" - "strings" - "unicode" - "unicode/utf8" -) - -// A Position describes an arbitrary source position in a file, including the -// file, line, column, and byte offset. -type Position struct { - Line int // line in input (starting at 1) - LineRune int // rune in line (starting at 1) - Byte int // byte in input (starting at 0) -} - -// add returns the position at the end of s, assuming it starts at p. -func (p Position) add(s string) Position { - p.Byte += len(s) - if n := strings.Count(s, "\n"); n > 0 { - p.Line += n - s = s[strings.LastIndex(s, "\n")+1:] - p.LineRune = 1 - } - p.LineRune += utf8.RuneCountInString(s) - return p -} - -// An Expr represents an input element. -type Expr interface { - // Span returns the start and end position of the expression, - // excluding leading or trailing comments. - Span() (start, end Position) - - // Comment returns the comments attached to the expression. - // This method would normally be named 'Comments' but that - // would interfere with embedding a type of the same name. - Comment() *Comments -} - -// A Comment represents a single // comment. -type Comment struct { - Start Position - Token string // without trailing newline - Suffix bool // an end of line (not whole line) comment -} - -// Comments collects the comments associated with an expression. -type Comments struct { - Before []Comment // whole-line comments before this expression - Suffix []Comment // end-of-line comments after this expression - - // For top-level expressions only, After lists whole-line - // comments following the expression. - After []Comment -} - -// Comment returns the receiver. This isn't useful by itself, but -// a [Comments] struct is embedded into all the expression -// implementation types, and this gives each of those a Comment -// method to satisfy the Expr interface. -func (c *Comments) Comment() *Comments { - return c -} - -// A FileSyntax represents an entire go.mod file. -type FileSyntax struct { - Name string // file path - Comments - Stmt []Expr -} - -func (x *FileSyntax) Span() (start, end Position) { - if len(x.Stmt) == 0 { - return - } - start, _ = x.Stmt[0].Span() - _, end = x.Stmt[len(x.Stmt)-1].Span() - return start, end -} - -// addLine adds a line containing the given tokens to the file. -// -// If the first token of the hint matches the first token of the -// line, the new line is added at the end of the block containing hint, -// extracting hint into a new block if it is not yet in one. -// -// If the hint is non-nil buts its first token does not match, -// the new line is added after the block containing hint -// (or hint itself, if not in a block). -// -// If no hint is provided, addLine appends the line to the end of -// the last block with a matching first token, -// or to the end of the file if no such block exists. -func (x *FileSyntax) addLine(hint Expr, tokens ...string) *Line { - if hint == nil { - // If no hint given, add to the last statement of the given type. - Loop: - for i := len(x.Stmt) - 1; i >= 0; i-- { - stmt := x.Stmt[i] - switch stmt := stmt.(type) { - case *Line: - if stmt.Token != nil && stmt.Token[0] == tokens[0] { - hint = stmt - break Loop - } - case *LineBlock: - if stmt.Token[0] == tokens[0] { - hint = stmt - break Loop - } - } - } - } - - newLineAfter := func(i int) *Line { - new := &Line{Token: tokens} - if i == len(x.Stmt) { - x.Stmt = append(x.Stmt, new) - } else { - x.Stmt = append(x.Stmt, nil) - copy(x.Stmt[i+2:], x.Stmt[i+1:]) - x.Stmt[i+1] = new - } - return new - } - - if hint != nil { - for i, stmt := range x.Stmt { - switch stmt := stmt.(type) { - case *Line: - if stmt == hint { - if stmt.Token == nil || stmt.Token[0] != tokens[0] { - return newLineAfter(i) - } - - // Convert line to line block. - stmt.InBlock = true - block := &LineBlock{Token: stmt.Token[:1], Line: []*Line{stmt}} - stmt.Token = stmt.Token[1:] - x.Stmt[i] = block - new := &Line{Token: tokens[1:], InBlock: true} - block.Line = append(block.Line, new) - return new - } - - case *LineBlock: - if stmt == hint { - if stmt.Token[0] != tokens[0] { - return newLineAfter(i) - } - - new := &Line{Token: tokens[1:], InBlock: true} - stmt.Line = append(stmt.Line, new) - return new - } - - for j, line := range stmt.Line { - if line == hint { - if stmt.Token[0] != tokens[0] { - return newLineAfter(i) - } - - // Add new line after hint within the block. - stmt.Line = append(stmt.Line, nil) - copy(stmt.Line[j+2:], stmt.Line[j+1:]) - new := &Line{Token: tokens[1:], InBlock: true} - stmt.Line[j+1] = new - return new - } - } - } - } - } - - new := &Line{Token: tokens} - x.Stmt = append(x.Stmt, new) - return new -} - -func (x *FileSyntax) updateLine(line *Line, tokens ...string) { - if line.InBlock { - tokens = tokens[1:] - } - line.Token = tokens -} - -// markRemoved modifies line so that it (and its end-of-line comment, if any) -// will be dropped by (*FileSyntax).Cleanup. -func (line *Line) markRemoved() { - line.Token = nil - line.Comments.Suffix = nil -} - -// Cleanup cleans up the file syntax x after any edit operations. -// To avoid quadratic behavior, (*Line).markRemoved marks the line as dead -// by setting line.Token = nil but does not remove it from the slice -// in which it appears. After edits have all been indicated, -// calling Cleanup cleans out the dead lines. -func (x *FileSyntax) Cleanup() { - w := 0 - for _, stmt := range x.Stmt { - switch stmt := stmt.(type) { - case *Line: - if stmt.Token == nil { - continue - } - case *LineBlock: - ww := 0 - for _, line := range stmt.Line { - if line.Token != nil { - stmt.Line[ww] = line - ww++ - } - } - if ww == 0 { - continue - } - if ww == 1 && len(stmt.RParen.Comments.Before) == 0 { - // Collapse block into single line but keep the Line reference used by the - // parsed File structure. - *stmt.Line[0] = Line{ - Comments: Comments{ - Before: commentsAdd(stmt.Before, stmt.Line[0].Before), - Suffix: commentsAdd(stmt.Line[0].Suffix, stmt.Suffix), - After: commentsAdd(stmt.Line[0].After, stmt.After), - }, - Token: stringsAdd(stmt.Token, stmt.Line[0].Token), - } - x.Stmt[w] = stmt.Line[0] - w++ - continue - } - stmt.Line = stmt.Line[:ww] - } - x.Stmt[w] = stmt - w++ - } - x.Stmt = x.Stmt[:w] -} - -func commentsAdd(x, y []Comment) []Comment { - return append(x[:len(x):len(x)], y...) -} - -func stringsAdd(x, y []string) []string { - return append(x[:len(x):len(x)], y...) -} - -// A CommentBlock represents a top-level block of comments separate -// from any rule. -type CommentBlock struct { - Comments - Start Position -} - -func (x *CommentBlock) Span() (start, end Position) { - return x.Start, x.Start -} - -// A Line is a single line of tokens. -type Line struct { - Comments - Start Position - Token []string - InBlock bool - End Position -} - -func (x *Line) Span() (start, end Position) { - return x.Start, x.End -} - -// A LineBlock is a factored block of lines, like -// -// require ( -// "x" -// "y" -// ) -type LineBlock struct { - Comments - Start Position - LParen LParen - Token []string - Line []*Line - RParen RParen -} - -func (x *LineBlock) Span() (start, end Position) { - return x.Start, x.RParen.Pos.add(")") -} - -// An LParen represents the beginning of a parenthesized line block. -// It is a place to store suffix comments. -type LParen struct { - Comments - Pos Position -} - -func (x *LParen) Span() (start, end Position) { - return x.Pos, x.Pos.add(")") -} - -// An RParen represents the end of a parenthesized line block. -// It is a place to store whole-line (before) comments. -type RParen struct { - Comments - Pos Position -} - -func (x *RParen) Span() (start, end Position) { - return x.Pos, x.Pos.add(")") -} - -// An input represents a single input file being parsed. -type input struct { - // Lexing state. - filename string // name of input file, for errors - complete []byte // entire input - remaining []byte // remaining input - tokenStart []byte // token being scanned to end of input - token token // next token to be returned by lex, peek - pos Position // current input position - comments []Comment // accumulated comments - - // Parser state. - file *FileSyntax // returned top-level syntax tree - parseErrors ErrorList // errors encountered during parsing - - // Comment assignment state. - pre []Expr // all expressions, in preorder traversal - post []Expr // all expressions, in postorder traversal -} - -func newInput(filename string, data []byte) *input { - return &input{ - filename: filename, - complete: data, - remaining: data, - pos: Position{Line: 1, LineRune: 1, Byte: 0}, - } -} - -// parse parses the input file. -func parse(file string, data []byte) (f *FileSyntax, err error) { - // The parser panics for both routine errors like syntax errors - // and for programmer bugs like array index errors. - // Turn both into error returns. Catching bug panics is - // especially important when processing many files. - in := newInput(file, data) - defer func() { - if e := recover(); e != nil && e != &in.parseErrors { - in.parseErrors = append(in.parseErrors, Error{ - Filename: in.filename, - Pos: in.pos, - Err: fmt.Errorf("internal error: %v", e), - }) - } - if err == nil && len(in.parseErrors) > 0 { - err = in.parseErrors - } - }() - - // Prime the lexer by reading in the first token. It will be available - // in the next peek() or lex() call. - in.readToken() - - // Invoke the parser. - in.parseFile() - if len(in.parseErrors) > 0 { - return nil, in.parseErrors - } - in.file.Name = in.filename - - // Assign comments to nearby syntax. - in.assignComments() - - return in.file, nil -} - -// Error is called to report an error. -// Error does not return: it panics. -func (in *input) Error(s string) { - in.parseErrors = append(in.parseErrors, Error{ - Filename: in.filename, - Pos: in.pos, - Err: errors.New(s), - }) - panic(&in.parseErrors) -} - -// eof reports whether the input has reached end of file. -func (in *input) eof() bool { - return len(in.remaining) == 0 -} - -// peekRune returns the next rune in the input without consuming it. -func (in *input) peekRune() int { - if len(in.remaining) == 0 { - return 0 - } - r, _ := utf8.DecodeRune(in.remaining) - return int(r) -} - -// peekPrefix reports whether the remaining input begins with the given prefix. -func (in *input) peekPrefix(prefix string) bool { - // This is like bytes.HasPrefix(in.remaining, []byte(prefix)) - // but without the allocation of the []byte copy of prefix. - for i := 0; i < len(prefix); i++ { - if i >= len(in.remaining) || in.remaining[i] != prefix[i] { - return false - } - } - return true -} - -// readRune consumes and returns the next rune in the input. -func (in *input) readRune() int { - if len(in.remaining) == 0 { - in.Error("internal lexer error: readRune at EOF") - } - r, size := utf8.DecodeRune(in.remaining) - in.remaining = in.remaining[size:] - if r == '\n' { - in.pos.Line++ - in.pos.LineRune = 1 - } else { - in.pos.LineRune++ - } - in.pos.Byte += size - return int(r) -} - -type token struct { - kind tokenKind - pos Position - endPos Position - text string -} - -type tokenKind int - -const ( - _EOF tokenKind = -(iota + 1) - _EOLCOMMENT - _IDENT - _STRING - _COMMENT - - // newlines and punctuation tokens are allowed as ASCII codes. -) - -func (k tokenKind) isComment() bool { - return k == _COMMENT || k == _EOLCOMMENT -} - -// isEOL returns whether a token terminates a line. -func (k tokenKind) isEOL() bool { - return k == _EOF || k == _EOLCOMMENT || k == '\n' -} - -// startToken marks the beginning of the next input token. -// It must be followed by a call to endToken, once the token's text has -// been consumed using readRune. -func (in *input) startToken() { - in.tokenStart = in.remaining - in.token.text = "" - in.token.pos = in.pos -} - -// endToken marks the end of an input token. -// It records the actual token string in tok.text. -// A single trailing newline (LF or CRLF) will be removed from comment tokens. -func (in *input) endToken(kind tokenKind) { - in.token.kind = kind - text := string(in.tokenStart[:len(in.tokenStart)-len(in.remaining)]) - if kind.isComment() { - if strings.HasSuffix(text, "\r\n") { - text = text[:len(text)-2] - } else { - text = strings.TrimSuffix(text, "\n") - } - } - in.token.text = text - in.token.endPos = in.pos -} - -// peek returns the kind of the next token returned by lex. -func (in *input) peek() tokenKind { - return in.token.kind -} - -// lex is called from the parser to obtain the next input token. -func (in *input) lex() token { - tok := in.token - in.readToken() - return tok -} - -// readToken lexes the next token from the text and stores it in in.token. -func (in *input) readToken() { - // Skip past spaces, stopping at non-space or EOF. - for !in.eof() { - c := in.peekRune() - if c == ' ' || c == '\t' || c == '\r' { - in.readRune() - continue - } - - // Comment runs to end of line. - if in.peekPrefix("//") { - in.startToken() - - // Is this comment the only thing on its line? - // Find the last \n before this // and see if it's all - // spaces from there to here. - i := bytes.LastIndex(in.complete[:in.pos.Byte], []byte("\n")) - suffix := len(bytes.TrimSpace(in.complete[i+1:in.pos.Byte])) > 0 - in.readRune() - in.readRune() - - // Consume comment. - for len(in.remaining) > 0 && in.readRune() != '\n' { - } - - // If we are at top level (not in a statement), hand the comment to - // the parser as a _COMMENT token. The grammar is written - // to handle top-level comments itself. - if !suffix { - in.endToken(_COMMENT) - return - } - - // Otherwise, save comment for later attachment to syntax tree. - in.endToken(_EOLCOMMENT) - in.comments = append(in.comments, Comment{in.token.pos, in.token.text, suffix}) - return - } - - if in.peekPrefix("/*") { - in.Error("mod files must use // comments (not /* */ comments)") - } - - // Found non-space non-comment. - break - } - - // Found the beginning of the next token. - in.startToken() - - // End of file. - if in.eof() { - in.endToken(_EOF) - return - } - - // Punctuation tokens. - switch c := in.peekRune(); c { - case '\n', '(', ')', '[', ']', '{', '}', ',': - in.readRune() - in.endToken(tokenKind(c)) - return - - case '"', '`': // quoted string - quote := c - in.readRune() - for { - if in.eof() { - in.pos = in.token.pos - in.Error("unexpected EOF in string") - } - if in.peekRune() == '\n' { - in.Error("unexpected newline in string") - } - c := in.readRune() - if c == quote { - break - } - if c == '\\' && quote != '`' { - if in.eof() { - in.pos = in.token.pos - in.Error("unexpected EOF in string") - } - in.readRune() - } - } - in.endToken(_STRING) - return - } - - // Checked all punctuation. Must be identifier token. - if c := in.peekRune(); !isIdent(c) { - in.Error(fmt.Sprintf("unexpected input character %#q", c)) - } - - // Scan over identifier. - for isIdent(in.peekRune()) { - if in.peekPrefix("//") { - break - } - if in.peekPrefix("/*") { - in.Error("mod files must use // comments (not /* */ comments)") - } - in.readRune() - } - in.endToken(_IDENT) -} - -// isIdent reports whether c is an identifier rune. -// We treat most printable runes as identifier runes, except for a handful of -// ASCII punctuation characters. -func isIdent(c int) bool { - switch r := rune(c); r { - case ' ', '(', ')', '[', ']', '{', '}', ',': - return false - default: - return !unicode.IsSpace(r) && unicode.IsPrint(r) - } -} - -// Comment assignment. -// We build two lists of all subexpressions, preorder and postorder. -// The preorder list is ordered by start location, with outer expressions first. -// The postorder list is ordered by end location, with outer expressions last. -// We use the preorder list to assign each whole-line comment to the syntax -// immediately following it, and we use the postorder list to assign each -// end-of-line comment to the syntax immediately preceding it. - -// order walks the expression adding it and its subexpressions to the -// preorder and postorder lists. -func (in *input) order(x Expr) { - if x != nil { - in.pre = append(in.pre, x) - } - switch x := x.(type) { - default: - panic(fmt.Errorf("order: unexpected type %T", x)) - case nil: - // nothing - case *LParen, *RParen: - // nothing - case *CommentBlock: - // nothing - case *Line: - // nothing - case *FileSyntax: - for _, stmt := range x.Stmt { - in.order(stmt) - } - case *LineBlock: - in.order(&x.LParen) - for _, l := range x.Line { - in.order(l) - } - in.order(&x.RParen) - } - if x != nil { - in.post = append(in.post, x) - } -} - -// assignComments attaches comments to nearby syntax. -func (in *input) assignComments() { - const debug = false - - // Generate preorder and postorder lists. - in.order(in.file) - - // Split into whole-line comments and suffix comments. - var line, suffix []Comment - for _, com := range in.comments { - if com.Suffix { - suffix = append(suffix, com) - } else { - line = append(line, com) - } - } - - if debug { - for _, c := range line { - fmt.Fprintf(os.Stderr, "LINE %q :%d:%d #%d\n", c.Token, c.Start.Line, c.Start.LineRune, c.Start.Byte) - } - } - - // Assign line comments to syntax immediately following. - for _, x := range in.pre { - start, _ := x.Span() - if debug { - fmt.Fprintf(os.Stderr, "pre %T :%d:%d #%d\n", x, start.Line, start.LineRune, start.Byte) - } - xcom := x.Comment() - for len(line) > 0 && start.Byte >= line[0].Start.Byte { - if debug { - fmt.Fprintf(os.Stderr, "ASSIGN LINE %q #%d\n", line[0].Token, line[0].Start.Byte) - } - xcom.Before = append(xcom.Before, line[0]) - line = line[1:] - } - } - - // Remaining line comments go at end of file. - in.file.After = append(in.file.After, line...) - - if debug { - for _, c := range suffix { - fmt.Fprintf(os.Stderr, "SUFFIX %q :%d:%d #%d\n", c.Token, c.Start.Line, c.Start.LineRune, c.Start.Byte) - } - } - - // Assign suffix comments to syntax immediately before. - for i := len(in.post) - 1; i >= 0; i-- { - x := in.post[i] - - start, end := x.Span() - if debug { - fmt.Fprintf(os.Stderr, "post %T :%d:%d #%d :%d:%d #%d\n", x, start.Line, start.LineRune, start.Byte, end.Line, end.LineRune, end.Byte) - } - - // Do not assign suffix comments to end of line block or whole file. - // Instead assign them to the last element inside. - switch x.(type) { - case *FileSyntax: - continue - } - - // Do not assign suffix comments to something that starts - // on an earlier line, so that in - // - // x ( y - // z ) // comment - // - // we assign the comment to z and not to x ( ... ). - if start.Line != end.Line { - continue - } - xcom := x.Comment() - for len(suffix) > 0 && end.Byte <= suffix[len(suffix)-1].Start.Byte { - if debug { - fmt.Fprintf(os.Stderr, "ASSIGN SUFFIX %q #%d\n", suffix[len(suffix)-1].Token, suffix[len(suffix)-1].Start.Byte) - } - xcom.Suffix = append(xcom.Suffix, suffix[len(suffix)-1]) - suffix = suffix[:len(suffix)-1] - } - } - - // We assigned suffix comments in reverse. - // If multiple suffix comments were appended to the same - // expression node, they are now in reverse. Fix that. - for _, x := range in.post { - reverseComments(x.Comment().Suffix) - } - - // Remaining suffix comments go at beginning of file. - in.file.Before = append(in.file.Before, suffix...) -} - -// reverseComments reverses the []Comment list. -func reverseComments(list []Comment) { - for i, j := 0, len(list)-1; i < j; i, j = i+1, j-1 { - list[i], list[j] = list[j], list[i] - } -} - -func (in *input) parseFile() { - in.file = new(FileSyntax) - var cb *CommentBlock - for { - switch in.peek() { - case '\n': - in.lex() - if cb != nil { - in.file.Stmt = append(in.file.Stmt, cb) - cb = nil - } - case _COMMENT: - tok := in.lex() - if cb == nil { - cb = &CommentBlock{Start: tok.pos} - } - com := cb.Comment() - com.Before = append(com.Before, Comment{Start: tok.pos, Token: tok.text}) - case _EOF: - if cb != nil { - in.file.Stmt = append(in.file.Stmt, cb) - } - return - default: - in.parseStmt() - if cb != nil { - in.file.Stmt[len(in.file.Stmt)-1].Comment().Before = cb.Before - cb = nil - } - } - } -} - -func (in *input) parseStmt() { - tok := in.lex() - start := tok.pos - end := tok.endPos - tokens := []string{tok.text} - for { - tok := in.lex() - switch { - case tok.kind.isEOL(): - in.file.Stmt = append(in.file.Stmt, &Line{ - Start: start, - Token: tokens, - End: end, - }) - return - - case tok.kind == '(': - if next := in.peek(); next.isEOL() { - // Start of block: no more tokens on this line. - in.file.Stmt = append(in.file.Stmt, in.parseLineBlock(start, tokens, tok)) - return - } else if next == ')' { - rparen := in.lex() - if in.peek().isEOL() { - // Empty block. - in.lex() - in.file.Stmt = append(in.file.Stmt, &LineBlock{ - Start: start, - Token: tokens, - LParen: LParen{Pos: tok.pos}, - RParen: RParen{Pos: rparen.pos}, - }) - return - } - // '( )' in the middle of the line, not a block. - tokens = append(tokens, tok.text, rparen.text) - } else { - // '(' in the middle of the line, not a block. - tokens = append(tokens, tok.text) - } - - default: - tokens = append(tokens, tok.text) - end = tok.endPos - } - } -} - -func (in *input) parseLineBlock(start Position, token []string, lparen token) *LineBlock { - x := &LineBlock{ - Start: start, - Token: token, - LParen: LParen{Pos: lparen.pos}, - } - var comments []Comment - for { - switch in.peek() { - case _EOLCOMMENT: - // Suffix comment, will be attached later by assignComments. - in.lex() - case '\n': - // Blank line. Add an empty comment to preserve it. - in.lex() - if len(comments) == 0 && len(x.Line) > 0 || len(comments) > 0 && comments[len(comments)-1].Token != "" { - comments = append(comments, Comment{}) - } - case _COMMENT: - tok := in.lex() - comments = append(comments, Comment{Start: tok.pos, Token: tok.text}) - case _EOF: - in.Error(fmt.Sprintf("syntax error (unterminated block started at %s:%d:%d)", in.filename, x.Start.Line, x.Start.LineRune)) - case ')': - rparen := in.lex() - // Don't preserve blank lines (denoted by a single empty comment, added above) - // at the end of the block. - if len(comments) == 1 && comments[0] == (Comment{}) { - comments = nil - } - x.RParen.Before = comments - x.RParen.Pos = rparen.pos - if !in.peek().isEOL() { - in.Error("syntax error (expected newline after closing paren)") - } - in.lex() - return x - default: - l := in.parseLine() - x.Line = append(x.Line, l) - l.Comment().Before = comments - comments = nil - } - } -} - -func (in *input) parseLine() *Line { - tok := in.lex() - if tok.kind.isEOL() { - in.Error("internal parse error: parseLine at end of line") - } - start := tok.pos - end := tok.endPos - tokens := []string{tok.text} - for { - tok := in.lex() - if tok.kind.isEOL() { - return &Line{ - Start: start, - Token: tokens, - End: end, - InBlock: true, - } - } - tokens = append(tokens, tok.text) - end = tok.endPos - } -} - -var ( - slashSlash = []byte("//") - moduleStr = []byte("module") -) - -// ModulePath returns the module path from the gomod file text. -// If it cannot find a module path, it returns an empty string. -// It is tolerant of unrelated problems in the go.mod file. -func ModulePath(mod []byte) string { - for len(mod) > 0 { - line := mod - mod = nil - if i := bytes.IndexByte(line, '\n'); i >= 0 { - line, mod = line[:i], line[i+1:] - } - if i := bytes.Index(line, slashSlash); i >= 0 { - line = line[:i] - } - line = bytes.TrimSpace(line) - if !bytes.HasPrefix(line, moduleStr) { - continue - } - line = line[len(moduleStr):] - n := len(line) - line = bytes.TrimSpace(line) - if len(line) == n || len(line) == 0 { - continue - } - - if line[0] == '"' || line[0] == '`' { - p, err := strconv.Unquote(string(line)) - if err != nil { - return "" // malformed quoted string or multiline module path - } - return p - } - - return string(line) - } - return "" // missing module path -} diff --git a/vendor/golang.org/x/mod/modfile/rule.go b/vendor/golang.org/x/mod/modfile/rule.go deleted file mode 100644 index 3e4a1d0ab4..0000000000 --- a/vendor/golang.org/x/mod/modfile/rule.go +++ /dev/null @@ -1,1836 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package modfile implements a parser and formatter for go.mod files. -// -// The go.mod syntax is described in -// https://pkg.go.dev/cmd/go/#hdr-The_go_mod_file. -// -// The [Parse] and [ParseLax] functions both parse a go.mod file and return an -// abstract syntax tree. ParseLax ignores unknown statements and may be used to -// parse go.mod files that may have been developed with newer versions of Go. -// -// The [File] struct returned by Parse and ParseLax represent an abstract -// go.mod file. File has several methods like [File.AddNewRequire] and -// [File.DropReplace] that can be used to programmatically edit a file. -// -// The [Format] function formats a File back to a byte slice which can be -// written to a file. -package modfile - -import ( - "errors" - "fmt" - "path/filepath" - "sort" - "strconv" - "strings" - "unicode" - - "golang.org/x/mod/internal/lazyregexp" - "golang.org/x/mod/module" - "golang.org/x/mod/semver" -) - -// A File is the parsed, interpreted form of a go.mod file. -type File struct { - Module *Module - Go *Go - Toolchain *Toolchain - Godebug []*Godebug - Require []*Require - Exclude []*Exclude - Replace []*Replace - Retract []*Retract - Tool []*Tool - - Syntax *FileSyntax -} - -// A Module is the module statement. -type Module struct { - Mod module.Version - Deprecated string - Syntax *Line -} - -// A Go is the go statement. -type Go struct { - Version string // "1.23" - Syntax *Line -} - -// A Toolchain is the toolchain statement. -type Toolchain struct { - Name string // "go1.21rc1" - Syntax *Line -} - -// A Godebug is a single godebug key=value statement. -type Godebug struct { - Key string - Value string - Syntax *Line -} - -// An Exclude is a single exclude statement. -type Exclude struct { - Mod module.Version - Syntax *Line -} - -// A Replace is a single replace statement. -type Replace struct { - Old module.Version - New module.Version - Syntax *Line -} - -// A Retract is a single retract statement. -type Retract struct { - VersionInterval - Rationale string - Syntax *Line -} - -// A Tool is a single tool statement. -type Tool struct { - Path string - Syntax *Line -} - -// A VersionInterval represents a range of versions with upper and lower bounds. -// Intervals are closed: both bounds are included. When Low is equal to High, -// the interval may refer to a single version ('v1.2.3') or an interval -// ('[v1.2.3, v1.2.3]'); both have the same representation. -type VersionInterval struct { - Low, High string -} - -// A Require is a single require statement. -type Require struct { - Mod module.Version - Indirect bool // has "// indirect" comment - Syntax *Line -} - -func (r *Require) markRemoved() { - r.Syntax.markRemoved() - *r = Require{} -} - -func (r *Require) setVersion(v string) { - r.Mod.Version = v - - if line := r.Syntax; len(line.Token) > 0 { - if line.InBlock { - // If the line is preceded by an empty line, remove it; see - // https://golang.org/issue/33779. - if len(line.Comments.Before) == 1 && len(line.Comments.Before[0].Token) == 0 { - line.Comments.Before = line.Comments.Before[:0] - } - if len(line.Token) >= 2 { // example.com v1.2.3 - line.Token[1] = v - } - } else { - if len(line.Token) >= 3 { // require example.com v1.2.3 - line.Token[2] = v - } - } - } -} - -// setIndirect sets line to have (or not have) a "// indirect" comment. -func (r *Require) setIndirect(indirect bool) { - r.Indirect = indirect - line := r.Syntax - if isIndirect(line) == indirect { - return - } - if indirect { - // Adding comment. - if len(line.Suffix) == 0 { - // New comment. - line.Suffix = []Comment{{Token: "// indirect", Suffix: true}} - return - } - - com := &line.Suffix[0] - text := strings.TrimSpace(strings.TrimPrefix(com.Token, string(slashSlash))) - if text == "" { - // Empty comment. - com.Token = "// indirect" - return - } - - // Insert at beginning of existing comment. - com.Token = "// indirect; " + text - return - } - - // Removing comment. - f := strings.TrimSpace(strings.TrimPrefix(line.Suffix[0].Token, string(slashSlash))) - if f == "indirect" { - // Remove whole comment. - line.Suffix = nil - return - } - - // Remove comment prefix. - com := &line.Suffix[0] - i := strings.Index(com.Token, "indirect;") - com.Token = "//" + com.Token[i+len("indirect;"):] -} - -// isIndirect reports whether line has a "// indirect" comment, -// meaning it is in go.mod only for its effect on indirect dependencies, -// so that it can be dropped entirely once the effective version of the -// indirect dependency reaches the given minimum version. -func isIndirect(line *Line) bool { - if len(line.Suffix) == 0 { - return false - } - f := strings.Fields(strings.TrimPrefix(line.Suffix[0].Token, string(slashSlash))) - return (len(f) == 1 && f[0] == "indirect" || len(f) > 1 && f[0] == "indirect;") -} - -func (f *File) AddModuleStmt(path string) error { - if f.Syntax == nil { - f.Syntax = new(FileSyntax) - } - if f.Module == nil { - f.Module = &Module{ - Mod: module.Version{Path: path}, - Syntax: f.Syntax.addLine(nil, "module", AutoQuote(path)), - } - } else { - f.Module.Mod.Path = path - f.Syntax.updateLine(f.Module.Syntax, "module", AutoQuote(path)) - } - return nil -} - -func (f *File) AddComment(text string) { - if f.Syntax == nil { - f.Syntax = new(FileSyntax) - } - f.Syntax.Stmt = append(f.Syntax.Stmt, &CommentBlock{ - Comments: Comments{ - Before: []Comment{ - { - Token: text, - }, - }, - }, - }) -} - -type VersionFixer func(path, version string) (string, error) - -// errDontFix is returned by a VersionFixer to indicate the version should be -// left alone, even if it's not canonical. -var dontFixRetract VersionFixer = func(_, vers string) (string, error) { - return vers, nil -} - -// Parse parses and returns a go.mod file. -// -// file is the name of the file, used in positions and errors. -// -// data is the content of the file. -// -// fix is an optional function that canonicalizes module versions. -// If fix is nil, all module versions must be canonical ([module.CanonicalVersion] -// must return the same string). -func Parse(file string, data []byte, fix VersionFixer) (*File, error) { - return parseToFile(file, data, fix, true) -} - -// ParseLax is like Parse but ignores unknown statements. -// It is used when parsing go.mod files other than the main module, -// under the theory that most statement types we add in the future will -// only apply in the main module, like exclude and replace, -// and so we get better gradual deployments if old go commands -// simply ignore those statements when found in go.mod files -// in dependencies. -func ParseLax(file string, data []byte, fix VersionFixer) (*File, error) { - return parseToFile(file, data, fix, false) -} - -func parseToFile(file string, data []byte, fix VersionFixer, strict bool) (parsed *File, err error) { - fs, err := parse(file, data) - if err != nil { - return nil, err - } - f := &File{ - Syntax: fs, - } - var errs ErrorList - - // fix versions in retract directives after the file is parsed. - // We need the module path to fix versions, and it might be at the end. - defer func() { - oldLen := len(errs) - f.fixRetract(fix, &errs) - if len(errs) > oldLen { - parsed, err = nil, errs - } - }() - - for _, x := range fs.Stmt { - switch x := x.(type) { - case *Line: - f.add(&errs, nil, x, x.Token[0], x.Token[1:], fix, strict) - - case *LineBlock: - if len(x.Token) > 1 { - if strict { - errs = append(errs, Error{ - Filename: file, - Pos: x.Start, - Err: fmt.Errorf("unknown block type: %s", strings.Join(x.Token, " ")), - }) - } - continue - } - switch x.Token[0] { - default: - if strict { - errs = append(errs, Error{ - Filename: file, - Pos: x.Start, - Err: fmt.Errorf("unknown block type: %s", strings.Join(x.Token, " ")), - }) - } - continue - case "module", "godebug", "require", "exclude", "replace", "retract", "tool": - for _, l := range x.Line { - f.add(&errs, x, l, x.Token[0], l.Token, fix, strict) - } - } - } - } - - if len(errs) > 0 { - return nil, errs - } - return f, nil -} - -var GoVersionRE = lazyregexp.New(`^([1-9][0-9]*)\.(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))?([a-z]+[0-9]+)?$`) -var laxGoVersionRE = lazyregexp.New(`^v?(([1-9][0-9]*)\.(0|[1-9][0-9]*))([^0-9].*)$`) - -// Toolchains must be named beginning with `go1`, -// like "go1.20.3" or "go1.20.3-gccgo". As a special case, "default" is also permitted. -// Note that this regexp is a much looser condition than go/version.IsValid, -// for forward compatibility. -// (This code has to be work to identify new toolchains even if we tweak the syntax in the future.) -var ToolchainRE = lazyregexp.New(`^default$|^go1($|\.)`) - -func (f *File) add(errs *ErrorList, block *LineBlock, line *Line, verb string, args []string, fix VersionFixer, strict bool) { - // If strict is false, this module is a dependency. - // We ignore all unknown directives as well as main-module-only - // directives like replace and exclude. It will work better for - // forward compatibility if we can depend on modules that have unknown - // statements (presumed relevant only when acting as the main module) - // and simply ignore those statements. - if !strict { - switch verb { - case "go", "module", "retract", "require": - // want these even for dependency go.mods - default: - return - } - } - - wrapModPathError := func(modPath string, err error) { - *errs = append(*errs, Error{ - Filename: f.Syntax.Name, - Pos: line.Start, - ModPath: modPath, - Verb: verb, - Err: err, - }) - } - wrapError := func(err error) { - *errs = append(*errs, Error{ - Filename: f.Syntax.Name, - Pos: line.Start, - Err: err, - }) - } - errorf := func(format string, args ...interface{}) { - wrapError(fmt.Errorf(format, args...)) - } - - switch verb { - default: - errorf("unknown directive: %s", verb) - - case "go": - if f.Go != nil { - errorf("repeated go statement") - return - } - if len(args) != 1 { - errorf("go directive expects exactly one argument") - return - } else if !GoVersionRE.MatchString(args[0]) { - fixed := false - if !strict { - if m := laxGoVersionRE.FindStringSubmatch(args[0]); m != nil { - args[0] = m[1] - fixed = true - } - } - if !fixed { - errorf("invalid go version '%s': must match format 1.23.0", args[0]) - return - } - } - - f.Go = &Go{Syntax: line} - f.Go.Version = args[0] - - case "toolchain": - if f.Toolchain != nil { - errorf("repeated toolchain statement") - return - } - if len(args) != 1 { - errorf("toolchain directive expects exactly one argument") - return - } else if !ToolchainRE.MatchString(args[0]) { - errorf("invalid toolchain version '%s': must match format go1.23.0 or default", args[0]) - return - } - f.Toolchain = &Toolchain{Syntax: line} - f.Toolchain.Name = args[0] - - case "module": - if f.Module != nil { - errorf("repeated module statement") - return - } - deprecated := parseDeprecation(block, line) - f.Module = &Module{ - Syntax: line, - Deprecated: deprecated, - } - if len(args) != 1 { - errorf("usage: module module/path") - return - } - s, err := parseString(&args[0]) - if err != nil { - errorf("invalid quoted string: %v", err) - return - } - f.Module.Mod = module.Version{Path: s} - - case "godebug": - if len(args) != 1 || strings.ContainsAny(args[0], "\"`',") { - errorf("usage: godebug key=value") - return - } - key, value, ok := strings.Cut(args[0], "=") - if !ok { - errorf("usage: godebug key=value") - return - } - f.Godebug = append(f.Godebug, &Godebug{ - Key: key, - Value: value, - Syntax: line, - }) - - case "require", "exclude": - if len(args) != 2 { - errorf("usage: %s module/path v1.2.3", verb) - return - } - s, err := parseString(&args[0]) - if err != nil { - errorf("invalid quoted string: %v", err) - return - } - v, err := parseVersion(verb, s, &args[1], fix) - if err != nil { - wrapError(err) - return - } - pathMajor, err := modulePathMajor(s) - if err != nil { - wrapError(err) - return - } - if err := module.CheckPathMajor(v, pathMajor); err != nil { - wrapModPathError(s, err) - return - } - if verb == "require" { - f.Require = append(f.Require, &Require{ - Mod: module.Version{Path: s, Version: v}, - Syntax: line, - Indirect: isIndirect(line), - }) - } else { - f.Exclude = append(f.Exclude, &Exclude{ - Mod: module.Version{Path: s, Version: v}, - Syntax: line, - }) - } - - case "replace": - replace, wrappederr := parseReplace(f.Syntax.Name, line, verb, args, fix) - if wrappederr != nil { - *errs = append(*errs, *wrappederr) - return - } - f.Replace = append(f.Replace, replace) - - case "retract": - rationale := parseDirectiveComment(block, line) - vi, err := parseVersionInterval(verb, "", &args, dontFixRetract) - if err != nil { - if strict { - wrapError(err) - return - } else { - // Only report errors parsing intervals in the main module. We may - // support additional syntax in the future, such as open and half-open - // intervals. Those can't be supported now, because they break the - // go.mod parser, even in lax mode. - return - } - } - if len(args) > 0 && strict { - // In the future, there may be additional information after the version. - errorf("unexpected token after version: %q", args[0]) - return - } - retract := &Retract{ - VersionInterval: vi, - Rationale: rationale, - Syntax: line, - } - f.Retract = append(f.Retract, retract) - - case "tool": - if len(args) != 1 { - errorf("tool directive expects exactly one argument") - return - } - s, err := parseString(&args[0]) - if err != nil { - errorf("invalid quoted string: %v", err) - return - } - f.Tool = append(f.Tool, &Tool{ - Path: s, - Syntax: line, - }) - } -} - -func parseReplace(filename string, line *Line, verb string, args []string, fix VersionFixer) (*Replace, *Error) { - wrapModPathError := func(modPath string, err error) *Error { - return &Error{ - Filename: filename, - Pos: line.Start, - ModPath: modPath, - Verb: verb, - Err: err, - } - } - wrapError := func(err error) *Error { - return &Error{ - Filename: filename, - Pos: line.Start, - Err: err, - } - } - errorf := func(format string, args ...interface{}) *Error { - return wrapError(fmt.Errorf(format, args...)) - } - - arrow := 2 - if len(args) >= 2 && args[1] == "=>" { - arrow = 1 - } - if len(args) < arrow+2 || len(args) > arrow+3 || args[arrow] != "=>" { - return nil, errorf("usage: %s module/path [v1.2.3] => other/module v1.4\n\t or %s module/path [v1.2.3] => ../local/directory", verb, verb) - } - s, err := parseString(&args[0]) - if err != nil { - return nil, errorf("invalid quoted string: %v", err) - } - pathMajor, err := modulePathMajor(s) - if err != nil { - return nil, wrapModPathError(s, err) - - } - var v string - if arrow == 2 { - v, err = parseVersion(verb, s, &args[1], fix) - if err != nil { - return nil, wrapError(err) - } - if err := module.CheckPathMajor(v, pathMajor); err != nil { - return nil, wrapModPathError(s, err) - } - } - ns, err := parseString(&args[arrow+1]) - if err != nil { - return nil, errorf("invalid quoted string: %v", err) - } - nv := "" - if len(args) == arrow+2 { - if !IsDirectoryPath(ns) { - if strings.Contains(ns, "@") { - return nil, errorf("replacement module must match format 'path version', not 'path@version'") - } - return nil, errorf("replacement module without version must be directory path (rooted or starting with . or ..)") - } - if filepath.Separator == '/' && strings.Contains(ns, `\`) { - return nil, errorf("replacement directory appears to be Windows path (on a non-windows system)") - } - } - if len(args) == arrow+3 { - nv, err = parseVersion(verb, ns, &args[arrow+2], fix) - if err != nil { - return nil, wrapError(err) - } - if IsDirectoryPath(ns) { - return nil, errorf("replacement module directory path %q cannot have version", ns) - } - } - return &Replace{ - Old: module.Version{Path: s, Version: v}, - New: module.Version{Path: ns, Version: nv}, - Syntax: line, - }, nil -} - -// fixRetract applies fix to each retract directive in f, appending any errors -// to errs. -// -// Most versions are fixed as we parse the file, but for retract directives, -// the relevant module path is the one specified with the module directive, -// and that might appear at the end of the file (or not at all). -func (f *File) fixRetract(fix VersionFixer, errs *ErrorList) { - if fix == nil { - return - } - path := "" - if f.Module != nil { - path = f.Module.Mod.Path - } - var r *Retract - wrapError := func(err error) { - *errs = append(*errs, Error{ - Filename: f.Syntax.Name, - Pos: r.Syntax.Start, - Err: err, - }) - } - - for _, r = range f.Retract { - if path == "" { - wrapError(errors.New("no module directive found, so retract cannot be used")) - return // only print the first one of these - } - - args := r.Syntax.Token - if args[0] == "retract" { - args = args[1:] - } - vi, err := parseVersionInterval("retract", path, &args, fix) - if err != nil { - wrapError(err) - } - r.VersionInterval = vi - } -} - -func (f *WorkFile) add(errs *ErrorList, line *Line, verb string, args []string, fix VersionFixer) { - wrapError := func(err error) { - *errs = append(*errs, Error{ - Filename: f.Syntax.Name, - Pos: line.Start, - Err: err, - }) - } - errorf := func(format string, args ...interface{}) { - wrapError(fmt.Errorf(format, args...)) - } - - switch verb { - default: - errorf("unknown directive: %s", verb) - - case "go": - if f.Go != nil { - errorf("repeated go statement") - return - } - if len(args) != 1 { - errorf("go directive expects exactly one argument") - return - } else if !GoVersionRE.MatchString(args[0]) { - errorf("invalid go version '%s': must match format 1.23.0", args[0]) - return - } - - f.Go = &Go{Syntax: line} - f.Go.Version = args[0] - - case "toolchain": - if f.Toolchain != nil { - errorf("repeated toolchain statement") - return - } - if len(args) != 1 { - errorf("toolchain directive expects exactly one argument") - return - } else if !ToolchainRE.MatchString(args[0]) { - errorf("invalid toolchain version '%s': must match format go1.23.0 or default", args[0]) - return - } - - f.Toolchain = &Toolchain{Syntax: line} - f.Toolchain.Name = args[0] - - case "godebug": - if len(args) != 1 || strings.ContainsAny(args[0], "\"`',") { - errorf("usage: godebug key=value") - return - } - key, value, ok := strings.Cut(args[0], "=") - if !ok { - errorf("usage: godebug key=value") - return - } - f.Godebug = append(f.Godebug, &Godebug{ - Key: key, - Value: value, - Syntax: line, - }) - - case "use": - if len(args) != 1 { - errorf("usage: %s local/dir", verb) - return - } - s, err := parseString(&args[0]) - if err != nil { - errorf("invalid quoted string: %v", err) - return - } - f.Use = append(f.Use, &Use{ - Path: s, - Syntax: line, - }) - - case "replace": - replace, wrappederr := parseReplace(f.Syntax.Name, line, verb, args, fix) - if wrappederr != nil { - *errs = append(*errs, *wrappederr) - return - } - f.Replace = append(f.Replace, replace) - } -} - -// IsDirectoryPath reports whether the given path should be interpreted as a directory path. -// Just like on the go command line, relative paths starting with a '.' or '..' path component -// and rooted paths are directory paths; the rest are module paths. -func IsDirectoryPath(ns string) bool { - // Because go.mod files can move from one system to another, - // we check all known path syntaxes, both Unix and Windows. - return ns == "." || strings.HasPrefix(ns, "./") || strings.HasPrefix(ns, `.\`) || - ns == ".." || strings.HasPrefix(ns, "../") || strings.HasPrefix(ns, `..\`) || - strings.HasPrefix(ns, "/") || strings.HasPrefix(ns, `\`) || - len(ns) >= 2 && ('A' <= ns[0] && ns[0] <= 'Z' || 'a' <= ns[0] && ns[0] <= 'z') && ns[1] == ':' -} - -// MustQuote reports whether s must be quoted in order to appear as -// a single token in a go.mod line. -func MustQuote(s string) bool { - for _, r := range s { - switch r { - case ' ', '"', '\'', '`': - return true - - case '(', ')', '[', ']', '{', '}', ',': - if len(s) > 1 { - return true - } - - default: - if !unicode.IsPrint(r) { - return true - } - } - } - return s == "" || strings.Contains(s, "//") || strings.Contains(s, "/*") -} - -// AutoQuote returns s or, if quoting is required for s to appear in a go.mod, -// the quotation of s. -func AutoQuote(s string) string { - if MustQuote(s) { - return strconv.Quote(s) - } - return s -} - -func parseVersionInterval(verb string, path string, args *[]string, fix VersionFixer) (VersionInterval, error) { - toks := *args - if len(toks) == 0 || toks[0] == "(" { - return VersionInterval{}, fmt.Errorf("expected '[' or version") - } - if toks[0] != "[" { - v, err := parseVersion(verb, path, &toks[0], fix) - if err != nil { - return VersionInterval{}, err - } - *args = toks[1:] - return VersionInterval{Low: v, High: v}, nil - } - toks = toks[1:] - - if len(toks) == 0 { - return VersionInterval{}, fmt.Errorf("expected version after '['") - } - low, err := parseVersion(verb, path, &toks[0], fix) - if err != nil { - return VersionInterval{}, err - } - toks = toks[1:] - - if len(toks) == 0 || toks[0] != "," { - return VersionInterval{}, fmt.Errorf("expected ',' after version") - } - toks = toks[1:] - - if len(toks) == 0 { - return VersionInterval{}, fmt.Errorf("expected version after ','") - } - high, err := parseVersion(verb, path, &toks[0], fix) - if err != nil { - return VersionInterval{}, err - } - toks = toks[1:] - - if len(toks) == 0 || toks[0] != "]" { - return VersionInterval{}, fmt.Errorf("expected ']' after version") - } - toks = toks[1:] - - *args = toks - return VersionInterval{Low: low, High: high}, nil -} - -func parseString(s *string) (string, error) { - t := *s - if strings.HasPrefix(t, `"`) { - var err error - if t, err = strconv.Unquote(t); err != nil { - return "", err - } - } else if strings.ContainsAny(t, "\"'`") { - // Other quotes are reserved both for possible future expansion - // and to avoid confusion. For example if someone types 'x' - // we want that to be a syntax error and not a literal x in literal quotation marks. - return "", fmt.Errorf("unquoted string cannot contain quote") - } - *s = AutoQuote(t) - return t, nil -} - -var deprecatedRE = lazyregexp.New(`(?s)(?:^|\n\n)Deprecated: *(.*?)(?:$|\n\n)`) - -// parseDeprecation extracts the text of comments on a "module" directive and -// extracts a deprecation message from that. -// -// A deprecation message is contained in a paragraph within a block of comments -// that starts with "Deprecated:" (case sensitive). The message runs until the -// end of the paragraph and does not include the "Deprecated:" prefix. If the -// comment block has multiple paragraphs that start with "Deprecated:", -// parseDeprecation returns the message from the first. -func parseDeprecation(block *LineBlock, line *Line) string { - text := parseDirectiveComment(block, line) - m := deprecatedRE.FindStringSubmatch(text) - if m == nil { - return "" - } - return m[1] -} - -// parseDirectiveComment extracts the text of comments on a directive. -// If the directive's line does not have comments and is part of a block that -// does have comments, the block's comments are used. -func parseDirectiveComment(block *LineBlock, line *Line) string { - comments := line.Comment() - if block != nil && len(comments.Before) == 0 && len(comments.Suffix) == 0 { - comments = block.Comment() - } - groups := [][]Comment{comments.Before, comments.Suffix} - var lines []string - for _, g := range groups { - for _, c := range g { - if !strings.HasPrefix(c.Token, "//") { - continue // blank line - } - lines = append(lines, strings.TrimSpace(strings.TrimPrefix(c.Token, "//"))) - } - } - return strings.Join(lines, "\n") -} - -type ErrorList []Error - -func (e ErrorList) Error() string { - errStrs := make([]string, len(e)) - for i, err := range e { - errStrs[i] = err.Error() - } - return strings.Join(errStrs, "\n") -} - -type Error struct { - Filename string - Pos Position - Verb string - ModPath string - Err error -} - -func (e *Error) Error() string { - var pos string - if e.Pos.LineRune > 1 { - // Don't print LineRune if it's 1 (beginning of line). - // It's always 1 except in scanner errors, which are rare. - pos = fmt.Sprintf("%s:%d:%d: ", e.Filename, e.Pos.Line, e.Pos.LineRune) - } else if e.Pos.Line > 0 { - pos = fmt.Sprintf("%s:%d: ", e.Filename, e.Pos.Line) - } else if e.Filename != "" { - pos = fmt.Sprintf("%s: ", e.Filename) - } - - var directive string - if e.ModPath != "" { - directive = fmt.Sprintf("%s %s: ", e.Verb, e.ModPath) - } else if e.Verb != "" { - directive = fmt.Sprintf("%s: ", e.Verb) - } - - return pos + directive + e.Err.Error() -} - -func (e *Error) Unwrap() error { return e.Err } - -func parseVersion(verb string, path string, s *string, fix VersionFixer) (string, error) { - t, err := parseString(s) - if err != nil { - return "", &Error{ - Verb: verb, - ModPath: path, - Err: &module.InvalidVersionError{ - Version: *s, - Err: err, - }, - } - } - if fix != nil { - fixed, err := fix(path, t) - if err != nil { - if err, ok := err.(*module.ModuleError); ok { - return "", &Error{ - Verb: verb, - ModPath: path, - Err: err.Err, - } - } - return "", err - } - t = fixed - } else { - cv := module.CanonicalVersion(t) - if cv == "" { - return "", &Error{ - Verb: verb, - ModPath: path, - Err: &module.InvalidVersionError{ - Version: t, - Err: errors.New("must be of the form v1.2.3"), - }, - } - } - t = cv - } - *s = t - return *s, nil -} - -func modulePathMajor(path string) (string, error) { - _, major, ok := module.SplitPathVersion(path) - if !ok { - return "", fmt.Errorf("invalid module path") - } - return major, nil -} - -func (f *File) Format() ([]byte, error) { - return Format(f.Syntax), nil -} - -// Cleanup cleans up the file f after any edit operations. -// To avoid quadratic behavior, modifications like [File.DropRequire] -// clear the entry but do not remove it from the slice. -// Cleanup cleans out all the cleared entries. -func (f *File) Cleanup() { - w := 0 - for _, g := range f.Godebug { - if g.Key != "" { - f.Godebug[w] = g - w++ - } - } - f.Godebug = f.Godebug[:w] - - w = 0 - for _, r := range f.Require { - if r.Mod.Path != "" { - f.Require[w] = r - w++ - } - } - f.Require = f.Require[:w] - - w = 0 - for _, x := range f.Exclude { - if x.Mod.Path != "" { - f.Exclude[w] = x - w++ - } - } - f.Exclude = f.Exclude[:w] - - w = 0 - for _, r := range f.Replace { - if r.Old.Path != "" { - f.Replace[w] = r - w++ - } - } - f.Replace = f.Replace[:w] - - w = 0 - for _, r := range f.Retract { - if r.Low != "" || r.High != "" { - f.Retract[w] = r - w++ - } - } - f.Retract = f.Retract[:w] - - f.Syntax.Cleanup() -} - -func (f *File) AddGoStmt(version string) error { - if !GoVersionRE.MatchString(version) { - return fmt.Errorf("invalid language version %q", version) - } - if f.Go == nil { - var hint Expr - if f.Module != nil && f.Module.Syntax != nil { - hint = f.Module.Syntax - } else if f.Syntax == nil { - f.Syntax = new(FileSyntax) - } - f.Go = &Go{ - Version: version, - Syntax: f.Syntax.addLine(hint, "go", version), - } - } else { - f.Go.Version = version - f.Syntax.updateLine(f.Go.Syntax, "go", version) - } - return nil -} - -// DropGoStmt deletes the go statement from the file. -func (f *File) DropGoStmt() { - if f.Go != nil { - f.Go.Syntax.markRemoved() - f.Go = nil - } -} - -// DropToolchainStmt deletes the toolchain statement from the file. -func (f *File) DropToolchainStmt() { - if f.Toolchain != nil { - f.Toolchain.Syntax.markRemoved() - f.Toolchain = nil - } -} - -func (f *File) AddToolchainStmt(name string) error { - if !ToolchainRE.MatchString(name) { - return fmt.Errorf("invalid toolchain name %q", name) - } - if f.Toolchain == nil { - var hint Expr - if f.Go != nil && f.Go.Syntax != nil { - hint = f.Go.Syntax - } else if f.Module != nil && f.Module.Syntax != nil { - hint = f.Module.Syntax - } - f.Toolchain = &Toolchain{ - Name: name, - Syntax: f.Syntax.addLine(hint, "toolchain", name), - } - } else { - f.Toolchain.Name = name - f.Syntax.updateLine(f.Toolchain.Syntax, "toolchain", name) - } - return nil -} - -// AddGodebug sets the first godebug line for key to value, -// preserving any existing comments for that line and removing all -// other godebug lines for key. -// -// If no line currently exists for key, AddGodebug adds a new line -// at the end of the last godebug block. -func (f *File) AddGodebug(key, value string) error { - need := true - for _, g := range f.Godebug { - if g.Key == key { - if need { - g.Value = value - f.Syntax.updateLine(g.Syntax, "godebug", key+"="+value) - need = false - } else { - g.Syntax.markRemoved() - *g = Godebug{} - } - } - } - - if need { - f.addNewGodebug(key, value) - } - return nil -} - -// addNewGodebug adds a new godebug key=value line at the end -// of the last godebug block, regardless of any existing godebug lines for key. -func (f *File) addNewGodebug(key, value string) { - line := f.Syntax.addLine(nil, "godebug", key+"="+value) - g := &Godebug{ - Key: key, - Value: value, - Syntax: line, - } - f.Godebug = append(f.Godebug, g) -} - -// AddRequire sets the first require line for path to version vers, -// preserving any existing comments for that line and removing all -// other lines for path. -// -// If no line currently exists for path, AddRequire adds a new line -// at the end of the last require block. -func (f *File) AddRequire(path, vers string) error { - need := true - for _, r := range f.Require { - if r.Mod.Path == path { - if need { - r.Mod.Version = vers - f.Syntax.updateLine(r.Syntax, "require", AutoQuote(path), vers) - need = false - } else { - r.Syntax.markRemoved() - *r = Require{} - } - } - } - - if need { - f.AddNewRequire(path, vers, false) - } - return nil -} - -// AddNewRequire adds a new require line for path at version vers at the end of -// the last require block, regardless of any existing require lines for path. -func (f *File) AddNewRequire(path, vers string, indirect bool) { - line := f.Syntax.addLine(nil, "require", AutoQuote(path), vers) - r := &Require{ - Mod: module.Version{Path: path, Version: vers}, - Syntax: line, - } - r.setIndirect(indirect) - f.Require = append(f.Require, r) -} - -// SetRequire updates the requirements of f to contain exactly req, preserving -// the existing block structure and line comment contents (except for 'indirect' -// markings) for the first requirement on each named module path. -// -// The Syntax field is ignored for the requirements in req. -// -// Any requirements not already present in the file are added to the block -// containing the last require line. -// -// The requirements in req must specify at most one distinct version for each -// module path. -// -// If any existing requirements may be removed, the caller should call -// [File.Cleanup] after all edits are complete. -func (f *File) SetRequire(req []*Require) { - type elem struct { - version string - indirect bool - } - need := make(map[string]elem) - for _, r := range req { - if prev, dup := need[r.Mod.Path]; dup && prev.version != r.Mod.Version { - panic(fmt.Errorf("SetRequire called with conflicting versions for path %s (%s and %s)", r.Mod.Path, prev.version, r.Mod.Version)) - } - need[r.Mod.Path] = elem{r.Mod.Version, r.Indirect} - } - - // Update or delete the existing Require entries to preserve - // only the first for each module path in req. - for _, r := range f.Require { - e, ok := need[r.Mod.Path] - if ok { - r.setVersion(e.version) - r.setIndirect(e.indirect) - } else { - r.markRemoved() - } - delete(need, r.Mod.Path) - } - - // Add new entries in the last block of the file for any paths that weren't - // already present. - // - // This step is nondeterministic, but the final result will be deterministic - // because we will sort the block. - for path, e := range need { - f.AddNewRequire(path, e.version, e.indirect) - } - - f.SortBlocks() -} - -// SetRequireSeparateIndirect updates the requirements of f to contain the given -// requirements. Comment contents (except for 'indirect' markings) are retained -// from the first existing requirement for each module path. Like SetRequire, -// SetRequireSeparateIndirect adds requirements for new paths in req, -// updates the version and "// indirect" comment on existing requirements, -// and deletes requirements on paths not in req. Existing duplicate requirements -// are deleted. -// -// As its name suggests, SetRequireSeparateIndirect puts direct and indirect -// requirements into two separate blocks, one containing only direct -// requirements, and the other containing only indirect requirements. -// SetRequireSeparateIndirect may move requirements between these two blocks -// when their indirect markings change. However, SetRequireSeparateIndirect -// won't move requirements from other blocks, especially blocks with comments. -// -// If the file initially has one uncommented block of requirements, -// SetRequireSeparateIndirect will split it into a direct-only and indirect-only -// block. This aids in the transition to separate blocks. -func (f *File) SetRequireSeparateIndirect(req []*Require) { - // hasComments returns whether a line or block has comments - // other than "indirect". - hasComments := func(c Comments) bool { - return len(c.Before) > 0 || len(c.After) > 0 || len(c.Suffix) > 1 || - (len(c.Suffix) == 1 && - strings.TrimSpace(strings.TrimPrefix(c.Suffix[0].Token, string(slashSlash))) != "indirect") - } - - // moveReq adds r to block. If r was in another block, moveReq deletes - // it from that block and transfers its comments. - moveReq := func(r *Require, block *LineBlock) { - var line *Line - if r.Syntax == nil { - line = &Line{Token: []string{AutoQuote(r.Mod.Path), r.Mod.Version}} - r.Syntax = line - if r.Indirect { - r.setIndirect(true) - } - } else { - line = new(Line) - *line = *r.Syntax - if !line.InBlock && len(line.Token) > 0 && line.Token[0] == "require" { - line.Token = line.Token[1:] - } - r.Syntax.Token = nil // Cleanup will delete the old line. - r.Syntax = line - } - line.InBlock = true - block.Line = append(block.Line, line) - } - - // Examine existing require lines and blocks. - var ( - // We may insert new requirements into the last uncommented - // direct-only and indirect-only blocks. We may also move requirements - // to the opposite block if their indirect markings change. - lastDirectIndex = -1 - lastIndirectIndex = -1 - - // If there are no direct-only or indirect-only blocks, a new block may - // be inserted after the last require line or block. - lastRequireIndex = -1 - - // If there's only one require line or block, and it's uncommented, - // we'll move its requirements to the direct-only or indirect-only blocks. - requireLineOrBlockCount = 0 - - // Track the block each requirement belongs to (if any) so we can - // move them later. - lineToBlock = make(map[*Line]*LineBlock) - ) - for i, stmt := range f.Syntax.Stmt { - switch stmt := stmt.(type) { - case *Line: - if len(stmt.Token) == 0 || stmt.Token[0] != "require" { - continue - } - lastRequireIndex = i - requireLineOrBlockCount++ - if !hasComments(stmt.Comments) { - if isIndirect(stmt) { - lastIndirectIndex = i - } else { - lastDirectIndex = i - } - } - - case *LineBlock: - if len(stmt.Token) == 0 || stmt.Token[0] != "require" { - continue - } - lastRequireIndex = i - requireLineOrBlockCount++ - allDirect := len(stmt.Line) > 0 && !hasComments(stmt.Comments) - allIndirect := len(stmt.Line) > 0 && !hasComments(stmt.Comments) - for _, line := range stmt.Line { - lineToBlock[line] = stmt - if hasComments(line.Comments) { - allDirect = false - allIndirect = false - } else if isIndirect(line) { - allDirect = false - } else { - allIndirect = false - } - } - if allDirect { - lastDirectIndex = i - } - if allIndirect { - lastIndirectIndex = i - } - } - } - - oneFlatUncommentedBlock := requireLineOrBlockCount == 1 && - !hasComments(*f.Syntax.Stmt[lastRequireIndex].Comment()) - - // Create direct and indirect blocks if needed. Convert lines into blocks - // if needed. If we end up with an empty block or a one-line block, - // Cleanup will delete it or convert it to a line later. - insertBlock := func(i int) *LineBlock { - block := &LineBlock{Token: []string{"require"}} - f.Syntax.Stmt = append(f.Syntax.Stmt, nil) - copy(f.Syntax.Stmt[i+1:], f.Syntax.Stmt[i:]) - f.Syntax.Stmt[i] = block - return block - } - - ensureBlock := func(i int) *LineBlock { - switch stmt := f.Syntax.Stmt[i].(type) { - case *LineBlock: - return stmt - case *Line: - block := &LineBlock{ - Token: []string{"require"}, - Line: []*Line{stmt}, - } - stmt.Token = stmt.Token[1:] // remove "require" - stmt.InBlock = true - f.Syntax.Stmt[i] = block - return block - default: - panic(fmt.Sprintf("unexpected statement: %v", stmt)) - } - } - - var lastDirectBlock *LineBlock - if lastDirectIndex < 0 { - if lastIndirectIndex >= 0 { - lastDirectIndex = lastIndirectIndex - lastIndirectIndex++ - } else if lastRequireIndex >= 0 { - lastDirectIndex = lastRequireIndex + 1 - } else { - lastDirectIndex = len(f.Syntax.Stmt) - } - lastDirectBlock = insertBlock(lastDirectIndex) - } else { - lastDirectBlock = ensureBlock(lastDirectIndex) - } - - var lastIndirectBlock *LineBlock - if lastIndirectIndex < 0 { - lastIndirectIndex = lastDirectIndex + 1 - lastIndirectBlock = insertBlock(lastIndirectIndex) - } else { - lastIndirectBlock = ensureBlock(lastIndirectIndex) - } - - // Delete requirements we don't want anymore. - // Update versions and indirect comments on requirements we want to keep. - // If a requirement is in last{Direct,Indirect}Block with the wrong - // indirect marking after this, or if the requirement is in an single - // uncommented mixed block (oneFlatUncommentedBlock), move it to the - // correct block. - // - // Some blocks may be empty after this. Cleanup will remove them. - need := make(map[string]*Require) - for _, r := range req { - need[r.Mod.Path] = r - } - have := make(map[string]*Require) - for _, r := range f.Require { - path := r.Mod.Path - if need[path] == nil || have[path] != nil { - // Requirement not needed, or duplicate requirement. Delete. - r.markRemoved() - continue - } - have[r.Mod.Path] = r - r.setVersion(need[path].Mod.Version) - r.setIndirect(need[path].Indirect) - if need[path].Indirect && - (oneFlatUncommentedBlock || lineToBlock[r.Syntax] == lastDirectBlock) { - moveReq(r, lastIndirectBlock) - } else if !need[path].Indirect && - (oneFlatUncommentedBlock || lineToBlock[r.Syntax] == lastIndirectBlock) { - moveReq(r, lastDirectBlock) - } - } - - // Add new requirements. - for path, r := range need { - if have[path] == nil { - if r.Indirect { - moveReq(r, lastIndirectBlock) - } else { - moveReq(r, lastDirectBlock) - } - f.Require = append(f.Require, r) - } - } - - f.SortBlocks() -} - -func (f *File) DropGodebug(key string) error { - for _, g := range f.Godebug { - if g.Key == key { - g.Syntax.markRemoved() - *g = Godebug{} - } - } - return nil -} - -func (f *File) DropRequire(path string) error { - for _, r := range f.Require { - if r.Mod.Path == path { - r.Syntax.markRemoved() - *r = Require{} - } - } - return nil -} - -// AddExclude adds a exclude statement to the mod file. Errors if the provided -// version is not a canonical version string -func (f *File) AddExclude(path, vers string) error { - if err := checkCanonicalVersion(path, vers); err != nil { - return err - } - - var hint *Line - for _, x := range f.Exclude { - if x.Mod.Path == path && x.Mod.Version == vers { - return nil - } - if x.Mod.Path == path { - hint = x.Syntax - } - } - - f.Exclude = append(f.Exclude, &Exclude{Mod: module.Version{Path: path, Version: vers}, Syntax: f.Syntax.addLine(hint, "exclude", AutoQuote(path), vers)}) - return nil -} - -func (f *File) DropExclude(path, vers string) error { - for _, x := range f.Exclude { - if x.Mod.Path == path && x.Mod.Version == vers { - x.Syntax.markRemoved() - *x = Exclude{} - } - } - return nil -} - -func (f *File) AddReplace(oldPath, oldVers, newPath, newVers string) error { - return addReplace(f.Syntax, &f.Replace, oldPath, oldVers, newPath, newVers) -} - -func addReplace(syntax *FileSyntax, replace *[]*Replace, oldPath, oldVers, newPath, newVers string) error { - need := true - old := module.Version{Path: oldPath, Version: oldVers} - new := module.Version{Path: newPath, Version: newVers} - tokens := []string{"replace", AutoQuote(oldPath)} - if oldVers != "" { - tokens = append(tokens, oldVers) - } - tokens = append(tokens, "=>", AutoQuote(newPath)) - if newVers != "" { - tokens = append(tokens, newVers) - } - - var hint *Line - for _, r := range *replace { - if r.Old.Path == oldPath && (oldVers == "" || r.Old.Version == oldVers) { - if need { - // Found replacement for old; update to use new. - r.New = new - syntax.updateLine(r.Syntax, tokens...) - need = false - continue - } - // Already added; delete other replacements for same. - r.Syntax.markRemoved() - *r = Replace{} - } - if r.Old.Path == oldPath { - hint = r.Syntax - } - } - if need { - *replace = append(*replace, &Replace{Old: old, New: new, Syntax: syntax.addLine(hint, tokens...)}) - } - return nil -} - -func (f *File) DropReplace(oldPath, oldVers string) error { - for _, r := range f.Replace { - if r.Old.Path == oldPath && r.Old.Version == oldVers { - r.Syntax.markRemoved() - *r = Replace{} - } - } - return nil -} - -// AddRetract adds a retract statement to the mod file. Errors if the provided -// version interval does not consist of canonical version strings -func (f *File) AddRetract(vi VersionInterval, rationale string) error { - var path string - if f.Module != nil { - path = f.Module.Mod.Path - } - if err := checkCanonicalVersion(path, vi.High); err != nil { - return err - } - if err := checkCanonicalVersion(path, vi.Low); err != nil { - return err - } - - r := &Retract{ - VersionInterval: vi, - } - if vi.Low == vi.High { - r.Syntax = f.Syntax.addLine(nil, "retract", AutoQuote(vi.Low)) - } else { - r.Syntax = f.Syntax.addLine(nil, "retract", "[", AutoQuote(vi.Low), ",", AutoQuote(vi.High), "]") - } - if rationale != "" { - for _, line := range strings.Split(rationale, "\n") { - com := Comment{Token: "// " + line} - r.Syntax.Comment().Before = append(r.Syntax.Comment().Before, com) - } - } - return nil -} - -func (f *File) DropRetract(vi VersionInterval) error { - for _, r := range f.Retract { - if r.VersionInterval == vi { - r.Syntax.markRemoved() - *r = Retract{} - } - } - return nil -} - -// AddTool adds a new tool directive with the given path. -// It does nothing if the tool line already exists. -func (f *File) AddTool(path string) error { - for _, t := range f.Tool { - if t.Path == path { - return nil - } - } - - f.Tool = append(f.Tool, &Tool{ - Path: path, - Syntax: f.Syntax.addLine(nil, "tool", path), - }) - - f.SortBlocks() - return nil -} - -// RemoveTool removes a tool directive with the given path. -// It does nothing if no such tool directive exists. -func (f *File) DropTool(path string) error { - for _, t := range f.Tool { - if t.Path == path { - t.Syntax.markRemoved() - *t = Tool{} - } - } - return nil -} - -func (f *File) SortBlocks() { - f.removeDups() // otherwise sorting is unsafe - - // semanticSortForExcludeVersionV is the Go version (plus leading "v") at which - // lines in exclude blocks start to use semantic sort instead of lexicographic sort. - // See go.dev/issue/60028. - const semanticSortForExcludeVersionV = "v1.21" - useSemanticSortForExclude := f.Go != nil && semver.Compare("v"+f.Go.Version, semanticSortForExcludeVersionV) >= 0 - - for _, stmt := range f.Syntax.Stmt { - block, ok := stmt.(*LineBlock) - if !ok { - continue - } - less := lineLess - if block.Token[0] == "exclude" && useSemanticSortForExclude { - less = lineExcludeLess - } else if block.Token[0] == "retract" { - less = lineRetractLess - } - sort.SliceStable(block.Line, func(i, j int) bool { - return less(block.Line[i], block.Line[j]) - }) - } -} - -// removeDups removes duplicate exclude, replace and tool directives. -// -// Earlier exclude and tool directives take priority. -// -// Later replace directives take priority. -// -// require directives are not de-duplicated. That's left up to higher-level -// logic (MVS). -// -// retract directives are not de-duplicated since comments are -// meaningful, and versions may be retracted multiple times. -func (f *File) removeDups() { - removeDups(f.Syntax, &f.Exclude, &f.Replace, &f.Tool) -} - -func removeDups(syntax *FileSyntax, exclude *[]*Exclude, replace *[]*Replace, tool *[]*Tool) { - kill := make(map[*Line]bool) - - // Remove duplicate excludes. - if exclude != nil { - haveExclude := make(map[module.Version]bool) - for _, x := range *exclude { - if haveExclude[x.Mod] { - kill[x.Syntax] = true - continue - } - haveExclude[x.Mod] = true - } - var excl []*Exclude - for _, x := range *exclude { - if !kill[x.Syntax] { - excl = append(excl, x) - } - } - *exclude = excl - } - - // Remove duplicate replacements. - // Later replacements take priority over earlier ones. - haveReplace := make(map[module.Version]bool) - for i := len(*replace) - 1; i >= 0; i-- { - x := (*replace)[i] - if haveReplace[x.Old] { - kill[x.Syntax] = true - continue - } - haveReplace[x.Old] = true - } - var repl []*Replace - for _, x := range *replace { - if !kill[x.Syntax] { - repl = append(repl, x) - } - } - *replace = repl - - if tool != nil { - haveTool := make(map[string]bool) - for _, t := range *tool { - if haveTool[t.Path] { - kill[t.Syntax] = true - continue - } - haveTool[t.Path] = true - } - var newTool []*Tool - for _, t := range *tool { - if !kill[t.Syntax] { - newTool = append(newTool, t) - } - } - *tool = newTool - } - - // Duplicate require and retract directives are not removed. - - // Drop killed statements from the syntax tree. - var stmts []Expr - for _, stmt := range syntax.Stmt { - switch stmt := stmt.(type) { - case *Line: - if kill[stmt] { - continue - } - case *LineBlock: - var lines []*Line - for _, line := range stmt.Line { - if !kill[line] { - lines = append(lines, line) - } - } - stmt.Line = lines - if len(lines) == 0 { - continue - } - } - stmts = append(stmts, stmt) - } - syntax.Stmt = stmts -} - -// lineLess returns whether li should be sorted before lj. It sorts -// lexicographically without assigning any special meaning to tokens. -func lineLess(li, lj *Line) bool { - for k := 0; k < len(li.Token) && k < len(lj.Token); k++ { - if li.Token[k] != lj.Token[k] { - return li.Token[k] < lj.Token[k] - } - } - return len(li.Token) < len(lj.Token) -} - -// lineExcludeLess reports whether li should be sorted before lj for lines in -// an "exclude" block. -func lineExcludeLess(li, lj *Line) bool { - if len(li.Token) != 2 || len(lj.Token) != 2 { - // Not a known exclude specification. - // Fall back to sorting lexicographically. - return lineLess(li, lj) - } - // An exclude specification has two tokens: ModulePath and Version. - // Compare module path by string order and version by semver rules. - if pi, pj := li.Token[0], lj.Token[0]; pi != pj { - return pi < pj - } - return semver.Compare(li.Token[1], lj.Token[1]) < 0 -} - -// lineRetractLess returns whether li should be sorted before lj for lines in -// a "retract" block. It treats each line as a version interval. Single versions -// are compared as if they were intervals with the same low and high version. -// Intervals are sorted in descending order, first by low version, then by -// high version, using semver.Compare. -func lineRetractLess(li, lj *Line) bool { - interval := func(l *Line) VersionInterval { - if len(l.Token) == 1 { - return VersionInterval{Low: l.Token[0], High: l.Token[0]} - } else if len(l.Token) == 5 && l.Token[0] == "[" && l.Token[2] == "," && l.Token[4] == "]" { - return VersionInterval{Low: l.Token[1], High: l.Token[3]} - } else { - // Line in unknown format. Treat as an invalid version. - return VersionInterval{} - } - } - vii := interval(li) - vij := interval(lj) - if cmp := semver.Compare(vii.Low, vij.Low); cmp != 0 { - return cmp > 0 - } - return semver.Compare(vii.High, vij.High) > 0 -} - -// checkCanonicalVersion returns a non-nil error if vers is not a canonical -// version string or does not match the major version of path. -// -// If path is non-empty, the error text suggests a format with a major version -// corresponding to the path. -func checkCanonicalVersion(path, vers string) error { - _, pathMajor, pathMajorOk := module.SplitPathVersion(path) - - if vers == "" || vers != module.CanonicalVersion(vers) { - if pathMajor == "" { - return &module.InvalidVersionError{ - Version: vers, - Err: fmt.Errorf("must be of the form v1.2.3"), - } - } - return &module.InvalidVersionError{ - Version: vers, - Err: fmt.Errorf("must be of the form %s.2.3", module.PathMajorPrefix(pathMajor)), - } - } - - if pathMajorOk { - if err := module.CheckPathMajor(vers, pathMajor); err != nil { - if pathMajor == "" { - // In this context, the user probably wrote "v2.3.4" when they meant - // "v2.3.4+incompatible". Suggest that instead of "v0 or v1". - return &module.InvalidVersionError{ - Version: vers, - Err: fmt.Errorf("should be %s+incompatible (or module %s/%v)", vers, path, semver.Major(vers)), - } - } - return err - } - } - - return nil -} diff --git a/vendor/golang.org/x/mod/modfile/work.go b/vendor/golang.org/x/mod/modfile/work.go deleted file mode 100644 index 5387d0c265..0000000000 --- a/vendor/golang.org/x/mod/modfile/work.go +++ /dev/null @@ -1,335 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package modfile - -import ( - "fmt" - "sort" - "strings" -) - -// A WorkFile is the parsed, interpreted form of a go.work file. -type WorkFile struct { - Go *Go - Toolchain *Toolchain - Godebug []*Godebug - Use []*Use - Replace []*Replace - - Syntax *FileSyntax -} - -// A Use is a single directory statement. -type Use struct { - Path string // Use path of module. - ModulePath string // Module path in the comment. - Syntax *Line -} - -// ParseWork parses and returns a go.work file. -// -// file is the name of the file, used in positions and errors. -// -// data is the content of the file. -// -// fix is an optional function that canonicalizes module versions. -// If fix is nil, all module versions must be canonical ([module.CanonicalVersion] -// must return the same string). -func ParseWork(file string, data []byte, fix VersionFixer) (*WorkFile, error) { - fs, err := parse(file, data) - if err != nil { - return nil, err - } - f := &WorkFile{ - Syntax: fs, - } - var errs ErrorList - - for _, x := range fs.Stmt { - switch x := x.(type) { - case *Line: - f.add(&errs, x, x.Token[0], x.Token[1:], fix) - - case *LineBlock: - if len(x.Token) > 1 { - errs = append(errs, Error{ - Filename: file, - Pos: x.Start, - Err: fmt.Errorf("unknown block type: %s", strings.Join(x.Token, " ")), - }) - continue - } - switch x.Token[0] { - default: - errs = append(errs, Error{ - Filename: file, - Pos: x.Start, - Err: fmt.Errorf("unknown block type: %s", strings.Join(x.Token, " ")), - }) - continue - case "godebug", "use", "replace": - for _, l := range x.Line { - f.add(&errs, l, x.Token[0], l.Token, fix) - } - } - } - } - - if len(errs) > 0 { - return nil, errs - } - return f, nil -} - -// Cleanup cleans up the file f after any edit operations. -// To avoid quadratic behavior, modifications like [WorkFile.DropRequire] -// clear the entry but do not remove it from the slice. -// Cleanup cleans out all the cleared entries. -func (f *WorkFile) Cleanup() { - w := 0 - for _, r := range f.Use { - if r.Path != "" { - f.Use[w] = r - w++ - } - } - f.Use = f.Use[:w] - - w = 0 - for _, r := range f.Replace { - if r.Old.Path != "" { - f.Replace[w] = r - w++ - } - } - f.Replace = f.Replace[:w] - - f.Syntax.Cleanup() -} - -func (f *WorkFile) AddGoStmt(version string) error { - if !GoVersionRE.MatchString(version) { - return fmt.Errorf("invalid language version %q", version) - } - if f.Go == nil { - stmt := &Line{Token: []string{"go", version}} - f.Go = &Go{ - Version: version, - Syntax: stmt, - } - // Find the first non-comment-only block and add - // the go statement before it. That will keep file comments at the top. - i := 0 - for i = 0; i < len(f.Syntax.Stmt); i++ { - if _, ok := f.Syntax.Stmt[i].(*CommentBlock); !ok { - break - } - } - f.Syntax.Stmt = append(append(f.Syntax.Stmt[:i:i], stmt), f.Syntax.Stmt[i:]...) - } else { - f.Go.Version = version - f.Syntax.updateLine(f.Go.Syntax, "go", version) - } - return nil -} - -func (f *WorkFile) AddToolchainStmt(name string) error { - if !ToolchainRE.MatchString(name) { - return fmt.Errorf("invalid toolchain name %q", name) - } - if f.Toolchain == nil { - stmt := &Line{Token: []string{"toolchain", name}} - f.Toolchain = &Toolchain{ - Name: name, - Syntax: stmt, - } - // Find the go line and add the toolchain line after it. - // Or else find the first non-comment-only block and add - // the toolchain line before it. That will keep file comments at the top. - i := 0 - for i = 0; i < len(f.Syntax.Stmt); i++ { - if line, ok := f.Syntax.Stmt[i].(*Line); ok && len(line.Token) > 0 && line.Token[0] == "go" { - i++ - goto Found - } - } - for i = 0; i < len(f.Syntax.Stmt); i++ { - if _, ok := f.Syntax.Stmt[i].(*CommentBlock); !ok { - break - } - } - Found: - f.Syntax.Stmt = append(append(f.Syntax.Stmt[:i:i], stmt), f.Syntax.Stmt[i:]...) - } else { - f.Toolchain.Name = name - f.Syntax.updateLine(f.Toolchain.Syntax, "toolchain", name) - } - return nil -} - -// DropGoStmt deletes the go statement from the file. -func (f *WorkFile) DropGoStmt() { - if f.Go != nil { - f.Go.Syntax.markRemoved() - f.Go = nil - } -} - -// DropToolchainStmt deletes the toolchain statement from the file. -func (f *WorkFile) DropToolchainStmt() { - if f.Toolchain != nil { - f.Toolchain.Syntax.markRemoved() - f.Toolchain = nil - } -} - -// AddGodebug sets the first godebug line for key to value, -// preserving any existing comments for that line and removing all -// other godebug lines for key. -// -// If no line currently exists for key, AddGodebug adds a new line -// at the end of the last godebug block. -func (f *WorkFile) AddGodebug(key, value string) error { - need := true - for _, g := range f.Godebug { - if g.Key == key { - if need { - g.Value = value - f.Syntax.updateLine(g.Syntax, "godebug", key+"="+value) - need = false - } else { - g.Syntax.markRemoved() - *g = Godebug{} - } - } - } - - if need { - f.addNewGodebug(key, value) - } - return nil -} - -// addNewGodebug adds a new godebug key=value line at the end -// of the last godebug block, regardless of any existing godebug lines for key. -func (f *WorkFile) addNewGodebug(key, value string) { - line := f.Syntax.addLine(nil, "godebug", key+"="+value) - g := &Godebug{ - Key: key, - Value: value, - Syntax: line, - } - f.Godebug = append(f.Godebug, g) -} - -func (f *WorkFile) DropGodebug(key string) error { - for _, g := range f.Godebug { - if g.Key == key { - g.Syntax.markRemoved() - *g = Godebug{} - } - } - return nil -} - -func (f *WorkFile) AddUse(diskPath, modulePath string) error { - need := true - for _, d := range f.Use { - if d.Path == diskPath { - if need { - d.ModulePath = modulePath - f.Syntax.updateLine(d.Syntax, "use", AutoQuote(diskPath)) - need = false - } else { - d.Syntax.markRemoved() - *d = Use{} - } - } - } - - if need { - f.AddNewUse(diskPath, modulePath) - } - return nil -} - -func (f *WorkFile) AddNewUse(diskPath, modulePath string) { - line := f.Syntax.addLine(nil, "use", AutoQuote(diskPath)) - f.Use = append(f.Use, &Use{Path: diskPath, ModulePath: modulePath, Syntax: line}) -} - -func (f *WorkFile) SetUse(dirs []*Use) { - need := make(map[string]string) - for _, d := range dirs { - need[d.Path] = d.ModulePath - } - - for _, d := range f.Use { - if modulePath, ok := need[d.Path]; ok { - d.ModulePath = modulePath - } else { - d.Syntax.markRemoved() - *d = Use{} - } - } - - // TODO(#45713): Add module path to comment. - - for diskPath, modulePath := range need { - f.AddNewUse(diskPath, modulePath) - } - f.SortBlocks() -} - -func (f *WorkFile) DropUse(path string) error { - for _, d := range f.Use { - if d.Path == path { - d.Syntax.markRemoved() - *d = Use{} - } - } - return nil -} - -func (f *WorkFile) AddReplace(oldPath, oldVers, newPath, newVers string) error { - return addReplace(f.Syntax, &f.Replace, oldPath, oldVers, newPath, newVers) -} - -func (f *WorkFile) DropReplace(oldPath, oldVers string) error { - for _, r := range f.Replace { - if r.Old.Path == oldPath && r.Old.Version == oldVers { - r.Syntax.markRemoved() - *r = Replace{} - } - } - return nil -} - -func (f *WorkFile) SortBlocks() { - f.removeDups() // otherwise sorting is unsafe - - for _, stmt := range f.Syntax.Stmt { - block, ok := stmt.(*LineBlock) - if !ok { - continue - } - sort.SliceStable(block.Line, func(i, j int) bool { - return lineLess(block.Line[i], block.Line[j]) - }) - } -} - -// removeDups removes duplicate replace directives. -// -// Later replace directives take priority. -// -// require directives are not de-duplicated. That's left up to higher-level -// logic (MVS). -// -// retract directives are not de-duplicated since comments are -// meaningful, and versions may be retracted multiple times. -func (f *WorkFile) removeDups() { - removeDups(f.Syntax, nil, &f.Replace, nil) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 1ed928f42a..d4afd5c534 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -936,6 +936,32 @@ github.com/moby/ipvs # github.com/moby/locker v1.0.1 ## explicit; go 1.13 github.com/moby/locker +# github.com/moby/moby/api v0.0.0 => ./api +## explicit; go 1.23.0 +github.com/moby/moby/api +github.com/moby/moby/api/types +github.com/moby/moby/api/types/auxprogress +github.com/moby/moby/api/types/backend +github.com/moby/moby/api/types/blkiodev +github.com/moby/moby/api/types/build +github.com/moby/moby/api/types/checkpoint +github.com/moby/moby/api/types/common +github.com/moby/moby/api/types/container +github.com/moby/moby/api/types/events +github.com/moby/moby/api/types/filters +github.com/moby/moby/api/types/image +github.com/moby/moby/api/types/mount +github.com/moby/moby/api/types/network +github.com/moby/moby/api/types/plugins/logdriver +github.com/moby/moby/api/types/registry +github.com/moby/moby/api/types/storage +github.com/moby/moby/api/types/strslice +github.com/moby/moby/api/types/swarm +github.com/moby/moby/api/types/swarm/runtime +github.com/moby/moby/api/types/system +github.com/moby/moby/api/types/time +github.com/moby/moby/api/types/versions +github.com/moby/moby/api/types/volume # github.com/moby/patternmatcher v0.6.0 ## explicit; go 1.19 github.com/moby/patternmatcher @@ -1434,7 +1460,6 @@ golang.org/x/crypto/ssh/internal/bcrypt_pbkdf # golang.org/x/mod v0.24.0 ## explicit; go 1.23.0 golang.org/x/mod/internal/lazyregexp -golang.org/x/mod/modfile golang.org/x/mod/module golang.org/x/mod/semver # golang.org/x/net v0.39.0 @@ -1723,3 +1748,4 @@ tags.cncf.io/container-device-interface/pkg/parser # tags.cncf.io/container-device-interface/specs-go v1.0.0 ## explicit; go 1.19 tags.cncf.io/container-device-interface/specs-go +# github.com/moby/moby/api => ./api