Skip to content

Commit

Permalink
Merge pull request #9 from sarg3nt/install-mise-from-docker-container
Browse files Browse the repository at this point in the history
Install mise from a docker file
  • Loading branch information
sarg3nt authored Oct 29, 2024
2 parents fd11cac + 61ecb58 commit 11dedee
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
# home/vscode/.config/mise/config.toml
# Add custom Mise tools and version to your projects root as .mist.toml See: https://mise.jdx.dev/configuration.html

FROM rockylinux:9@sha256:d7be1c094cc5845ee815d4632fe377514ee6ebcf8efaed6892889657e5ddaaa6
FROM jdxcode/mise@sha256:a9f92f8ddaf6450359cf0fd40fb36dd4e9be8b419a3c17305164497cace8af16 AS mise

FROM rockylinux:9@sha256:d7be1c094cc5845ee815d4632fe377514ee6ebcf8efaed6892889657e5ddaaa6 AS final

LABEL org.opencontainers.image.source=https://github.com/sarg3nt/go-dev-container

Expand All @@ -33,6 +35,9 @@ RUN /scripts/20_install_microsoft_dev_container_features.sh
# Set current user to the vscode user, run all future commands as this user.
USER vscode

# Copy the mise binary from the mise container
COPY --from=mise /usr/local/bin/mise /usr/local/bin/mise

# Install applications that are scoped to the vscode user
RUN sudo chown vscode /scripts

Expand All @@ -43,15 +48,11 @@ COPY --chown=vscode:vscode home/vscode/.config/mise /home/vscode/.config/mise
ARG MISE_VERBOSE=0
ARG RUST_BACKTRACE=0
# https://github.com/jdx/mise/releases
# Passed from the .devcontainer/devcontainer.json file, static version here to use as a default.
ARG MISE_VERSION="v2024.10.8"
RUN /scripts/30_install_mise.sh
RUN /scripts/30_install_mise_packages.sh

# https://github.com/go-delve/delve/releases
# Passed from the .devcontainer/devcontainer.json file, static version here to use as a default.
ARG GO_DELVE_DLV_VERSION="1.23.1"
# https://github.com/mvdan/gofumpt/releases
# Passed from the .devcontainer/devcontainer.json file, static version here to use as a default.
ARG GO_FUMPT_VERSION="0.7.0"
RUN /scripts/40_install_other_apps.sh

Expand Down
2 changes: 1 addition & 1 deletion home/vscode/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ alias help="/usr/local/bin/help"
[ -f ~/.fzf.bash ] && source ~/.fzf.bash

# Active mise
eval "$(~/.local/bin/mise activate bash)"
eval "$(/usr/local/bin/mise activate bash)"
mie trust --all
mise install --yes

Expand Down
4 changes: 2 additions & 2 deletions home/vscode/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ source "$HOME/.fzf-key-bindings.zsh"
source "$HOME/.fzf-completion.zsh"

# Active mise
eval "$(~/.local/bin/mise activate zsh)"
mie trust --all
eval "$(/usr/local/bin/mise activate zsh)"
mise trust --all
mise install --yes

help
2 changes: 1 addition & 1 deletion scripts/10_install_system_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ IFS=$'\n\t'
# Install system packages
main() {
source "/usr/bin/lib/sh/log.sh"
log "10-install-system-packages.sh" "blue"
log "10_install_system_packages.sh" "blue"

log "Adding install_weak_deps=False to /etc/dnf/dnf.conf" "green"
echo "install_weak_deps=False" >>/etc/dnf/dnf.conf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ main() {
source "/usr/bin/lib/sh/log.sh"

############ Install mise
log "30-install-mise.sh" "blue"
log "30_install_mise_packages.sh" "blue"

log "Installing mise" "green"
curl -sL https://mise.run | sh
# Mise is installed in the docker file from it's master docker branch.
log "Configuring mise" "green"
export PATH="$HOME/.local/share/mise/shims:$HOME/.local/bin/:$PATH"

log "Mise version" "green"
Expand Down
5 changes: 3 additions & 2 deletions scripts/40_install_other_apps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ main() {
source "/usr/bin/lib/sh/log.sh"
export PATH="$HOME/.local/share/mise/shims:$HOME/.local/bin/:$PATH"

log "50-install-other-apps.sh" "blue"
log "40_install_other_apps.sh" "blue"

add_go_tools
add_vscode_extensions_cache
Expand All @@ -25,7 +25,8 @@ add_go_tools() {
log "Adding Go Tools" "green"
go install "github.com/go-delve/delve/cmd/dlv@v${GO_DELVE_DLV_VERSION}"
go install "mvdan.cc/gofumpt@v${GO_FUMPT_VERSION}"
go install golang.org/x/tools/gopls@latest
# gopls is installed by the go plugin
#go install golang.org/x/tools/gopls@latest

# TODO: Find it if this is still needed and remove if not.
#echo "golang:x:999:vscode" | sudo tee -a /etc/group
Expand Down

0 comments on commit 11dedee

Please sign in to comment.