Ejemplo n.º 1
0
        public async Task TestBasic_HelloWorldAsync()
        {
            ImageReference targetImageReference =
                ImageReference.Of("localhost:5002", "fibdotnet-core", "basic-helloworld");
            FibContainer fibContainer =
                await FibContainerBuilder.From("busybox")
                .SetEntrypoint("echo", "Hello World")
                .ContainerizeAsync(
                    Containerizer.To(
                        RegistryImage.Named(targetImageReference)
                        .AddCredentialRetriever(
                            () => Maybe.Of(Credential.From("username", "password"))))
                    .SetAllowInsecureRegistries(true)
                    .AddEventHandler <IFibEvent>(e => TestContext.Out.WriteLine(e))).ConfigureAwait(false);

            Assert.AreEqual("Hello World\n", PullAndRunBuiltImage(targetImageReference.ToString()));
            Assert.AreEqual(
                "Hello World\n",
                PullAndRunBuiltImage(
                    targetImageReference.WithTag(fibContainer.GetDigest().ToString()).ToString()));
        }