Skip to content

zon-dev/docker-zig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How To Build and Deploy a Zig application with Docker

Usage

docker build -t ziglang .
docker run -it --rm ziglang

Go to the application directory and use zig in docker to build and run your application. For example. Create a hello-world program and run it with docker.

echo '
const std = @import("std");

pub fn main() void {
    std.debug.print("Hello, world!\n", .{});
}
' > hello.zig

Now, run your hello-world program.

docker run -it --rm -v $PWD:/opt/app ziglang zig run hello.zig