Use this resource to create a docker proxy repository.
resource "nexus_repository_docker_proxy" "dockerhub" {
name = "dockerhub"
online = true
docker {
force_basic_auth = false
v1_enabled = false
subdomain = "docker" # Pro-only
}
docker_proxy {
index_type = "HUB"
}
storage {
blob_store_name = "default"
strict_content_type_validation = true
}
proxy {
remote_url = "https://registry-1.docker.io"
content_max_age = 1440
metadata_max_age = 1440
}
negative_cache {
enabled = true
ttl = 1440
}
http_client {
blocked = false
auto_block = true
}
}
docker
(Block List, Min: 1, Max: 1) docker contains the configuration of the docker repository (see below for nested schema)docker_proxy
(Block List, Min: 1, Max: 1) docker_proxy contains the configuration of the docker index (see below for nested schema)http_client
(Block List, Min: 1, Max: 1) HTTP Client configuration for proxy repositories (see below for nested schema)name
(String) A unique identifier for this repositoryproxy
(Block List, Min: 1, Max: 1) Configuration for the proxy repository (see below for nested schema)storage
(Block List, Min: 1, Max: 1) The storage configuration of the repository (see below for nested schema)cleanup
(Block List) Cleanup policies (see below for nested schema)negative_cache
(Block List, Max: 1) Configuration of the negative cache handling (see below for nested schema)online
(Boolean) Whether this repository accepts incoming requestsrouting_rule
(String) The name of the routing rule assigned to this repositoryid
(String) Used to identify resource at nexusdocker
Required:
force_basic_auth
(Boolean) Whether to force authentication (Docker Bearer Token Realm required if false)v1_enabled
(Boolean) Whether to allow clients to use the V1 API to interact with this repositoryOptional:
http_port
(Number) Create an HTTP connector at specified porthttps_port
(Number) Create an HTTPS connector at specified portsubdomain
(String) Pro-only: Whether to allow clients to use subdomain routing connectordocker_proxy
Required:
index_type
(String) Type of Docker Index. Possible values: HUB
, REGISTRY
or CUSTOM
Optional:
index_url
(String) Url of Docker Index to usehttp_client
Required:
auto_block
(Boolean) Whether to auto-block outbound connections if remote peer is detected as unreachable/unresponsiveblocked
(Boolean) Whether to block outbound connections on the repositoryOptional:
authentication
(Block List, Max: 1) Authentication configuration of the HTTP client (see below for nested schema)connection
(Block List, Max: 1) Connection configuration of the HTTP client (see below for nested schema)http_client.authentication
Required:
type
(String) Authentication type. Possible values: ntlm
or username
Optional:
ntlm_domain
(String) The ntlm domain to connectntlm_host
(String) The ntlm host to connectpassword
(String, Sensitive) The password used by the proxy repositoryusername
(String) The username used by the proxy repositoryhttp_client.connection
Optional:
enable_circular_redirects
(Boolean) Whether to enable redirects to the same location (may be required by some servers)enable_cookies
(Boolean) Whether to allow cookies to be stored and usedretries
(Number) Total retries if the initial connection attempt suffers a timeouttimeout
(Number) Seconds to wait for activity before stopping and retrying the connectionuse_trust_store
(Boolean) Use certificates stored in the Nexus Repository Manager truststore to connect to external systemsuser_agent_suffix
(String) Custom fragment to append to User-Agent header in HTTP requestsproxy
Required:
remote_url
(String) Location of the remote repository being proxiedOptional:
content_max_age
(Number) How long (in minutes) to cache artifacts before rechecking the remote repositorymetadata_max_age
(Number) How long (in minutes) to cache metadata before rechecking the remote repository.storage
Required:
blob_store_name
(String) Blob store used to store repository contentsOptional:
strict_content_type_validation
(Boolean) Whether to validate uploaded content's MIME type appropriate for the repository formatcleanup
Optional:
policy_names
(Set of String) List of policy namesnegative_cache
Optional:
enabled
(Boolean) Whether to cache responses for content not present in the proxied repositoryttl
(Number) How long to cache the fact that a file was not found in the repository (in minutes)
Import is supported using the following syntax:
# import using the name of repository
terraform import nexus_repository_docker_proxy.dockerhub dockerhub