Coding after Hours

Day 1 - Setting Up My Environment

I've spent countless hours customizing neovim environments one way or another. I've found any vscodium themes or extensions that may be helpful. But, I there's one piece of the puzzle that I've ignored, and I think has made me hesitant to dig deep into a project: I've haven't dedicated much time to setting up a dedicated environment to work in. I've got my tools to work with, but not a garage to work in. So let's set one up.

Off the bat, I have two potential solutions to this: nix flakes and docker containers, and as a retired NixOS user, I can safely say that my preferred solution to this is the latter. For my purposes, a general ubuntu container will work just fine, but I'd like to setup a dockerfile that I can use or improve upon as a progress. I'll be mostly working in C, which I'll talk about more in a later entry, so I won't need too many additional packages within the container.

For now all I'll need is:

09:30 - After reading some more documentation, I'm getting the hang of things and putting together a dockerfile with everything I need.

09:45 - custom bashrc successfully copied over. I'll build the container as user ubuntu so I don't have to source the rc file every time.

10:15 - I've got most of what I need for now. I'll probably setup a dockerhub repository at some point in the future.

At some point I'd like to connect my container to my custom neovim config, but, for now, I'll work in vscodium. Don't need to do everything all at once.

11:19 - Ran into more complications. Thinking back, there's really no reason yet for me to be creating users. I don't need strict permissions on a container that's not connecting anywhere else.

I'm starting to see how docker mounts work. In the end, this container is probably unnecessary, but it was helpful to learn more about how docker works.

FROM ubuntu:latest
WORKDIR /app/data

COPY ./bashrc /root/bashrc

RUN apt-get update && apt-get install -y --no-install-recommends \
        cowsay \ 
        g++ \
        git \
        tree \
        vim \
        && rm -rf /var/lib/apt/lists/*

RUN echo "alias l='ls -lh'" >> /root/.bashrc \
    && echo "alias ll='ls -h'" >> /root/.bashrc \
    && echo "alias lh='ls -ld .??*'" >> /root/.bashrc \
    && echo "alias lt='tree -L 1'" >> /root/.bashrc \
    && echo "alias cdl='cd && clear'" >> /root/.bashrc \
    && echo "alias cl='clear'" >> /root/.bashrc \
    && echo "alias v='vim'" >> /root/.bashrc

ENV PATH="$PATH:/usr/games"

VOLUME /app/data

CMD ["/bin/bash"]