-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: make the example for 'load' work #13102
Conversation
s/label/load/ ? |
5e555df
to
d5008d9
Compare
Hey @Vaelatern Thanks for making this PR. I tested the original load example in the docs and you're right it doesn't seem to be working as intended. This might be another manifestation of #2443, since the main error I was getting was:
off of this task:
I'll have to ask around to figure out what the intended behavior here is, to know if this is a bug or a documentation gap. In the meantime, could you share the (sanitized) job file you used to confirm that the options stanza was needed? |
The |
remote repository. Equivalent to the `docker load -i <filename>` command. Need | ||
to tell nomad to keep the archive intact for this to work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remote repository. Equivalent to the `docker load -i <filename>` command. Need | |
to tell nomad to keep the archive intact for this to work. | |
remote repository. Equivalent to the `docker load -i <filename>` command. | |
If you're using an `artifact` block for the source of the archive, you'll need to | |
ensure that Nomad keeps the archive intact after download. |
Reproduction (note that
artifact server jobspecjob "artifacts" {
datacenters = ["dc1"]
type = "system"
group "artifacts" {
network {
mode = "bridge"
port "www" {
static = 15101
to = 8000
}
}
task "httpd" {
driver = "docker"
config {
image = "busybox:1"
command = "httpd"
args = [
"-v", "-f",
"-p", "8000",
"-u", "www-data:www-data",
"-h", "/srv",
"-r", "artifacts",
"-c", "/local/httpd.conf",
]
mount {
type = "bind"
target = "/srv"
source = "/srv/artifacts"
readonly = true
}
ports = ["www"]
}
template {
# HTTP Basic Auth username: "artifacts", password: "supersecret"
data = <<EOT
/:artifacts:$1$iSV64UXs$IWot5UKWBzka6VskUSFWm0
EOT
destination = "local/httpd.conf"
}
resources {
cpu = 128
memory = 128
}
}
}
}
jobspec using artifactlocals {
auth_header = base64encode("artifacts:supersecret")
}
job "example" {
datacenters = ["dc1"]
group "web" {
network {
mode = "bridge"
port "www" {
to = 8001
}
}
task "http" {
artifact {
source = "http://10.0.2.15:15101/busybox.tar"
options {
archive = false
}
headers {
Authorization = "Basic ${local.auth_header}"
}
}
driver = "docker"
config {
image = "busybox:1"
load = "busybox.tar"
command = "httpd"
args = ["-v", "-f", "-p", "8001", "-h", "/local"]
ports = ["www"]
}
template {
data = "<html>hello, world</html>"
destination = "local/index.html"
}
resources {
cpu = 128
memory = 128
}
}
}
}
|
d5008d9
to
44ca8ee
Compare
@tgross Pushed doc text change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @Vaelatern!
Preview link: https://nomad-c3o2a0wot-hashicorp.vercel.app/docs/drivers/docker#load
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Something I ran into when trying this.