Language Idiomatic bindings for building Container Images.
Containers are an optimal way to package and deploy your code. However, teaching developers to learn a new configuration file format, and toolchain, just to package their application in a container is an unnecessary barrier to entry for many programmers just starting out with containers.
Metaparticle/Package simplifies the task of building and deploying container images. Metaparticle/Package is a collection of libraries that enable programmers to build and deploy containers using code that feels familiar to them.
Here's a simple example of building a containerized Java application:
import io.metaparticle.annotations.Package;
import static io.metaparticle.Metaparticle.Containerize;
public class Main {
@Package(repository="brendanburns",
jarFile="path/to/my-fat-jar.jar")
public static void main(String[] args) {
Containerize(() -> {
System.out.println("Hello Metaparticle/Package");
});
}
}
When you run this program via the java
command or your IDE, rather than simply executing your code, this program
packages up the Java code in a container, and runs that container.
Currently:
- java
- dotnet core
- javascript (NodeJS)
But it's fairly straightforward to add other languages, we would love to see contributions.
For more details see the more complete walkthroughs for each language: