summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/tunnel
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-05-21 13:58:51 -0500
committerBrent Baude <bbaude@redhat.com>2020-05-21 14:22:11 -0500
commit845a795a7a1666fb8af2abc6ce93c7152f06a9b9 (patch)
tree781967bb1056e841ab2533b78958330193aa8d0a /pkg/domain/infra/tunnel
parent9d3b46624b4eb3b6eeea38b5b1057914a9ff2baf (diff)
downloadpodman-845a795a7a1666fb8af2abc6ce93c7152f06a9b9.tar.gz
podman-845a795a7a1666fb8af2abc6ce93c7152f06a9b9.tar.bz2
podman-845a795a7a1666fb8af2abc6ce93c7152f06a9b9.zip
v2 podman-remote build
this is a very basic implementation of build. some of the more advanced options need to be included still as well. i think the endpoints for compat and libpod will have to split given buildahs more advanced set of options. that should probably be done by someone more experienced with build internals. Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/domain/infra/tunnel')
-rw-r--r--pkg/domain/infra/tunnel/images.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkg/domain/infra/tunnel/images.go b/pkg/domain/infra/tunnel/images.go
index 3d5626c45..c300e74d0 100644
--- a/pkg/domain/infra/tunnel/images.go
+++ b/pkg/domain/infra/tunnel/images.go
@@ -4,6 +4,7 @@ import (
"context"
"io/ioutil"
"os"
+ "path"
"strings"
"github.com/containers/common/pkg/config"
@@ -13,6 +14,7 @@ import (
"github.com/containers/libpod/pkg/domain/entities"
"github.com/containers/libpod/pkg/domain/utils"
utils2 "github.com/containers/libpod/utils"
+ "github.com/containers/storage/pkg/archive"
"github.com/pkg/errors"
)
@@ -265,7 +267,14 @@ func (ir *ImageEngine) Config(_ context.Context) (*config.Config, error) {
}
func (ir *ImageEngine) Build(ctx context.Context, containerFiles []string, opts entities.BuildOptions) (*entities.BuildReport, error) {
- return nil, errors.New("not implemented yet")
+ if len(containerFiles) > 1 {
+ return nil, errors.New("something")
+ }
+ tarfile, err := archive.Tar(path.Base(containerFiles[0]), 0)
+ if err != nil {
+ return nil, err
+ }
+ return images.Build(ir.ClientCxt, containerFiles, opts, tarfile)
}
func (ir *ImageEngine) Tree(ctx context.Context, nameOrId string, opts entities.ImageTreeOptions) (*entities.ImageTreeReport, error) {