Skip to content

Commit

Permalink
feat: Install fish and import fish config
Browse files Browse the repository at this point in the history
  • Loading branch information
itislu committed Feb 8, 2025
1 parent b6e0cca commit 1c0efe8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && apt-get install -
xorg \
zlib1g-dev \
# User utilities
fish \
python3 \
python3-pip \
python3-venv \
Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
"WORKSPACE_FOLDER": "/workspaces/${localWorkspaceFolderBasename}"
}
},
"initializeCommand": "mkdir -p ${env:HOME}/.ssh && touch ${env:HOME}/.bashrc ${env:HOME}/.gitconfig ${env:HOME}/.zsh_history ${env:HOME}/.zshrc",
// Ensure directories and files to be mounted exist
"initializeCommand": "mkdir -p ${env:HOME}/.ssh ${env:HOME}/.config/fish && touch ${env:HOME}/.bashrc ${env:HOME}/.gitconfig ${env:HOME}/.zsh_history ${env:HOME}/.zshrc",
"mounts": [
// Synced
"source=${env:HOME}/.zsh_history,target=/home/${env:USERNAME:devcontainer}/.zsh_history,type=bind,consistency=cached",
// Read-only and copy
"source=${env:HOME}/.bashrc,target=/mnt/.bashrc,type=bind,consistency=cached,readonly=true",
"source=${env:HOME}/.config/fish,target=/mnt/.config/fish,type=bind,consistency=cached,readonly=true",
"source=${env:HOME}/.gitconfig,target=/mnt/.gitconfig,type=bind,consistency=cached,readonly=true",
"source=${env:HOME}/.ssh,target=/mnt/.ssh,type=bind,consistency=cached,readonly=true",
"source=${env:HOME}/.zshrc,target=/mnt/.zshrc,type=bind,consistency=cached,readonly=true"
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
- ${HOME}/.zsh_history:/home/${USERNAME:-devcontainer}/.zsh_history:cached
# Read-only and copy
- ${HOME}/.bashrc:/mnt/.bashrc:cached,ro
- ${HOME}/.config/fish:/mnt/.config/fish:cached,ro
- ${HOME}/.gitconfig:/mnt/.gitconfig:cached,ro
- ${HOME}/.ssh:/mnt/.ssh:cached,ro
- ${HOME}/.zshrc:/mnt/.zshrc:cached,ro
Expand Down
10 changes: 8 additions & 2 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ bash -c "$(curl -fsSL https://raw.githubusercontent.com/LeaYeh/42-Docker-DevEnv/
curl -fsSL https://raw.githubusercontent.com/LeaYeh/42-Docker-DevEnv/main/docker-compose.yml -o docker-compose.yml

# Ensure directories and files to be mounted exist
mkdir -p "$HOME/.ssh"
touch "$HOME/.bashrc" "$HOME/.gitconfig" "$HOME/.zsh_history" "$HOME/.zshrc"
mkdir -p \
"$HOME/.config/fish/" \
"$HOME/.ssh"
touch \
"$HOME/.bashrc" \
"$HOME/.gitconfig" \
"$HOME/.zsh_history" \
"$HOME/.zshrc"

# Build and run the container
docker-compose up --build -d 42-docker-devenv
Expand Down

0 comments on commit 1c0efe8

Please sign in to comment.