# Github's Codespaces

**URL:** <https://forum.elixirforum.com/t/githubs-codespaces/43277>\
**Category:** Discussions\
**Tags:** development\
**Created:** [October 22, 2021, 2:58pm UTC](https://forum.elixirforum.com/t/githubs-codespaces/43277 "2021-10-22T14:58:43Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![kanishka](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/k/3e96dc/32.png) [@kanishka](https://forum.elixirforum.com/u/kanishka)\
**Post date:** [May 16, 2023, 11:43pm UTC](https://forum.elixirforum.com/t/githubs-codespaces/43277/8 "2023-05-16T23:43:59Z")

</div>

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:

```elixir
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:

```elixir
# 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

```

---

_[View the full topic](https://forum.elixirforum.com/t/githubs-codespaces/43277)._
