1.3 KiB
1.3 KiB
Develop using a Container
Use podamn oder docker to provide the environment.
New to Podman / Docker?
Install either Docker or Podman (replace docker
in the following commands with podman
)
Building the Container
docker build -t fretenv .
Creating Container
docker create --name fretbuilder -v fretnixstore:/nix/store -v ../:/root/FRET localhost/fretenv:latest
The volume fretnixstore
is optional. It is used to cache the packges installed using nix in case you need to re-create the container.
Additionally, you can pass the following options to access the environment over ssh:
-p 2222:22 # 2222 is the ssh port of the container
-v $SOMEWHERE:/root # somewhere with a .ssh directory
Starting the Container
docker start fretbuilder
Entering the Container
docker exec -it fretbuilder bash
Using Nix
cd ~/FRET
nix develop # or nix-shell
If you want to load the nix-shell automatically:
eval "$(direnv hook bash)"
direnv allow
Removing the Environment
docker stop fretbuilder
docker container rm fretbuilder
docker image rm fretenv
Potential Issues
If you run into a limit on threads when using podman, use podman create --pids-limit=8192 ...