Until recently I did not know that I could install packages with apt-get on gitpod as it always wanted me to have root permissions, here is how it should be done.
If you are using a public git repository make sure you have push permissions to the repository or fork the repository unless you are the real owner of the repository. Now you probably should be already aware that there is an actual `Browser Extension` for chrome and Mozilla, if not you should install that to make things easy instead of editing the URL(appending gitpod.io/#) all the time to open the repository in gitpod.
After you open the repository in gitpod run the below command
>> gp init
This will generate
.gitpod.yml and .gitpod.Dockerfile files. Now modify the docker file something like below( for install redis-server in my case)FROM gitpod/workspace-full
USER gitpod
RUN sudo apt-get update -q && \
sudo apt-get install -yq redis-server
Then make sure you commit both the files and push them back to the repository.
Close the existing gitpod workspace and relaunch the workspace by going to the actual repository in GitHub with the latest commit. This should start installing the packages and open the workspace.
You can read more about this here at Installing missing packages
Alternatively, you can also install packaged with
brew install <PackageName>.
Comments
Post a Comment