ansible / ansible-container

DEPRECATED -- Ansible Container was a tool to build Docker images and orchestrate containers using only Ansible playbooks.
GNU Lesser General Public License v3.0
2.19k stars 394 forks source link

Pushing to a Private Repo that does not require login #911

Open treyd opened 6 years ago

treyd commented 6 years ago
ISSUE TYPE
OS / ENVIRONMENT
Ansible Container, version 0.9.2
Darwin, Bubo.local, 17.4.0, Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64, x86_64
2.7.9 (default, Apr  7 2015, 07:58:25)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] /Users/trey/venv/docker-curator-cron/bin/python2.7
{
  "ContainersPaused": 0,
  "Labels": [],
  "CgroupDriver": "cgroupfs",
  "ContainersRunning": 0,
  "ContainerdCommit": {
    "Expected": "cfd04396dc68220d1cecbe686a6cc3aa5ce3667c",
    "ID": "cfd04396dc68220d1cecbe686a6cc3aa5ce3667c"
  },
  "InitBinary": "docker-init",
  "NGoroutines": 150,
  "Swarm": {
    "Managers": 1,
    "ControlAvailable": true,
    "NodeID": "7u3emjuybpbsvypk4op1xqu4f",
    "Cluster": {
      "RootRotationInProgress": false,
      "TLSInfo": {
        "CertIssuerSubject": "MBMxETAPBgNVBAMTCHN3YXJtLWNh",
        "CertIssuerPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAErWuf5TDtJ/a+d8/dbiieo9andAyO9dy2hgyQF/Hsk9aULhOBnK15oqoQOaA5e9uh5iC1dNAL6Wt39qmgdm63tw==",
        "TrustRoot": "-----BEGIN CERTIFICATE-----\nMIIBazCCARCgAwIBAgIUAsS2bkBw+BI3zGv1joX59T8WNn8wCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcxMTE0MTcxMDAwWhcNMzcxMTA5MTcx\nMDAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABK1rn+Uw7Sf2vnfP3W4onqPWp3QMjvXctoYMkBfx7JPWlC4TgZyteaKqEDmg\nOXvboeYgtXTQC+lrd/apoHZut7ejQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBR/yDg8+K/uFMjYCRmJGBlAquI8ajAKBggqhkjO\nPQQDAgNJADBGAiEAkoWbx66ivVUaNw7/w8IbNJ1tx0ffeGdmI53969GIavoCIQDE\nwNzw/u56RM60uQtOi5oTQs7bFJRu6EwuOh/1bfAYTg==\n-----END CERTIFICATE-----\n"
      },
      "ID": "lkc7v5o9bde5chc1k1yg12efy",
      "Version": {
        "Index": 673
      },
      "UpdatedAt": "2018-04-03T15:10:23.8044808Z",
      "Spec": {
        "Name": "default",
        "Labels": {},
        "TaskDefaults": {},
        "Orchestration": {
          "TaskHistoryRetentionLimit": 5
        },
        "EncryptionConfig": {
          "AutoLockManagers": false
        },
        "Raft": {
          "HeartbeatTick": 1,
          "LogEntriesForSlowFollowers": 500,
          "KeepOldSnapshots": 0,
          "ElectionTick": 3,
          "SnapshotInterval": 10000
        },
        "CAConfig": {
          "NodeCertExpiry": 7776000000000000
        },
        "Dispatcher": {
          "HeartbeatPeriod": 5000000000
        }
      },
      "CreatedAt": "2017-11-14T17:15:03.802713593Z"
    },
    "Nodes": 1,
    "Error": "",
    "RemoteManagers": [
      {
        "NodeID": "7u3emjuybpbsvypk4op1xqu4f",
        "Addr": "192.168.65.2:2377"
      }
    ],
    "LocalNodeState": "active",
    "NodeAddr": "192.168.65.2"
  },
  "LoggingDriver": "json-file",
  "OSType": "linux",
  "HttpProxy": "docker.for.mac.http.internal:3128",
  "Runtimes": {
    "runc": {
      "path": "docker-runc"
    }
  },
  "DriverStatus": [
    [
      "Root Dir",
      "/var/lib/docker/aufs"
    ],
    [
      "Backing Filesystem",
      "extfs"
    ],
    [
      "Dirs",
      "234"
    ],
    [
      "Dirperm1 Supported",
      "true"
    ]
  ],
  "OperatingSystem": "Docker for Mac",
  "Containers": 9,
  "HttpsProxy": "docker.for.mac.http.internal:3129",
  "BridgeNfIp6tables": true,
  "MemTotal": 2096066560,
  "SecurityOptions": [
    "name=seccomp,profile=default"
  ],
  "Driver": "aufs",
  "IndexServerAddress": "https://index.docker.io/v1/",
  "ClusterStore": "",
  "InitCommit": {
    "Expected": "949e6fa",
    "ID": "949e6fa"
  },
  "GenericResources": null,
  "Isolation": "",
  "SystemStatus": null,
  "OomKillDisable": true,
  "ClusterAdvertise": "",
  "SystemTime": "2018-04-03T23:43:20.4142866Z",
  "Name": "linuxkit-025000000001",
  "CPUSet": true,
  "RegistryConfig": {
    "AllowNondistributableArtifactsCIDRs": [],
    "Mirrors": [],
    "IndexConfigs": {
      "docker.io": {
        "Official": true,
        "Name": "docker.io",
        "Secure": true,
        "Mirrors": []
      }
    },
    "AllowNondistributableArtifactsHostnames": [],
    "InsecureRegistryCIDRs": [
      "127.0.0.0/8"
    ]
  },
  "DefaultRuntime": "runc",
  "ContainersStopped": 9,
  "NCPU": 2,
  "NFd": 36,
  "Architecture": "x86_64",
  "KernelMemory": true,
  "CpuCfsQuota": true,
  "Debug": true,
  "ID": "BAWB:H54Y:C6PA:6AFI:HQWT:Z6KO:DW76:3FWG:OT7Y:A2HF:7MH5:XH7M",
  "IPv4Forwarding": true,
  "KernelVersion": "4.9.87-linuxkit-aufs",
  "BridgeNfIptables": true,
  "NoProxy": "",
  "LiveRestoreEnabled": false,
  "ServerVersion": "18.03.0-ce",
  "CpuCfsPeriod": true,
  "ExperimentalBuild": true,
  "MemoryLimit": true,
  "SwapLimit": true,
  "Plugins": {
    "Volume": [
      "local"
    ],
    "Network": [
      "bridge",
      "host",
      "ipvlan",
      "macvlan",
      "null",
      "overlay"
    ],
    "Authorization": null,
    "Log": [
      "awslogs",
      "fluentd",
      "gcplogs",
      "gelf",
      "journald",
      "json-file",
      "logentries",
      "splunk",
      "syslog"
    ]
  },
  "Images": 124,
  "DockerRootDir": "/var/lib/docker",
  "NEventsListener": 2,
  "CPUShares": true,
  "RuncCommit": {
    "Expected": "4fc53a81fb7c994640722ac585fa9ca548971871",
    "ID": "4fc53a81fb7c994640722ac585fa9ca548971871"
  }
}
{
  "KernelVersion": "4.9.87-linuxkit-aufs",
  "Components": [
    {
      "Version": "18.03.0-ce",
      "Name": "Engine",
      "Details": {
        "KernelVersion": "4.9.87-linuxkit-aufs",
        "Os": "linux",
        "BuildTime": "2018-03-21T23:14:32.000000000+00:00",
        "ApiVersion": "1.37",
        "MinAPIVersion": "1.12",
        "GitCommit": "0520e24",
        "Arch": "amd64",
        "Experimental": "true",
        "GoVersion": "go1.9.4"
      }
    }
  ],
  "Arch": "amd64",
  "BuildTime": "2018-03-21T23:14:32.000000000+00:00",
  "ApiVersion": "1.37",
  "Platform": {
    "Name": ""
  },
  "Version": "18.03.0-ce",
  "MinAPIVersion": "1.12",
  "GitCommit": "0520e24",
  "Os": "linux",
  "Experimental": true,
  "GoVersion": "go1.9.4"
}
SUMMARY

My organization has a private docker registry we run internally and does not require docker login to push (i.e. I can docker push registry.myorg.com/mycontainer without having to log in and it works). When I try to run ansible-container push --push-to myregistry I get an error. Is this something that is supported?

EXPECTED RESULTS

not sure, image pushed? this is my first try and i don't want to put this in dockerhub.

ACTUAL RESULTS
container.exceptions.AnsibleContainerConductorException: Please provide login credentials for registry registry.myorg.com.
treyd commented 6 years ago

This seems to work if I supply any username/password, e.g.

ansible-container --debug push --push-to myregistry --username=bogus --password=bogus

fins2 commented 6 years ago

I had the same problem, you need to provide an empty username and password like this: ansible-container --debug push --push-to myregistry --username="" --password=""