This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-14
Channels
- # adventofcode (2)
- # announcements (61)
- # babashka (26)
- # beginners (125)
- # calva (63)
- # cider (33)
- # clj-kondo (40)
- # cljs-dev (24)
- # clojure (165)
- # clojure-australia (8)
- # clojure-dev (4)
- # clojure-europe (44)
- # clojure-finland (1)
- # clojure-greece (4)
- # clojure-losangeles (1)
- # clojure-nl (28)
- # clojure-taiwan (3)
- # clojure-uk (64)
- # clojurescript (2)
- # core-async (14)
- # datomic (34)
- # docker (2)
- # fulcro (9)
- # garden (1)
- # jobs (4)
- # jobs-discuss (21)
- # kaocha (3)
- # off-topic (48)
- # pathom (4)
- # practicalli (3)
- # remote-jobs (3)
- # shadow-cljs (46)
- # spacemacs (6)
- # sql (4)
- # tools-deps (22)
- # xtdb (5)
- # yada (2)
Does anybody have an example of using clj-docker-client 1.x with a registry that requires authentication?
for the record:
(ns dclj.core
(:require [clj-docker-client.core :as d]
[cheshire.core :as json])
(:import java.util.Base64))
(defn b64-encode [to-encode]
(.encodeToString (Base64/getEncoder) (.getBytes to-encode)))
(def auth (-> {"username" "un"
"password" "pw"
"serveraddress" ""}
json/encode
b64-encode))
(def images (d/client {:category :images
:conn {:uri "unix:///var/run/docker.sock"}
:api-version "v1.40"}))
(d/invoke images {:op :ImageCreate
:params {:fromImage ""
:X-Registry-Auth auth}
:throw-exception? true})