Skip to content

Instantly share code, notes, and snippets.

@prismofeverything
Created May 30, 2019 07:03
Show Gist options
  • Save prismofeverything/296ba40c5bb9e9d94b728fbc43895ce2 to your computer and use it in GitHub Desktop.
Save prismofeverything/296ba40c5bb9e9d94b728fbc43895ce2 to your computer and use it in GitHub Desktop.
attach to docker logs
(defn attach-params
[]
(into-array
DockerClient$AttachParameter
[DockerClient$AttachParameter/LOGS
DockerClient$AttachParameter/STDOUT
DockerClient$AttachParameter/STDERR
DockerClient$AttachParameter/STREAM]))
(defn attach-logs
([docker id] (attach-logs docker id System/out System/err))
([docker id out err]
(let [attach (.attachContainer docker id (attach-params))]
(.attach attach out err true))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment