-
-
Notifications
You must be signed in to change notification settings - Fork 1
HOWTO devops dev_containers
References:
- https://edgeguides.rubyonrails.org/getting_started_with_devcontainer.html
- https://edgeguides.rubyonrails.org/install_ruby_on_rails.html#install-ruby-on-ubuntu
- https://github.com/rails/rails-new?tab=readme-ov-file#installation
- https://mise.jdx.dev/
Follow, for example, https://linuxconfig.org/quick-guide-to-enabling-ssh-on-ubuntu-24-04:
$ sudo apt update
$ sudo apt upgrade
$ sudo apt install ssh
$ sudo systemctl enable ssh
$ sudo systemctl status ssh
$ sudo systemctl start ssh
$ sudo ufw allow ssh
$ sudo ufw enable
# Check that the ssh-agent is running:
$ ssh-agent -s
# Reuse any ssh identity carried or copied over from your previous laptop:
# (Copy both private & .pub files before)
$ ssh-add ~/.ssh/id_rsaAt this point, You should be able to clone any private repo from GitHub. Just make sure to use the "git@github.com:" prefix protocol for cloning, not "https:".
Use docker-ce, which is more up-to-date than the default Ubuntu docker.io package.
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
$ sudo apt update
$ sudo apt install docker-ce -y
$ sudo systemctl status docker
$ sudo usermod -aG docker $USER
# Update groups and display renewed groups for current user:
$ newgrp
$ groups $USERAt this point, you should be able to run docker ps without sudo.
$ sudo apt update
$ sudo apt install codeOr use https://code.visualstudio.com/.
Install the Dev Containers extension by downloading it from the VSCode marketplace if not already installed.
VS Code's container configuration is stored in a devcontainer.json file inside your project.
See https://code.visualstudio.com/docs/devcontainers/containers#_create-a-devcontainerjson-file for more details.
References:
Go to the latest release and download the executable for your platform (not the source code).
For example, on M1 macOS this would be rails-new-aarch64-apple-darwin.tar.gz.
Once the download is complete, unzip the .tar.gz file, which will create the rails-new executable.
Move the executable into your path so that it is ready to run from the command line.
$ sudo mv rails-new /usr/local/binTo generate a new Rails application, you can run the following command:
rails-new myappOr with options:
rails-new myapp --main