~dricottone/simple-builder

5efee8c6bb548138cfb63a24ed7c7747d366486a — Dominic Ricottone 7 months ago 5ff721e dev
Update

Cleaned up the Makefile recipes.

Updated everything for new versions of libraries.
3 files changed, 33 insertions(+), 22 deletions(-)

M Makefile
M docker.go
M go.mod
M Makefile => Makefile +15 -5
@@ 1,13 1,23 @@
simple-builder:
	go get -u
go.mod:
	go mod init git.dominic-ricottone.com/~dricottone/simple-builder
	go get github.com/docker/docker/client
	go get github.com/docker/docker/api/types/container
	go get github.com/docker/docker/api/types/mount
	go get github.com/opencontainers/image-spec/specs-go/v1

simple-builder: go.mod *.go
	go build .

build: simple-builder

clean:
	rm --force go.sum moby-demo
	rm --force --recursive dir1 dir2
	rm -f go.mod go.sum simple-builder

uninstall:
	rm -f ~/.local/bin/simple-builder

PWD=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))
install:
	ln -s $(PWD)simple-builder ~/.local/bin/simple-builder

.PHONY: clean install
.PHONY: build clean install

M docker.go => docker.go +3 -4
@@ 8,7 8,6 @@ import (
	"os"
	"os/signal"

	"github.com/docker/docker/api/types"
	"github.com/docker/docker/api/types/container"
	"github.com/docker/docker/api/types/mount"
	"github.com/docker/docker/client"


@@ 55,7 54,7 @@ func build_package(pkg Package, srcdir, pkgdir, arch string) error {
		return err
	}

	start_opts := types.ContainerStartOptions{}
	start_opts := container.StartOptions{}

	cli.ContainerStart(ctx, con.ID, start_opts)



@@ 64,7 63,7 @@ func build_package(pkg Package, srcdir, pkgdir, arch string) error {
		return err
	}

	rm_opts := types.ContainerRemoveOptions{
	rm_opts := container.RemoveOptions{
		Force: true,
	}



@@ 101,7 100,7 @@ func check_result(cli *client.Client, ctx context.Context, id string) error {

// Dump logs from a build.
func dump_logs(cli *client.Client, ctx context.Context, id string) {
	conf := types.ContainerLogsOptions{
	conf := container.LogsOptions{
		ShowStdout: true,
	}


M go.mod => go.mod +15 -13
@@ 1,22 1,24 @@
module git.dominic-ricottone.com/~dricottone/simple-builder

go 1.20
go 1.22.1

require (
	github.com/docker/docker v24.0.2+incompatible
	github.com/opencontainers/image-spec v1.0.2
)

require (
	github.com/Microsoft/go-winio v0.6.1 // indirect
	github.com/docker/distribution v2.8.2+incompatible // indirect
	github.com/docker/go-connections v0.4.0 // indirect
	github.com/Microsoft/go-winio v0.4.14 // indirect
	github.com/distribution/reference v0.6.0 // indirect
	github.com/docker/docker v26.0.0+incompatible // indirect
	github.com/docker/go-connections v0.5.0 // indirect
	github.com/docker/go-units v0.5.0 // indirect
	github.com/felixge/httpsnoop v1.0.4 // indirect
	github.com/go-logr/logr v1.4.1 // indirect
	github.com/go-logr/stdr v1.2.2 // indirect
	github.com/gogo/protobuf v1.3.2 // indirect
	github.com/moby/docker-image-spec v1.3.1 // indirect
	github.com/opencontainers/go-digest v1.0.0 // indirect
	github.com/opencontainers/image-spec v1.1.0 // indirect
	github.com/pkg/errors v0.9.1 // indirect
	golang.org/x/mod v0.10.0 // indirect
	golang.org/x/net v0.10.0 // indirect
	golang.org/x/sys v0.8.0 // indirect
	golang.org/x/tools v0.9.3 // indirect
	go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
	go.opentelemetry.io/otel v1.24.0 // indirect
	go.opentelemetry.io/otel/metric v1.24.0 // indirect
	go.opentelemetry.io/otel/trace v1.24.0 // indirect
	golang.org/x/sys v0.1.0 // indirect
)