feat: add apk and cargo packages to devbox
Some checks failed
Publish image / Generate job matrices (push) Successful in 10s
Publish image / create-docker-images (map[name:devbox path:boxes/devbox]) (push) Has been cancelled

This commit is contained in:
Alexander Navarro 2024-11-08 10:04:14 -03:00
parent 48d623b989
commit 690d9d3f6b
Signed by untrusted user who does not match committer: anavarro
GPG key ID: 6426043E9FA3E3B5

View file

@ -1,23 +1,39 @@
FROM rust:latest AS rust-builder
# setup cargo packages, prefer to use apk packages
# to reduce build time and space
RUN --mount=type=cache,target=/app/target/ \
--mount=type=cache,target=/usr/local/cargo/git/db \
--mount=type=cache,target=/usr/local/cargo/registry/ \
cargo install --locked \
cocogitto \
yazi-fm yazi-cli \
tealdeer
FROM quay.io/toolbx-images/alpine-toolbox:edge FROM quay.io/toolbx-images/alpine-toolbox:edge
# Update system and install packages # Setup alpine packages
RUN apk update && apk upgrade && \ RUN --mount=type=cache,target=/var/cache/apk/ \
apk add --no-cache \ apk update && apk upgrade && apk add \
neovim \ build-base \
git \
lazygit \
zsh \
curl \ curl \
wget \
ripgrep \
fd \ fd \
fzf \ fzf \
alpine-sdk \ git \
build-base \ lazygit \
python3 \ neovim \
py3-pip \ nushell \
yazi \ openssh \
openssh ripgrep \
sd \
starship \
tmux \
tree-sitter-cli \
zoxide \
zsh
# Import cargo packages
COPY --from=rust-builder /usr/local/cargo/bin/* /usr/local/bin/
# Set environment variables # Set environment variables
ENV EDITOR=nvim \ ENV EDITOR=nvim \
@ -27,16 +43,11 @@ ENV EDITOR=nvim \
LC_ALL=en_US.UTF-8 \ LC_ALL=en_US.UTF-8 \
SHELL=/bin/zsh SHELL=/bin/zsh
# Install and initialize chezmoi # Basic setup
RUN sh -c "$(curl -fsLS get.chezmoi.io)" -- -b /usr/local/bin && \ RUN \
mkdir -p ~/.local/share/chezmoi # chsh -s /usr/bin/nu ## TODO: first create a configuration for nu
chsh -s /bin/zsh
RUN chsh -s /bin/zsh
RUN mkdir -p /workspace
WORKDIR /workspace
# Build commands: # Build commands:
# Docker: docker build -t dev-env . # Docker: docker build -t devbox .
# Podman: podman build -t dev-env . # Podman: podman build -t devbox .