This mostly worked for me. There is a bug currently where docker images don’t seem to build properly in some situations, but I’m sure that will be fixed in codespaces soon. For now, I enable sudo and run apt install commands manually. I’m sure there is a simpler method than what I came up with. Also, until the docker image build bug is solved, the approach below will be very slow for working on many branches.
define a docker file, enable sudo:
FROM mcr.microsoft.com/devcontainers/universal:2
# add sudo, remove once docker file steps are finalized
RUN apt-get update \
&& apt-get install -y sudo \
&& echo vscode ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/vscode \
&& chmod 0440 /etc/sudoers.d/vscode
reference the dockerfile from devcontainer.json (see github codespace docs for an example)
Run the following install and cofiguration steps inside of the running codespace for now:
# RUN apt-get update
# RUN apt-get install -y jq
# RUN apt-get install -y universal-ctags
# RUN apt-get install -y git
# RUN apt-get install -y libopenblas-dev
# RUN apt-get install -y postgresql-12
# RUN apt-get install -y unixodbc
# RUN apt-get install -y inotify-tools
# RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.11.3
# add asdf lines to ~/.bashrc and source in terminal (see asdf install instructions)
# asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git
# asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
# asdf plugin-add yarn
# asdf plugin-add nodejs https://github.com/asdf-vm/asdf-nodejs.git
# TODO: install your SPA framework of choice, if using SPA
# with-ssl needed?
# export KERL_CONFIGURE_OPTIONS="--without-javac --without-wx"
# asdf install # takes long time, complains about xsltproc, fop. xmllint missing.
# edit hba to use "trust" for first 4 rows (sudo su - postgres; nano /etc/postgresql/12/main/pg_hba.conf)
# pg_ctlcluster 12 main start
# build up appropriate dev config file for connecting to postgres
# mix local.rebar --force
# mix local.rebar --force
# mix deps.get
# mix compile
# mix ecto.create
# mix ecto.load
# mix ecto.migrate


















