Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
645ee7fa7b | ||
|
|
405fb8af69 | ||
|
|
e8a77354dd | ||
|
|
38b54e186e | ||
|
|
4bdc0abe3a | ||
|
|
f5254faa23 | ||
|
|
b158093722 | ||
|
|
fc9040027d | ||
|
|
d8c86b4c99 | ||
|
|
dd29e41dd1 | ||
|
|
b8d4b18bd6 | ||
|
|
ce5b1520f8 | ||
|
|
11a7d10ea7 | ||
|
|
68430613f1 | ||
|
|
3b689d3762 | ||
|
|
5ef7e9ef1c | ||
|
|
63d3cc2f0a | ||
|
|
4f77f40fb2 | ||
|
|
c8635d37fa | ||
|
|
caa1580ee1 | ||
|
|
67eab57f32 | ||
|
|
3096e87b04 | ||
|
|
51e92b403b | ||
|
|
9c982ecf3b | ||
|
|
6e69c80c9b | ||
|
|
a8e8f0df16 |
@@ -1 +1,36 @@
|
||||
pod-atomisthq-tools.docker
|
||||
# Include any files or directories that you don't want to be copied to your
|
||||
# container here (e.g., local build artifacts, temporary files, etc.).
|
||||
#
|
||||
# For more help, visit the .dockerignore file reference guide at
|
||||
# https://docs.docker.com/engine/reference/builder/#dockerignore-file
|
||||
|
||||
**/.DS_Store
|
||||
**/.classpath
|
||||
**/.dockerignore
|
||||
**/.env
|
||||
**/.git
|
||||
**/.gitignore
|
||||
**/.project
|
||||
**/.settings
|
||||
**/.toolstarget
|
||||
**/.vs
|
||||
**/.vscode
|
||||
**/.direnv
|
||||
**/.cpcache
|
||||
**/.clj-kondo
|
||||
**/.github
|
||||
**/*.*proj.user
|
||||
**/*.dbmdl
|
||||
**/*.jfm
|
||||
**/bin
|
||||
**/charts
|
||||
**/docker-compose*
|
||||
**/compose*
|
||||
**/Dockerfile*
|
||||
**/node_modules
|
||||
**/npm-debug.log
|
||||
**/obj
|
||||
**/secrets.dev.yaml
|
||||
**/values.dev.yaml
|
||||
LICENSE
|
||||
README.md
|
||||
|
||||
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@@ -2,7 +2,7 @@ name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
branches:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
@@ -26,6 +26,6 @@ jobs:
|
||||
goarch: ${{ matrix.goarch }}
|
||||
goversion: 1.19.1
|
||||
binary_name: "babashka-pod-docker"
|
||||
release_tag: "0.1.0"
|
||||
release_tag: "0.2.0"
|
||||
overwrite: TRUE
|
||||
compress_assets: OFF
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -5,3 +5,6 @@ babashka-pod-docker
|
||||
/.cpcache/
|
||||
/.lsp/
|
||||
/.nrepl-port
|
||||
/vendor/
|
||||
/result
|
||||
/.direnv/
|
||||
|
||||
@@ -11,10 +11,10 @@ COPY main.go ./
|
||||
COPY docker/ ./docker/
|
||||
COPY babashka/ ./babashka/
|
||||
|
||||
RUN CGO_ENABLED=0 go build -o babashka-pod-docker
|
||||
RUN CGO_ENABLED=0 go build -ldflags "-s -w" -o babashka-pod-docker
|
||||
|
||||
FROM alpine:3.17
|
||||
ARG version
|
||||
COPY repository/ /root/.babashka/pods/repository
|
||||
COPY --from=build /app/babashka-pod-docker /root/.babashka/pods/repository/docker/babashka-pod-docker/0.1.0
|
||||
RUN chmod 755 /root/.babashka/pods/repository/docker/babashka-pod-docker/0.1.0/babashka-pod-docker
|
||||
COPY --from=build /app/babashka-pod-docker /root/.babashka/pods/repository/docker/docker-tools/0.1.0
|
||||
RUN chmod 755 /root/.babashka/pods/repository/docker/docker-tools/0.1.0/babashka-pod-docker
|
||||
|
||||
72
Dockerfile.init
Normal file
72
Dockerfile.init
Normal file
@@ -0,0 +1,72 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
# Comments are provided throughout this file to help you get started.
|
||||
# If you need more help, visit the Dockerfile reference guide at
|
||||
# https://docs.docker.com/engine/reference/builder/
|
||||
|
||||
################################################################################
|
||||
# Create a stage for building the application.
|
||||
ARG GO_VERSION=1.19
|
||||
FROM golang:${GO_VERSION} AS build
|
||||
WORKDIR /src
|
||||
|
||||
# Download dependencies as a separate step to take advantage of Docker's caching.
|
||||
# Leverage a cache mount to /go/pkg/mod/ to speed up subsequent builds.
|
||||
# Leverage bind mounts to go.sum and go.mod to avoid having to copy them into
|
||||
# the container.
|
||||
RUN --mount=type=cache,target=/go/pkg/mod/ \
|
||||
--mount=type=bind,source=go.sum,target=go.sum \
|
||||
--mount=type=bind,source=go.mod,target=go.mod \
|
||||
go mod download -x
|
||||
|
||||
# Build the application.
|
||||
# Leverage a cache mount to /go/pkg/mod/ to speed up subsequent builds.
|
||||
# Leverage a bind mount to the current directory to avoid having to copy the
|
||||
# source code into the container.
|
||||
RUN --mount=type=cache,target=/go/pkg/mod/ \
|
||||
--mount=type=bind,target=. \
|
||||
CGO_ENABLED=0 go build -o /bin/server .
|
||||
|
||||
################################################################################
|
||||
# Create a new stage for running the application that contains the minimal
|
||||
# runtime dependencies for the application. This often uses a different base
|
||||
# image from the build stage where the necessary files are copied from the build
|
||||
# stage.
|
||||
#
|
||||
# The example below uses the alpine image as the foundation for running the app.
|
||||
# By specifying the "latest" tag, it will also use whatever happens to be the
|
||||
# most recent version of that image when you build your Dockerfile. If
|
||||
# reproducability is important, consider using a versioned tag
|
||||
# (e.g., alpine:3.17.2) or SHA (e.g., alpine:sha256:c41ab5c992deb4fe7e5da09f67a8804a46bd0592bfdf0b1847dde0e0889d2bff).
|
||||
FROM alpine:latest AS final
|
||||
|
||||
# Install any runtime dependencies that are needed to run your application.
|
||||
# Leverage a cache mount to /var/cache/apk/ to speed up subsequent builds.
|
||||
RUN --mount=type=cache,target=/var/cache/apk \
|
||||
apk --update add \
|
||||
ca-certificates \
|
||||
tzdata \
|
||||
&& \
|
||||
update-ca-certificates
|
||||
|
||||
# Create a non-privileged user that the app will run under.
|
||||
# See https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#user
|
||||
ARG UID=10001
|
||||
RUN adduser \
|
||||
--disabled-password \
|
||||
--gecos "" \
|
||||
--home "/nonexistent" \
|
||||
--shell "/sbin/nologin" \
|
||||
--no-create-home \
|
||||
--uid "${UID}" \
|
||||
appuser
|
||||
USER appuser
|
||||
|
||||
# Copy the executable from the "build" stage.
|
||||
COPY --from=build /bin/server /bin/
|
||||
|
||||
# Expose the port that the application listens on.
|
||||
EXPOSE 3000
|
||||
|
||||
# What the container should run when it is started.
|
||||
ENTRYPOINT [ "/bin/server" ]
|
||||
28
Dockerfile.nix
Normal file
28
Dockerfile.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
# syntax = docker/dockerfile:1.4
|
||||
FROM nixos/nix:latest AS builder
|
||||
|
||||
WORKDIR /tmp/build
|
||||
RUN mkdir /tmp/nix-store-closure
|
||||
|
||||
RUN \
|
||||
--mount=type=cache,target=/nix,from=nixos/nix:latest,source=/nix \
|
||||
--mount=type=cache,target=/root/.cache \
|
||||
--mount=type=bind,target=/tmp/build \
|
||||
<<EOF
|
||||
nix \
|
||||
--extra-experimental-features "nix-command flakes" \
|
||||
--extra-substituters "http://host.docker.internal?priority=10" \
|
||||
--option filter-syscalls false \
|
||||
--show-trace \
|
||||
--log-format raw \
|
||||
build . --out-link /tmp/output/result
|
||||
cp -R $(nix-store -qR /tmp/output/result) /tmp/nix-store-closure
|
||||
EOF
|
||||
|
||||
FROM scratch
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /tmp/nix-store-closure /nix/store
|
||||
COPY --from=builder /tmp/output/ /app/
|
||||
ENTRYPOINT ["/app/result/bin/entrypoint"]
|
||||
11
README.md
11
README.md
@@ -9,12 +9,12 @@ This is a [babashka pod](https://github.com/babashka/pods) that binds some golan
|
||||
|
||||
```clojure
|
||||
(require '[babashka.pods :as pods])
|
||||
(pods/load-pod 'docker/babashka-pod-docker "0.1.0")
|
||||
(pods/load-pod 'docker/tools "0.1.0")
|
||||
; OR use a locally built pod binary
|
||||
#_(pods/load-pod "./babashka-pod-docker")
|
||||
|
||||
;; load-pod will create this namespace with two vars
|
||||
(require '[docker.babashka-pod-docker :as docker])
|
||||
(require '[docker.tools :as docker])
|
||||
|
||||
;; parse image names using github.com/docker/distribution
|
||||
;; turns golang structs into clojure maps
|
||||
@@ -31,7 +31,7 @@ This is a [babashka pod](https://github.com/babashka/pods) that binds some golan
|
||||
(docker/parse-dockerfile "FROM \\\n gcr.io/whatever:tag\nCMD [\"run\"]")
|
||||
```
|
||||
|
||||
Loading `'docker/babashka-pod-docker` from the pod registry will download the binary into `${user.home}/.babashka/pods/registry` (the `$BABASHKA_PODS_DIR` environment variable will be used if it exists).
|
||||
Loading `'docker/docker-tools` from the pod registry will download the binary into `${user.home}/.babashka/pods/registry` (the `$BABASHKA_PODS_DIR` environment variable will be used if it exists).
|
||||
|
||||
## Building Locally
|
||||
|
||||
@@ -79,11 +79,11 @@ Here is an example of bindings that will resolve at compile-time and go through
|
||||
|
||||
;; statically define dispatch functions - this is synchronous
|
||||
(defn parse [s]
|
||||
(impl/invoke-public "babashka-pod-docker" "babashka-pod-docker/parse-dockerfile" [s] {}))
|
||||
(impl/invoke-public "docker.tools" "docker.tools/parse-dockerfile" [s] {}))
|
||||
|
||||
;; async example
|
||||
(defn generate-sbom [s]
|
||||
(impl/invoke-public "babashka-pod-docker" "babashka-pod-docker/-generate-sbom"
|
||||
(impl/invoke-public "docker.tools" "docker.tools/generate-sbom"
|
||||
[s cb]
|
||||
{:handlers {:done (fn [])
|
||||
:success cb
|
||||
@@ -99,3 +99,4 @@ This method of dispatch does not require any dynamic namespace generation.
|
||||
## Contributing
|
||||
|
||||
You can find information about contributing to this project in the CONTRIBUTING.md
|
||||
|
||||
|
||||
39
dev/user.clj
39
dev/user.clj
@@ -23,10 +23,23 @@
|
||||
{:pod/id (:pod-id pod)})))
|
||||
|
||||
(comment
|
||||
(pods/load-pod 'docker/babashka-pod-docker "0.1.0")
|
||||
(pods/load-pod 'docker.tools "0.1.0")
|
||||
(pods/load-pod "result/bin/babashka-pod-docker")
|
||||
(pods/load-pod "result/bin/entrypoint")
|
||||
|
||||
(require '[babashka-pod-docker :as docker])
|
||||
(require '[docker.tools :as docker])
|
||||
|
||||
(pods/unload-pod {:pod/id "docker.tools"})
|
||||
|
||||
;; ignore patterns
|
||||
(def patterns (docker/dockerignore-patterns (slurp "/Users/slim/vonwig/nodejs-service/.dockerignore")))
|
||||
(docker/dockerignore-matches (assoc patterns :path "node_modules/hey"))
|
||||
(docker/dockerignore-matches (assoc patterns :path "nodes"))
|
||||
(docker/dockerignore-matches (assoc patterns :path "Dockerfile"))
|
||||
(docker/dockerignore-matches (assoc patterns :path "blah/crap/npm-debug.log"))
|
||||
(docker/dockerignore-matches (assoc patterns :path "blah/.vscode/hello.txt"))
|
||||
(docker/dockerignore-matches (assoc patterns :path "src/jim/main.clj"))
|
||||
|
||||
|
||||
;; parse image names using github.com/docker/distribution
|
||||
;; turns golang structs into clojure maps
|
||||
@@ -39,24 +52,23 @@
|
||||
;; invalid reference format
|
||||
(println (.getMessage e))))
|
||||
|
||||
|
||||
;; parse dockerfiles using github.com/moby/buildkit
|
||||
;; returns the Result struct transformed to a clojure map
|
||||
(docker/parse-dockerfile "FROM \\\n gcr.io/whatever:tag\nCMD [\"run\"]")
|
||||
|
||||
|
||||
;; run sbom generation on local image
|
||||
(docker/sbom "vonwig/clojure-base:jdk17" (fn [event] (println event)))
|
||||
(docker/sbom "mongo@sha256:9c8a0a019671ed7d402768d4df6dddcc898828e21e9f7b90a34b55fe8ca676ac"
|
||||
(fn [event]
|
||||
(println "event " event)))
|
||||
|
||||
|
||||
(docker/hashes "vonwig/malware1:latest" (fn [event] (println event)))
|
||||
)
|
||||
(docker/hashes "vonwig/malware1:latest"
|
||||
(fn [event] (println event))))
|
||||
|
||||
(defn generate-sbom
|
||||
[image]
|
||||
(impl/invoke-public
|
||||
"docker.babashka-pod-docker"
|
||||
"babashka-pod-docker/generate-sbom"
|
||||
"docker.tools"
|
||||
"docker.tools/generate-sbom"
|
||||
[image "" ""]
|
||||
{:handlers {:done (fn [] (println "Done"))
|
||||
:success (fn [msg] (println "msg: " msg))
|
||||
@@ -65,9 +77,8 @@
|
||||
(comment
|
||||
(println (load-pod "./babashka-pod-docker"))
|
||||
(impl/invoke-public
|
||||
"docker.babashka-pod-docker"
|
||||
"babashka-pod-docker/generate-sbom"
|
||||
"docker.tools"
|
||||
"docker.tools/generate-sbom"
|
||||
["ubuntu:latest" "" ""]
|
||||
{})
|
||||
(generate-sbom "alpine")
|
||||
)
|
||||
(generate-sbom "alpine"))
|
||||
|
||||
149
docker/ops.go
149
docker/ops.go
@@ -2,8 +2,10 @@ package docker
|
||||
|
||||
import (
|
||||
"github.com/docker/distribution/reference"
|
||||
"github.com/docker/index-cli-plugin/lsp"
|
||||
"github.com/kballard/go-shellquote"
|
||||
"github.com/moby/buildkit/frontend/dockerfile/parser"
|
||||
"github.com/moby/patternmatcher"
|
||||
"github.com/moby/patternmatcher/ignorefile"
|
||||
|
||||
//"reflect"
|
||||
"crypto/sha256"
|
||||
@@ -13,7 +15,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"dockerfileparse/user/parser/babashka"
|
||||
"babashka-pod-docker/babashka"
|
||||
)
|
||||
|
||||
type Reference struct {
|
||||
@@ -27,6 +29,22 @@ type Error struct {
|
||||
Error string `json:"error"`
|
||||
}
|
||||
|
||||
type Ignore struct {
|
||||
Patterns []string `json:"patterns"`
|
||||
}
|
||||
|
||||
func patterns(s string) (Ignore, error) {
|
||||
patterns, err := ignorefile.ReadAll(strings.NewReader(s))
|
||||
if err != nil {
|
||||
return Ignore{}, err
|
||||
}
|
||||
return Ignore{Patterns: patterns}, err
|
||||
}
|
||||
|
||||
func matches(path string, patterns []string) (bool, error) {
|
||||
return patternmatcher.MatchesOrParentMatches(path, patterns)
|
||||
}
|
||||
|
||||
func parse_uri(s string) (Reference, error) {
|
||||
tag, domain, path, digest := "", "", "", ""
|
||||
|
||||
@@ -53,56 +71,6 @@ func parse_uri(s string) (Reference, error) {
|
||||
return Reference{Path: path, Domain: domain, Tag: tag, Digest: digest}, err
|
||||
}
|
||||
|
||||
func generate_sbom(message *babashka.Message, image string, username string, password string) error {
|
||||
tx_channel := make(chan string)
|
||||
|
||||
go func() error {
|
||||
for {
|
||||
tx := <-tx_channel
|
||||
if tx != "" {
|
||||
err := babashka.WriteNotDoneInvokeResponse(message, tx)
|
||||
if err != nil {
|
||||
babashka.WriteErrorResponse(message, err)
|
||||
}
|
||||
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}()
|
||||
|
||||
l := lsp.New()
|
||||
|
||||
if username != "" && password != "" {
|
||||
l.WithAuth(username, password)
|
||||
}
|
||||
|
||||
return l.Send(image, tx_channel)
|
||||
}
|
||||
|
||||
func generate_hashes(message *babashka.Message, s string) error {
|
||||
tx_channel := make(chan string)
|
||||
|
||||
go func() error {
|
||||
for {
|
||||
tx := <-tx_channel
|
||||
if tx != "" {
|
||||
err := babashka.WriteNotDoneInvokeResponse(message, tx)
|
||||
if err != nil {
|
||||
babashka.WriteErrorResponse(message, err)
|
||||
}
|
||||
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}()
|
||||
|
||||
return lsp.New().SendFileHashes(s, tx_channel)
|
||||
}
|
||||
|
||||
func ProcessMessage(message *babashka.Message) (any, error) {
|
||||
switch message.Op {
|
||||
case "describe":
|
||||
@@ -110,7 +78,8 @@ func ProcessMessage(message *babashka.Message) (any, error) {
|
||||
Format: "json",
|
||||
Namespaces: []babashka.Namespace{
|
||||
{
|
||||
Name: "docker.babashka-pod-docker",
|
||||
// this is the pod-id
|
||||
Name: "docker.tools",
|
||||
Vars: []babashka.Var{
|
||||
{
|
||||
Name: "parse-image-name",
|
||||
@@ -119,40 +88,13 @@ func ProcessMessage(message *babashka.Message) (any, error) {
|
||||
Name: "parse-dockerfile",
|
||||
},
|
||||
{
|
||||
Name: "sbom",
|
||||
Code: `
|
||||
(defn sbom
|
||||
([image cb]
|
||||
(sbom image cb {}))
|
||||
([image cb opts]
|
||||
(babashka.pods/invoke
|
||||
"docker.babashka-pod-docker"
|
||||
'babashka-pod-docker/generate-sbom
|
||||
[image]
|
||||
{:handlers {:success (fn [event]
|
||||
(cb event))
|
||||
:error (fn [{:keys [:ex-message :ex-data]}]
|
||||
(binding [*out* *err*]
|
||||
(println "ERROR:" ex-message)))
|
||||
:done (fn [] (println "Done callback"))}})))`,
|
||||
Name: "parse-shellwords",
|
||||
},
|
||||
{
|
||||
Name: "hashes",
|
||||
Code: `
|
||||
(defn hashes
|
||||
([image cb]
|
||||
(hashes image cb {}))
|
||||
([image cb opts]
|
||||
(babashka.pods/invoke
|
||||
"docker.babashka-pod-docker"
|
||||
'babashka-pod-docker/generate-hashes
|
||||
[image]
|
||||
{:handlers {:success (fn [event]
|
||||
(cb event))
|
||||
:error (fn [{:keys [:ex-message :ex-data]}]
|
||||
(binding [*out* *err*]
|
||||
(println "ERROR:" ex-message)))
|
||||
:done (fn [] (cb {:status "done"}))}})))`,
|
||||
Name: "dockerignore-patterns",
|
||||
},
|
||||
{
|
||||
Name: "dockerignore-matches",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -160,51 +102,46 @@ func ProcessMessage(message *babashka.Message) (any, error) {
|
||||
}, nil
|
||||
case "invoke":
|
||||
switch message.Var {
|
||||
case "babashka-pod-docker/parse-image-name":
|
||||
case "docker.tools/parse-image-name":
|
||||
args := []string{}
|
||||
if err := json.Unmarshal([]byte(message.Args), &args); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return parse_uri(args[0])
|
||||
case "babashka-pod-docker/parse-dockerfile":
|
||||
case "docker.tools/parse-dockerfile":
|
||||
args := []string{}
|
||||
if err := json.Unmarshal([]byte(message.Args), &args); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
reader := strings.NewReader(args[0])
|
||||
return parser.Parse(reader)
|
||||
case "babashka-pod-docker/generate-sbom":
|
||||
case "docker.tools/parse-shellwords":
|
||||
args := []string{}
|
||||
|
||||
if err := json.Unmarshal([]byte(message.Args), &args); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(args) == 3 {
|
||||
err := generate_sbom(message, args[0], args[1], args[2])
|
||||
if err != nil {
|
||||
babashka.WriteErrorResponse(message, err)
|
||||
}
|
||||
} else {
|
||||
err := generate_sbom(message, args[0], "", "")
|
||||
if err != nil {
|
||||
babashka.WriteErrorResponse(message, err)
|
||||
}
|
||||
}
|
||||
return "done", nil
|
||||
return shellquote.Split(args[0])
|
||||
|
||||
case "babashka-pod-docker/generate-hashes":
|
||||
case "docker.tools/dockerignore-patterns":
|
||||
args := []string{}
|
||||
if err := json.Unmarshal([]byte(message.Args), &args); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err := generate_hashes(message, args[0])
|
||||
if err != nil {
|
||||
babashka.WriteErrorResponse(message, err)
|
||||
return patterns(args[0])
|
||||
|
||||
case "docker.tools/dockerignore-matches":
|
||||
type MyType struct {
|
||||
Path string `json:"path"`
|
||||
Patterns []string `json:"patterns"`
|
||||
}
|
||||
args := []MyType{}
|
||||
if err := json.Unmarshal([]byte(message.Args), &args); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return "done", nil
|
||||
return matches(args[0].Path, args[0].Patterns)
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("Unknown var %s", message.Var)
|
||||
|
||||
209
flake.lock
generated
Normal file
209
flake.lock
generated
Normal file
@@ -0,0 +1,209 @@
|
||||
{
|
||||
"nodes": {
|
||||
"devshell": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"platform-engineering",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1693833206,
|
||||
"narHash": "sha256-wHOY0nnD6gWj8u9uI85/YlsganYyWRK1hLFZulZwfmY=",
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"rev": "65114ea495a8d3cc1352368bf170d67ef005aa5a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1692799911,
|
||||
"narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gitignore": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"platform-engineering",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1694102001,
|
||||
"narHash": "sha256-vky6VPK1n1od6vXbqzOXnekrQpTL4hbPAwUhT5J9c9E=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"rev": "9e21c80adf67ebcb077d75bd5e7d724d21eeafd6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gomod2nix": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"utils": "utils"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1677459247,
|
||||
"narHash": "sha256-JbakfAiPYmCCV224yAMq/XO0udN5coWv/oazblMKdoY=",
|
||||
"owner": "nix-community",
|
||||
"repo": "gomod2nix",
|
||||
"rev": "3cbf3a51fe32e2f57af4c52744e7228bab22983d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "gomod2nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-filter": {
|
||||
"locked": {
|
||||
"lastModified": 1693833173,
|
||||
"narHash": "sha256-hlMABKrGbEiJD5dwUSfnw1CQ3bG7KKwDV+Nx3bEZd7U=",
|
||||
"owner": "numtide",
|
||||
"repo": "nix-filter",
|
||||
"rev": "ac030bd9ba98e318e1f4c4328d60766ade8ebe8b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "nix-filter",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1711460390,
|
||||
"narHash": "sha256-akSgjDZL6pVHEfSE6sz1DNSXuYX6hq+P/1Z5IoYWs7E=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "44733514b72e732bd49f5511bd0203dea9b9a434",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-23.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1658285632,
|
||||
"narHash": "sha256-zRS5S/hoeDGUbO+L95wXG9vJNwsSYcl93XiD0HQBXLk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5342fc6fb59d0595d26883c3cadff16ce58e44f3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "master",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"platform-engineering": {
|
||||
"inputs": {
|
||||
"devshell": "devshell",
|
||||
"flake-utils": "flake-utils",
|
||||
"gitignore": "gitignore",
|
||||
"gomod2nix": "gomod2nix",
|
||||
"nix-filter": "nix-filter",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1711580974,
|
||||
"narHash": "sha256-G6oClm1UOZM9SxSVyT5DMtZb6HafWYHzG2+2xFa+Cc8=",
|
||||
"owner": "slimslenderslacks",
|
||||
"repo": "nix-modules",
|
||||
"rev": "77157049160838a628945ee72c96fe48190e0104",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "slimslenderslacks",
|
||||
"repo": "nix-modules",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"platform-engineering": "platform-engineering"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_2": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"utils": {
|
||||
"locked": {
|
||||
"lastModified": 1653893745,
|
||||
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
26
flake.nix
Normal file
26
flake.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
description = "Docker Pod v0.2.0-1";
|
||||
|
||||
inputs = {
|
||||
platform-engineering = {
|
||||
url = "github:slimslenderslacks/nix-modules";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
|
||||
};
|
||||
|
||||
outputs = { nixpkgs, ... }@inputs:
|
||||
inputs.platform-engineering.golang-project
|
||||
{
|
||||
inherit nixpkgs;
|
||||
dir = ./.;
|
||||
name = "babashka-pod-docker";
|
||||
version = "0.2.0";
|
||||
package-overlay = pkgs: packages:
|
||||
packages // {
|
||||
default = pkgs.writeShellScriptBin "entrypoint" ''
|
||||
${packages.app}/bin/babashka-pod-docker
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
239
go.mod
239
go.mod
@@ -1,219 +1,48 @@
|
||||
module dockerfileparse/user/parser
|
||||
module babashka-pod-docker
|
||||
|
||||
go 1.19
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
github.com/docker/distribution v2.8.1+incompatible
|
||||
github.com/docker/index-cli-plugin v0.0.33-0.20230203131411-00c585229011
|
||||
github.com/atomist-skills/go-skill v0.0.56
|
||||
github.com/docker/distribution v2.8.3+incompatible
|
||||
github.com/jackpal/bencode-go v1.0.0
|
||||
github.com/moby/buildkit v0.10.6
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
|
||||
github.com/moby/buildkit v0.13.1
|
||||
github.com/moby/patternmatcher v0.6.0
|
||||
github.com/sirupsen/logrus v1.9.3
|
||||
)
|
||||
|
||||
require (
|
||||
cloud.google.com/go/compute v1.10.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go v66.0.0+incompatible // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
|
||||
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
|
||||
github.com/Azure/go-autorest/autorest v0.11.28 // indirect
|
||||
github.com/Azure/go-autorest/autorest/adal v0.9.21 // indirect
|
||||
github.com/Azure/go-autorest/autorest/azure/auth v0.5.11 // indirect
|
||||
github.com/Azure/go-autorest/autorest/azure/cli v0.4.6 // indirect
|
||||
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
|
||||
github.com/Azure/go-autorest/logger v0.2.1 // indirect
|
||||
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
|
||||
github.com/CycloneDX/cyclonedx-go v0.6.0 // indirect
|
||||
github.com/DataDog/zstd v1.4.5 // indirect
|
||||
github.com/GoogleCloudPlatform/docker-credential-gcr v2.0.5+incompatible // indirect
|
||||
github.com/Masterminds/goutils v1.1.1 // indirect
|
||||
github.com/Masterminds/semver/v3 v3.1.1 // indirect
|
||||
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
|
||||
github.com/Microsoft/go-winio v0.5.2 // indirect
|
||||
github.com/Microsoft/hcsshim v0.9.5 // indirect
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20220824120805-4b6e5c587895 // indirect
|
||||
github.com/acobaugh/osrelease v0.1.0 // indirect
|
||||
github.com/acomagu/bufpipe v1.0.3 // indirect
|
||||
github.com/anchore/go-logger v0.0.0-20220728155337-03b66a5207d8 // indirect
|
||||
github.com/anchore/go-macholibre v0.0.0-20220308212642-53e6d0aaf6fb // indirect
|
||||
github.com/anchore/packageurl-go v0.1.1-0.20220428202044-a072fa3cb6d7 // indirect
|
||||
github.com/anchore/stereoscope v0.0.0-20221006201143-d24c9d626b33 // indirect
|
||||
github.com/anchore/syft v0.62.1 // indirect
|
||||
github.com/andybalholm/brotli v1.0.4 // indirect
|
||||
github.com/aquasecurity/go-dep-parser v0.0.0-20220626060741-179d0b167e5f // indirect
|
||||
github.com/aquasecurity/trivy v0.30.4 // indirect
|
||||
github.com/aquasecurity/trivy-db v0.0.0-20220627104749-930461748b63 // indirect
|
||||
github.com/atomist-skills/go-skill v0.0.6-0.20221221214636-a7de163fd901 // indirect
|
||||
github.com/aws/aws-sdk-go v1.44.46 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bmatcuk/doublestar/v4 v4.0.2 // indirect
|
||||
github.com/briandowns/spinner v1.12.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||
github.com/cloudflare/circl v1.1.0 // indirect
|
||||
github.com/containerd/cgroups v1.0.4 // indirect
|
||||
github.com/containerd/containerd v1.6.12 // indirect
|
||||
github.com/containerd/continuity v0.3.0 // indirect
|
||||
github.com/containerd/fifo v1.0.0 // indirect
|
||||
github.com/containerd/stargz-snapshotter/estargz v0.12.0 // indirect
|
||||
github.com/containerd/ttrpc v1.1.1-0.20220420014843-944ef4a40df3 // indirect
|
||||
github.com/containerd/typeurl v1.0.2 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/dgryski/go-minhash v0.0.0-20170608043002-7fe510aff544 // indirect
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||
github.com/dimchansky/utfbom v1.1.1 // indirect
|
||||
github.com/docker/cli v20.10.21+incompatible // indirect
|
||||
github.com/docker/docker v20.10.17+incompatible // indirect
|
||||
github.com/docker/docker-credential-helpers v0.6.4 // indirect
|
||||
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect
|
||||
github.com/docker/go-connections v0.4.0 // indirect
|
||||
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
|
||||
github.com/docker/go-metrics v0.0.1 // indirect
|
||||
github.com/docker/go-units v0.5.0 // indirect
|
||||
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
|
||||
github.com/dustin/go-humanize v1.0.0 // indirect
|
||||
github.com/ekzhu/minhash-lsh v0.0.0-20171225071031-5c06ee8586a1 // indirect
|
||||
github.com/emirpasic/gods v1.12.0 // indirect
|
||||
github.com/facebookincubator/nvdtools v0.1.4 // indirect
|
||||
github.com/fatih/color v1.13.0 // indirect
|
||||
github.com/fvbommel/sortorder v1.0.2 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.0 // indirect
|
||||
github.com/go-enry/go-license-detector/v4 v4.3.0 // indirect
|
||||
github.com/go-git/gcfg v1.5.0 // indirect
|
||||
github.com/go-git/go-billy/v5 v5.3.1 // indirect
|
||||
github.com/go-git/go-git/v5 v5.4.2 // indirect
|
||||
github.com/go-redis/redis/v8 v8.11.5 // indirect
|
||||
github.com/go-restruct/restruct v1.2.0-alpha // indirect
|
||||
github.com/gogo/googleapis v1.4.1 // indirect
|
||||
cloud.google.com/go v0.110.10 // indirect
|
||||
cloud.google.com/go/compute v1.23.3 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
||||
cloud.google.com/go/logging v1.8.1 // indirect
|
||||
cloud.google.com/go/longrunning v0.5.4 // indirect
|
||||
github.com/containerd/typeurl/v2 v2.1.1 // indirect
|
||||
github.com/distribution/reference v0.5.0 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
github.com/google/go-cmp v0.5.9 // indirect
|
||||
github.com/google/go-containerregistry v0.11.0 // indirect
|
||||
github.com/google/licenseclassifier/v2 v2.0.0-pre5 // indirect
|
||||
github.com/google/uuid v1.3.0 // indirect
|
||||
github.com/gookit/color v1.5.2 // indirect
|
||||
github.com/gorilla/mux v1.8.0 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-retryablehttp v0.7.1 // indirect
|
||||
github.com/hasura/go-graphql-client v0.8.1 // indirect
|
||||
github.com/hhatto/gorst v0.0.0-20181029133204-ca9f730cac5b // indirect
|
||||
github.com/huandu/xstrings v1.3.2 // indirect
|
||||
github.com/imdario/mergo v0.3.13 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.0.1 // indirect
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
|
||||
github.com/jdkato/prose v1.1.0 // indirect
|
||||
github.com/jedib0t/go-pretty/v6 v6.4.0 // indirect
|
||||
github.com/jinzhu/copier v0.3.2 // indirect
|
||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
||||
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
|
||||
github.com/klauspost/compress v1.15.12 // indirect
|
||||
github.com/klauspost/pgzip v1.2.5 // indirect
|
||||
github.com/knqyf263/go-rpmdb v0.0.0-20221030135625-4082a22221ce // indirect
|
||||
github.com/knqyf263/nested v0.0.1 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.16 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.13 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
||||
github.com/mholt/archiver/v3 v3.5.1 // indirect
|
||||
github.com/microsoft/go-rustaudit v0.0.0-20220730194248-4b17361d90a5 // indirect
|
||||
github.com/miekg/pkcs11 v1.1.1 // indirect
|
||||
github.com/mitchellh/copystructure v1.2.0 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/mitchellh/reflectwalk v1.0.2 // indirect
|
||||
github.com/moby/locker v1.0.1 // indirect
|
||||
github.com/moby/sys/mount v0.3.3 // indirect
|
||||
github.com/moby/sys/mountinfo v0.6.2 // indirect
|
||||
github.com/moby/sys/signal v0.7.0 // indirect
|
||||
github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae // indirect
|
||||
github.com/montanaflynn/stats v0.0.0-20151014174947-eeaced052adb // indirect
|
||||
github.com/morikuni/aec v1.0.0 // indirect
|
||||
github.com/nwaples/rardecode v1.1.0 // indirect
|
||||
github.com/olekukonko/tablewriter v0.0.5 // indirect
|
||||
github.com/golang/protobuf v1.5.3 // indirect
|
||||
github.com/google/s2a-go v0.1.7 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
|
||||
github.com/opencontainers/go-digest v1.0.0 // indirect
|
||||
github.com/opencontainers/image-spec v1.0.3-0.20220303224323-02efb9a75ee1 // indirect
|
||||
github.com/opencontainers/runc v1.1.3 // indirect
|
||||
github.com/opencontainers/runtime-spec v1.0.3-0.20220311020903-6969a0a09ab1 // indirect
|
||||
github.com/opencontainers/selinux v1.10.1 // indirect
|
||||
github.com/pelletier/go-toml v1.9.5 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.15 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/prometheus/client_golang v1.13.0 // indirect
|
||||
github.com/prometheus/client_model v0.2.0 // indirect
|
||||
github.com/prometheus/common v0.37.0 // indirect
|
||||
github.com/prometheus/procfs v0.8.0 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
|
||||
github.com/rivo/uniseg v0.2.0 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/samber/lo v1.24.0 // indirect
|
||||
github.com/saracen/walker v0.0.0-20191201085201-324a081bae7e // indirect
|
||||
github.com/sassoftware/go-rpmutils v0.2.0 // indirect
|
||||
github.com/scylladb/go-set v1.0.3-0.20200225121959-cc7b2070d91e // indirect
|
||||
github.com/sergi/go-diff v1.2.0 // indirect
|
||||
github.com/shogo82148/go-shuffle v0.0.0-20170808115208-59829097ff3b // indirect
|
||||
github.com/shopspring/decimal v1.2.0 // indirect
|
||||
github.com/sirupsen/logrus v1.9.0 // indirect
|
||||
github.com/spdx/tools-golang v0.3.1-0.20221108182156-8a01147e6342 // indirect
|
||||
github.com/spf13/afero v1.8.2 // indirect
|
||||
github.com/spf13/cast v1.5.0 // indirect
|
||||
github.com/spf13/cobra v1.6.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/stretchr/objx v0.4.0 // indirect
|
||||
github.com/stretchr/testify v1.8.0 // indirect
|
||||
github.com/sylabs/sif/v2 v2.8.1 // indirect
|
||||
github.com/sylabs/squashfs v0.6.1 // indirect
|
||||
github.com/therootcompany/xz v1.0.1 // indirect
|
||||
github.com/theupdateframework/notary v0.7.0 // indirect
|
||||
github.com/ulikunitz/xz v0.5.10 // indirect
|
||||
github.com/vbatts/go-mtree v0.5.0 // indirect
|
||||
github.com/vbatts/tar-split v0.11.2 // indirect
|
||||
github.com/vifraa/gopom v0.1.0 // indirect
|
||||
github.com/wagoodman/go-partybus v0.0.0-20210627031916-db1f5573bbc5 // indirect
|
||||
github.com/wagoodman/go-progress v0.0.0-20200731105512-1020f39e6240 // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.0 // indirect
|
||||
github.com/xeonx/timeago v1.0.0-rc5 // indirect
|
||||
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
|
||||
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
|
||||
go.etcd.io/bbolt v1.3.6 // indirect
|
||||
go.opencensus.io v0.23.0 // indirect
|
||||
go.uber.org/atomic v1.10.0 // indirect
|
||||
go.uber.org/multierr v1.8.0 // indirect
|
||||
go.uber.org/zap v1.23.0 // indirect
|
||||
golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be // indirect
|
||||
golang.org/x/exp v0.0.0-20220823124025-807a23277127 // indirect
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
|
||||
golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458 // indirect
|
||||
golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1 // indirect
|
||||
golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0 // indirect
|
||||
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec // indirect
|
||||
golang.org/x/term v0.0.0-20220919170432-7a66f970e087 // indirect
|
||||
golang.org/x/text v0.3.8-0.20211004125949-5bd84dd9b33b // indirect
|
||||
golang.org/x/tools v0.1.12 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
|
||||
gonum.org/v1/gonum v0.7.0 // indirect
|
||||
go.opencensus.io v0.24.0 // indirect
|
||||
golang.org/x/crypto v0.19.0 // indirect
|
||||
golang.org/x/net v0.21.0 // indirect
|
||||
golang.org/x/oauth2 v0.15.0 // indirect
|
||||
golang.org/x/sync v0.6.0 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
golang.org/x/time v0.5.0 // indirect
|
||||
google.golang.org/api v0.152.0 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e // indirect
|
||||
google.golang.org/grpc v1.50.1 // indirect
|
||||
google.golang.org/protobuf v1.28.1 // indirect
|
||||
gopkg.in/neurosnap/sentences.v1 v1.0.6 // indirect
|
||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
lukechampine.com/uint128 v1.1.1 // indirect
|
||||
modernc.org/cc/v3 v3.36.0 // indirect
|
||||
modernc.org/ccgo/v3 v3.16.6 // indirect
|
||||
modernc.org/libc v1.16.7 // indirect
|
||||
modernc.org/mathutil v1.4.1 // indirect
|
||||
modernc.org/memory v1.1.1 // indirect
|
||||
modernc.org/opt v0.1.1 // indirect
|
||||
modernc.org/sqlite v1.17.3 // indirect
|
||||
modernc.org/strutil v1.1.1 // indirect
|
||||
modernc.org/token v1.0.0 // indirect
|
||||
nhooyr.io/websocket v1.8.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
|
||||
google.golang.org/grpc v1.59.0 // indirect
|
||||
google.golang.org/protobuf v1.31.0 // indirect
|
||||
olympos.io/encoding/edn v0.0.0-20201019073823-d3554ca0b0a3 // indirect
|
||||
)
|
||||
|
||||
120
gomod2nix.toml
Normal file
120
gomod2nix.toml
Normal file
@@ -0,0 +1,120 @@
|
||||
schema = 3
|
||||
|
||||
[mod]
|
||||
[mod."cloud.google.com/go"]
|
||||
version = "v0.110.10"
|
||||
hash = "sha256-D+V6LaCiCdthJ6W0s220Dyqa7/iReEIv5vqxtOGvy/A="
|
||||
[mod."cloud.google.com/go/compute"]
|
||||
version = "v1.23.3"
|
||||
hash = "sha256-WwlTw/x9GSM6B4nHm9FDvHZ1Pd4KN0wxk650CosJnpQ="
|
||||
[mod."cloud.google.com/go/compute/metadata"]
|
||||
version = "v0.2.3"
|
||||
hash = "sha256-kYB1FTQRdTDqCqJzSU/jJYbVUGyxbkASUKbEs36FUyU="
|
||||
[mod."cloud.google.com/go/logging"]
|
||||
version = "v1.8.1"
|
||||
hash = "sha256-IV9XuCsfgXsFyKfAVt5NZTL/My2rsqVVl5KthrwJKeU="
|
||||
[mod."cloud.google.com/go/longrunning"]
|
||||
version = "v0.5.4"
|
||||
hash = "sha256-56t2WfP5G78XcOGnBHoJ5/FinQZ51LTcMNh56MpFXA0="
|
||||
[mod."github.com/atomist-skills/go-skill"]
|
||||
version = "v0.0.56"
|
||||
hash = "sha256-FXDnXnNBKP0A7N9S4KYzmAqcDGlNPhnKATYpUxO97uc="
|
||||
[mod."github.com/containerd/typeurl/v2"]
|
||||
version = "v2.1.1"
|
||||
hash = "sha256-WvDTqBL4w4LAID/zEbbyXDppHenSWeQPVvEmF4pMn3A="
|
||||
[mod."github.com/distribution/reference"]
|
||||
version = "v0.5.0"
|
||||
hash = "sha256-nTlqurp/J/xOZeR0JcJMmE4GUHMMd5I+EOR7huzYuok="
|
||||
[mod."github.com/docker/distribution"]
|
||||
version = "v2.8.3+incompatible"
|
||||
hash = "sha256-XhRURCGNpJC83QZTtgCxHHFL76HaxIxjt70HwUa847E="
|
||||
[mod."github.com/gogo/protobuf"]
|
||||
version = "v1.3.2"
|
||||
hash = "sha256-pogILFrrk+cAtb0ulqn9+gRZJ7sGnnLLdtqITvxvG6c="
|
||||
[mod."github.com/golang/groupcache"]
|
||||
version = "v0.0.0-20210331224755-41bb18bfe9da"
|
||||
hash = "sha256-7Gs7CS9gEYZkbu5P4hqPGBpeGZWC64VDwraSKFF+VR0="
|
||||
[mod."github.com/golang/protobuf"]
|
||||
version = "v1.5.3"
|
||||
hash = "sha256-svogITcP4orUIsJFjMtp+Uv1+fKJv2Q5Zwf2dMqnpOQ="
|
||||
[mod."github.com/google/s2a-go"]
|
||||
version = "v0.1.7"
|
||||
hash = "sha256-E+SX/3VmRI5qN7SbnRP4Tt+gQTq93pScpY9U2tTmIU0="
|
||||
[mod."github.com/google/uuid"]
|
||||
version = "v1.6.0"
|
||||
hash = "sha256-VWl9sqUzdOuhW0KzQlv0gwwUQClYkmZwSydHG2sALYw="
|
||||
[mod."github.com/googleapis/enterprise-certificate-proxy"]
|
||||
version = "v0.3.2"
|
||||
hash = "sha256-wVuR3QC0mYFl5LNeKdRXdKdod7BGP5sv2h6VVib85v8="
|
||||
[mod."github.com/googleapis/gax-go/v2"]
|
||||
version = "v2.12.0"
|
||||
hash = "sha256-ZcXS+1B11UaJHf8D15N3ZCh00fiMUncpHd+eNRffLZ4="
|
||||
[mod."github.com/jackpal/bencode-go"]
|
||||
version = "v1.0.0"
|
||||
hash = "sha256-VvHNhCbSn2qZfX49dVKGd4Ds+5qNzREw4CYmIGV36Zc="
|
||||
[mod."github.com/kballard/go-shellquote"]
|
||||
version = "v0.0.0-20180428030007-95032a82bc51"
|
||||
hash = "sha256-AOEdKETBMUC39ln6jBJ9NYdJWp++jV5lSbjNqG3dV+c="
|
||||
[mod."github.com/moby/buildkit"]
|
||||
version = "v0.13.1"
|
||||
hash = "sha256-l78ItsqxSV/i/r3MpEgibO0ayp2sfOMUjseJUzDBml0="
|
||||
[mod."github.com/moby/patternmatcher"]
|
||||
version = "v0.6.0"
|
||||
hash = "sha256-ny3L8ktj8cyN41CEJhaRT74Vi8HpXXsbTvlrw/Tl5+g="
|
||||
[mod."github.com/opencontainers/go-digest"]
|
||||
version = "v1.0.0"
|
||||
hash = "sha256-cfVDjHyWItmUGZ2dzQhCHgmOmou8v7N+itDkLZVkqkQ="
|
||||
[mod."github.com/pkg/errors"]
|
||||
version = "v0.9.1"
|
||||
hash = "sha256-mNfQtcrQmu3sNg/7IwiieKWOgFQOVVe2yXgKBpe/wZw="
|
||||
[mod."github.com/sirupsen/logrus"]
|
||||
version = "v1.9.3"
|
||||
hash = "sha256-EnxsWdEUPYid+aZ9H4/iMTs1XMvCLbXZRDyvj89Ebms="
|
||||
[mod."go.opencensus.io"]
|
||||
version = "v0.24.0"
|
||||
hash = "sha256-4H+mGZgG2c9I1y0m8avF4qmt8LUKxxVsTqR8mKgP4yo="
|
||||
[mod."golang.org/x/crypto"]
|
||||
version = "v0.19.0"
|
||||
hash = "sha256-Vi6vY/eWNlYQ9l3Y+gA+X2+h2CmzEOrBRVFO/cnrPWc="
|
||||
[mod."golang.org/x/net"]
|
||||
version = "v0.21.0"
|
||||
hash = "sha256-LfiqMpPtqvW/eLkfx6Ebr5ksqKbQli6uq06c/+XrBsw="
|
||||
[mod."golang.org/x/oauth2"]
|
||||
version = "v0.15.0"
|
||||
hash = "sha256-exA/abu6WOR7Cwqa41LpnTD2xQNRZMYU5CnBKvXHx8Y="
|
||||
[mod."golang.org/x/sync"]
|
||||
version = "v0.6.0"
|
||||
hash = "sha256-LLims/wjDZtIqlYCVHREewcUOX4hwRwplEuZKPOJ/HI="
|
||||
[mod."golang.org/x/sys"]
|
||||
version = "v0.17.0"
|
||||
hash = "sha256-e0qnE+SitE02IzvnJKI4Uzpq9EOZY+zvE8Wf5b2e6Kg="
|
||||
[mod."golang.org/x/text"]
|
||||
version = "v0.14.0"
|
||||
hash = "sha256-yh3B0tom1RfzQBf1RNmfdNWF1PtiqxV41jW1GVS6JAg="
|
||||
[mod."golang.org/x/time"]
|
||||
version = "v0.5.0"
|
||||
hash = "sha256-W6RgwgdYTO3byIPOFxrP2IpAZdgaGowAaVfYby7AULU="
|
||||
[mod."google.golang.org/api"]
|
||||
version = "v0.152.0"
|
||||
hash = "sha256-F9stOfrDxo7FXrEmHgc2us4qMPsUlI170TJX6Nf1vRE="
|
||||
[mod."google.golang.org/appengine"]
|
||||
version = "v1.6.7"
|
||||
hash = "sha256-zIxGRHiq4QBvRqkrhMGMGCaVL4iM4TtlYpAi/hrivS4="
|
||||
[mod."google.golang.org/genproto"]
|
||||
version = "v0.0.0-20231106174013-bbf56f31fb17"
|
||||
hash = "sha256-SsVkLjjNQGVXQBXXzX/OkauZ+Eo/XLOsfvf7jeul6F4="
|
||||
[mod."google.golang.org/genproto/googleapis/api"]
|
||||
version = "v0.0.0-20231106174013-bbf56f31fb17"
|
||||
hash = "sha256-HEYq4ualnRizyySTBztWWhHEgMNScqOHUhFvTSDmjnA="
|
||||
[mod."google.golang.org/genproto/googleapis/rpc"]
|
||||
version = "v0.0.0-20231120223509-83a465c0220f"
|
||||
hash = "sha256-Do8ynxqxx6pNuJtSV1funHh3opINC364G/hOp2nEM1k="
|
||||
[mod."google.golang.org/grpc"]
|
||||
version = "v1.59.0"
|
||||
hash = "sha256-IcwmXyeroUg742wqU4Zikwxm7y0i7x4axOPdWOGPkzE="
|
||||
[mod."google.golang.org/protobuf"]
|
||||
version = "v1.31.0"
|
||||
hash = "sha256-UdIk+xRaMfdhVICvKRk1THe3R1VU+lWD8hqoW/y8jT0="
|
||||
[mod."olympos.io/encoding/edn"]
|
||||
version = "v0.0.0-20201019073823-d3554ca0b0a3"
|
||||
hash = "sha256-3tNwXD9FaoYaUWeDdgBJAVLzPviCpE+a528hzj88Sx8="
|
||||
57
main.go
57
main.go
@@ -1,8 +1,10 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"dockerfileparse/user/parser/babashka"
|
||||
"dockerfileparse/user/parser/docker"
|
||||
"babashka-pod-docker/babashka"
|
||||
"babashka-pod-docker/docker"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/atomist-skills/go-skill"
|
||||
"github.com/sirupsen/logrus"
|
||||
@@ -10,25 +12,42 @@ import (
|
||||
|
||||
func main() {
|
||||
skill.Log.SetLevel(logrus.ErrorLevel)
|
||||
for {
|
||||
message, err := babashka.ReadMessage()
|
||||
if err != nil {
|
||||
babashka.WriteErrorResponse(message, err)
|
||||
continue
|
||||
}
|
||||
|
||||
res, err := docker.ProcessMessage(message)
|
||||
if err != nil {
|
||||
babashka.WriteErrorResponse(message, err)
|
||||
continue
|
||||
}
|
||||
args := os.Args
|
||||
|
||||
describeres, ok := res.(*babashka.DescribeResponse)
|
||||
if ok {
|
||||
babashka.WriteDescribeResponse(describeres)
|
||||
continue
|
||||
if len(args) < 2 {
|
||||
args = append(os.Args, "pod")
|
||||
}
|
||||
|
||||
switch args[1] {
|
||||
|
||||
case "docker-cli-plugin-metadata":
|
||||
metadata := `{"SchemaVersion": "0.1.0", "Vendor": "Docker Inc.", "Version": "v0.0.1", "ShortDescription": "Docker Pod"}`
|
||||
fmt.Println(metadata)
|
||||
|
||||
case "pod":
|
||||
for {
|
||||
message, err := babashka.ReadMessage()
|
||||
if err != nil {
|
||||
babashka.WriteErrorResponse(message, err)
|
||||
continue
|
||||
}
|
||||
|
||||
res, err := docker.ProcessMessage(message)
|
||||
if err != nil {
|
||||
babashka.WriteErrorResponse(message, err)
|
||||
continue
|
||||
}
|
||||
|
||||
describeres, ok := res.(*babashka.DescribeResponse)
|
||||
if ok {
|
||||
babashka.WriteDescribeResponse(describeres)
|
||||
continue
|
||||
}
|
||||
|
||||
if res != "running" {
|
||||
babashka.WriteInvokeResponse(message, res)
|
||||
}
|
||||
}
|
||||
// TODO don't write done responses when callback is running
|
||||
babashka.WriteInvokeResponse(message, res)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
export ATOMIST_LOG_LEVEL=warn; $(dirname "$0")/babashka-pod-docker
|
||||
@@ -1,4 +1,4 @@
|
||||
{:pod/name docker/babashka-pod-docker
|
||||
{:pod/name docker/docker-tools
|
||||
:pod/description "docker golang utils for clojure"
|
||||
:pod/version "0.1.0"
|
||||
:pod/license "Apache"
|
||||
@@ -8,16 +8,16 @@
|
||||
[{:os/name "Linux.*"
|
||||
:os/arch "amd64"
|
||||
:artifact/url "https://github.com/docker/babashka-pod-docker/releases/download/v0.1.0/babashka-pod-docker-0.1.0-linux-amd64.zip"
|
||||
:artifact/executable "go.sh"}
|
||||
:artifact/executable "babashka-pod-docker"}
|
||||
{:os/name "Mac.*"
|
||||
:os/arch "x86_64"
|
||||
:artifact/url "https://github.com/docker/babashka-pod-docker/releases/download/v0.1.0/babashka-pod-docker-0.1.0-macos-x86_64.zip"
|
||||
:artifact/executable "go.sh"}
|
||||
:artifact/executable "babashka-pod-docker"}
|
||||
{:os/name "Mac.*"
|
||||
:os/arch "aarch64"
|
||||
:artifact/url "https://github.com/docker/babashka-pod-docker/releases/download/v0.1.0/babashka-pod-docker-0.1.0-macos-arm64.zip"
|
||||
:artifact/executable "go.sh"}
|
||||
:artifact/executable "babashka-pod-docker"}
|
||||
{:os/name "Linux.*"
|
||||
:os/arch "aarch64"
|
||||
:artifact/url "https://github.com/docker/babashka-pod-docker/releases/download/v0.1.0/babashka-pod-docker-0.1.0-linux-arm64.zip"
|
||||
:artifact/executable "go.sh"}]}
|
||||
:artifact/executable "babashka-pod-docker"}]}
|
||||
Reference in New Issue
Block a user