10 "git.arvados.org/arvados.git/lib/cmd"
14 handler = cmd.Multi(map[string]cmd.Handler{
15 "version": cmd.Version,
16 "-version": cmd.Version,
17 "--version": cmd.Version,
19 "ref2genome": &ref2genome{},
20 "vcf2fasta": &vcf2fasta{},
21 "import": &importer{},
22 "export-numpy": &exportNumpy{},
23 "filter": &filterer{},
24 "build-docker-image": &buildDockerImage{},
26 "plot": &pythonPlot{},
31 os.Exit(handler.RunCommand(os.Args[0], os.Args[1:], os.Stdin, os.Stdout, os.Stderr))
34 type buildDockerImage struct{}
36 func (cmd *buildDockerImage) RunCommand(prog string, args []string, stdin io.Reader, stdout, stderr io.Writer) int {
37 tmpdir, err := ioutil.TempDir("", "")
39 fmt.Fprint(stderr, err)
42 defer os.RemoveAll(tmpdir)
43 err = ioutil.WriteFile(tmpdir+"/Dockerfile", []byte(`FROM debian:10
44 RUN DEBIAN_FRONTEND=noninteractive \
46 apt-get dist-upgrade -y && \
47 apt-get install -y --no-install-recommends bcftools bedtools samtools python3-sklearn python3-matplotlib && \
51 fmt.Fprint(stderr, err)
54 docker := exec.Command("docker", "build", "--tag=lightning-runtime", tmpdir)
55 docker.Stdout = stdout
56 docker.Stderr = stderr
61 fmt.Fprintf(stderr, "built and tagged new docker image, lightning-runtime\n")