2
0
mirror of https://github.com/linka-cloud/d2vm.git synced 2025-12-14 15:03:12 +00:00

cli: improve flags and commands

docs: add README.md and examples
centos/rhel: fix dracut initramfs

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
2022-04-21 18:28:50 +02:00
parent c240aac13d
commit 5b8cad6176
22 changed files with 550 additions and 56 deletions

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package docker2vm
package d2vm
import (
"context"
@@ -27,7 +27,7 @@ import (
"go.linka.cloud/d2vm/pkg/docker"
)
func Convert(ctx context.Context, img string, size int64, password string, output string) error {
func Convert(ctx context.Context, img string, size int64, password string, output string, format string) error {
imgUUID := uuid.New().String()
tmpPath := filepath.Join(os.TempDir(), "d2vm", imgUUID)
if err := os.MkdirAll(tmpPath, os.ModePerm); err != nil {
@@ -74,7 +74,7 @@ func Convert(ctx context.Context, img string, size int64, password string, outpu
}
logrus.Infof("creating vm image")
b, err := NewBuilder(tmpPath, archivePath, "", size, r)
b, err := NewBuilder(tmpPath, archivePath, "", size, r, format)
if err != nil {
return err
}