Skip to content
Discussion options

You must be logged in to vote

Here is a full example for you that also start the container.

Note that:

  • you cannot go run this as the logging driver will point to the temporary binary built by go that would not last, so, you should go build then run your binary
  • this depends on the nerdctl binary for oci-hooks (if you want to get rid of it, you have to implement that as well) (see NerdctlCmd)
func main() {
	// Implement logging
	if len(os.Args) == 3 && os.Args[1] == logging.MagicArgv1 {
		err := logging.Main(os.Args[2])
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
	}

	// Get options
	globalOpt := types.GlobalCommandOptions(*config.New())

	// Rootless
	_ = rootlessutil.ParentMain(globalOpt.HostGatewayIP)

	/…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@xgzlucario
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@xgzlucario
Comment options

Answer selected by xgzlucario
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants