Skip to content

Bundling NixGL in a Docker image #204

@khazaddum

Description

@khazaddum

Hi,

I have an app that uses a flake for building and it requires nixGL to run the GUI. I'm trying to bundle it in a Docker image like this:

        packages.dockerImage = let
          pkgs = import nixpkgs {
            system = system;
            overlays = [ nixgl.overlay ];
          };
        in
          pkgs.dockerTools.buildImage {
          name = "myapp";
          created = "now";
          tag = "0.1";
          copyToRoot = pkgs.buildEnv {
            paths = with pkgs; [
              self'.packages.default
              nixgl
            ];
            name = "image-root";
            pathsToLink = ["/bin"];
          };
          config = {
            Cmd = ["${pkgs.nixgl}/bin/nixGL ${self'.packages.default}/bin/myapp"];
          };
        };

This gives me an error that pkgs.nixgl is a set that can't be cast into a string. Also, if I remove the Cmd, the image is built but nixGL is not in the /bin folder or in the image's /nix/store.

What is the correct way of including nixGL in the image?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions