Skip to content

Latest commit

 

History

History
145 lines (96 loc) · 3.57 KB

README.md

File metadata and controls

145 lines (96 loc) · 3.57 KB

Pop!_OS Developer Playbook

This playbook installs most of the software that I use on my dev machine for web and software development.

Assumptions

Meant to be used on a fresh install of Pop!_OS 22.04, but should work on existing installs of the OS (be sure to configure only what you need). It will probably work on Ubuntu if flatpak is installed, but that hasn't been tested so your mileage may vary.

Prerequisites

You will need pip and ansible installed on your machine which can be done with the following commands:

sudo apt install python3-pip
pip install --user ansible
export PATH=$PATH:~/.local/bin

Installation

Download or clone this repository to your local drive.

git clone https://github.com/crbanman/popos-dev-playbook.git
cd popos-dev-playbook

Install dependencies:

ansible-galaxy install -r requirements.yml

Usage

  1. Make a copy of default.config.yml with the name config.yml and change the configurations you want to use.

  2. Run the playbook with the command and enter your user account password when prompted:

    ansible-playbook main.yml --ask-become-pass
  3. Restart your machine.

Manual changes

There are some things that I haven't been able to automate yet.

Set node version

Download and set currently used node version with nvm. This should theoretically be handled by the playbook, but it doesn't.

nvm install --lts
nvm use --lts

Install yarn

Yarn can be installed once npm (from setting the node version).

npm install --global yarn

Register SSH Keys

Add ssh keys. For better or worse I backup my keys, so I need to copy them to ~/.ssh/ and add them to the ssh-agent.

  1. Set the the appropriate file permissions for each key:

    chmod 400 ~/.ssh/id_ed25519
  2. Start the ssh agent

    eval "$(ssh-agent -s)"
  3. For each key run ssh-add

    ssh-add ~/.ssh/id_ed25519

Run JetBrains Toolbox

Toolbox needs to be run once from the command line so the system can register the AppImage.

/opt/jetbrains-toolbox

Docker registry cache

Add docker image caching to avoid hitting the docker pull limit.

Note: This solution is probably overkill, but I have run into the limit a couple of times in the past when working on some docker stuff. Just signing in to docker hub will double your pulls from 100 pull to 200 pulls every 6 hours.

  1. Pull and run the registry image on port 6000

    docker run -d -p 6000:5000 \
    -e REGISTRY_PROXY_REMOTEURL=https://registry-1.docker.io \
    --restart always \
    --name registry registry:2

    Note: This container will automatically restart when docker is restarted (i.e. system bootup)

  2. Create the file /etc/docker/daemon.json

    {
      "registry-mirrors": ["http://localhost:6000"]
    }
  3. Restart the docker service

    sudo systemctl restart docker
  4. Test that the mirror is working

    1. Pull an image you don't already have locally
      docker pull node
    2. Curl the local registry
      curl http://localhost:6000/v2/_catalog
      Expected result:
      {"repositories":["library/node"]}

Author

This project was created by Cody Banman (originally inspired by geerlingguy/mac-dev-playbook and staticdev/linux-developer-playbook)