caesarnine / data-science-docker-vscode-template

163 stars 35 forks source link

software additions #4

Closed slackmoehrle closed 4 years ago

slackmoehrle commented 5 years ago

I've been using your container and I also read https://binal.pub/2019/04/running-vscode-in-docker/ which was helpful in getting started. I was able to get my ssh keys to persist using a bind mount.

However, I can't keep software installed. if I install vim or nano and set my editor variable when I restart this container none if it persists. This isn't my experience with other docker containers that I have. Can you explain why and how to fix this?

I am doing:

docker exec -it container_id /bin/bash

then:

apt-get update
apt-get install nano -y
export EDITOR=/bin/nano

works until I restart.

Thanks again for this project. I not only am learning more docker but also this workflow is perfect for the way i work on OSS projects docs.

EDIT: after reading more, it seems that adding to the Dockerfile something like:

RUN apt-get update \
    && apt-get install -y \
nano \
vim

and then I ran docker build . and it build, I saw it install:

The following NEW packages will be installed:
  nano vim vim-common vim-runtime xxd

but still when I run nano it isn't there

caesarnine commented 5 years ago

Hey! You did go down the right path - adding to the Dockerfile. When you do you docker build try something like

docker build -t test . and then docker run -it test bash and see whether nano and vim are installed.

slackmoehrle commented 5 years ago

yeah this totally worked. I'm not sure why docker build . didn't work although it built something...

Do you know of a good tutorial for customizing docker images, etc? I'm enjoying this environment.