Skip to content

Instantly share code, notes, and snippets.

@garbas
Created May 12, 2016 19:46
Show Gist options
  • Save garbas/61d227b4a411439d543b74952f213afe to your computer and use it in GitHub Desktop.
Save garbas/61d227b4a411439d543b74952f213afe to your computer and use it in GitHub Desktop.
{}:
let
pkgs = import <nixpkgs> {};
run_app = pkgs.writeScriptBin "run-app" ''
#!/bin/sh
/bin/python -m SimpleHTTPServer ''${PORT:=5000}
'';
in pkgs.dockerTools.buildImage {
name = "docker-python";
tag = "1.0.0";
fromImage = null;
contents = with pkgs; [ busybox python run_app ];
config = {
ArgsEscaped = true;
AttachStderr = false;
AttachStdin = false;
AttachStdout = false;
Cmd = [ "run-app" ];
Domainname = "";
Entrypoint = null;
Env = [ "PATH=/bin" ];
ExposedPorts = { "5000/tcp" = {}; };
Hostname = "";
Image = "";
Labels = {};
OnBuild = [];
OpenStdin = false;
StdinOnce = false;
Tty = false;
User = "";
Volumes = null;
WorkingDir = "/";
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment