I’ve recently started to get into containerized development (of LaTeX documents for now) using VSCode with the Dev Containers Extension. While compilation and everything works fine, I’m a bit annoyed by the very barebones shell of my podman container in the integrated terminal. I’m used to zsh with syntax highlighting and autocompletion, I like to use neovim to write my commit messages (even when I’m using VSCode to write my code) and of course I need git and ssh to push to my git forge.

I wonder if it is recommended to

  1. install neovim, zsh, ssh, git inside the dev container using the package manager (apt in this case) and manually write some config files
  2. Specify the installation of those packages in the Containerfile for my dev container and configure the devcontainer.json to mount my host’s config files
  3. Use those tools from outside my dev container somehow
  4. Just not use any convenience tools like zsh, neovim, with individual config even, and only install purely functional packages like git and ssh in the container?

Since I’m not a software developer by training (trying to become one right now) I’d be very happy about some best practices or recommendations.

  • doeknius_gloek@discuss.tchncs.de
    link
    fedilink
    arrow-up
    7
    ·
    edit-2
    1 day ago

    The best practice would be using dev container features. Those are basically install scripts that get layered onto your container. See this list for some available features or write your own.

    One nice thing about features is that, in a collaborative environment, you can add required features for everyone directly in the devcontainer.json and personal preferences like a zsh feature in your settings.json (dev.containers.defaultFeatures) so they get installed into every container you open.

    • jdw@feddit.orgOP
      link
      fedilink
      arrow-up
      2
      ·
      1 day ago

      Thank you, I’ll check out features! The DefaultFeatures sound like the distinction between configuration for everyone and personal preferences that I was looking for!

  • setsubyou@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    1 day ago

    I basically do option 2, but I’d never mount all my configuration. If I want an isolated environment, I’m not making all my ssh keys available to it. So some things have to stay outside for me.

    • jdw@feddit.orgOP
      link
      fedilink
      arrow-up
      1
      ·
      1 day ago

      I know about distrobox, but it’s also just standard podman containers, right? So the question is what container to use, what to install in the container and what part of that to commit in the .devcontainer directory in git.

      For example for LaTeX development I’m using this container image https://islandoftex.gitlab.io/community/projects/docker/. I think starting the container via distrobox instead of podman doesn’t change anything about my question?

      • dotslashme@infosec.pub
        link
        fedilink
        English
        arrow-up
        5
        ·
        1 day ago

        I just use a straight up general Linux image, such as debian or arch and then install what I need inside them.

  • jokro@feddit.org
    link
    fedilink
    arrow-up
    2
    ·
    1 day ago
    1. and 3. sound like sensible options. Though none of the options is inherently wrong. But the first one doesn’t sound easily reproduceable.

    For 2: see the other comment https://feddit.org/post/25212909/11301373

    For 3: i think you can also create a “host” terminal in vscode? (Maybe i’m remembering wrong). Then you can simply cd to your project and use git etc as usual