Skip to content

Instantly share code, notes, and snippets.

@weakpixel
weakpixel / push-docker-multi-image-tar.go
Last active July 18, 2022 14:07
Use Crane to push a Docker multi image to registry
View push-docker-multi-image-tar.go
package main
import (
"flag"
"fmt"
"io"
"os"
"path"
"github.com/google/go-containerregistry/pkg/crane"
View hcl-simple-example-1.go
package main
import (
"fmt"
"os"
"github.com/hashicorp/hcl/v2/hclsimple"
)
var (
View hcl-simple-example-2.go
package main
import (
"fmt"
"os"
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/hcl/v2/gohcl"
"github.com/hashicorp/hcl/v2/hclsimple"
)
View hcl-var-and-func-example.go
package main
import (
"fmt"
"os"
"strings"
"github.com/spf13/cobra"
"github.com/zclconf/go-cty/cty"
View hcl-var-example-1.go
package main
import (
"fmt"
"os"
"strings"
"github.com/spf13/cobra"
"github.com/zclconf/go-cty/cty"
View medium-post-full-final.go
package main
import (
"fmt"
"os"
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/hcl/v2/gohcl"
"github.com/hashicorp/hcl/v2/hclsimple"
)
View medium-post-hcl-9.go
import (
"fmt"
"os"
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/hcl/v2/gohcl"
"github.com/hashicorp/hcl/v2/hclsimple"
)
var (
View medium-post-hcl-8.hcl
type Runner interface {
Run() error
}
View medium-post-hcl-7.go
type Config struct {
Tasks []*Task `hcl:"task,block"`
}
type Task struct {
Name string `hcl:"name,label"`
Steps []*Step `hcl:"step,block"`
}
type Step struct {
View medium-post-hcl-6.hcl
task "first_task" {
step "mkdir" "build_dir" {
path = "./build/"
}
step "exec" "list_build_dir" {
command = "ls ./build/"
}
}