PATH getting overwritten

Hello, I am trying to setup a Rust dev container. I am using the official image but when I create a workspace it overwrites the PATH and removes /usr/local/cargo/bin from it. If I pull down the image locally, the PATH is as it should but not when using Coder
8 Replies
Codercord
Codercord9mo ago
<#1218577988187193355>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
flyerzrule
flyerzruleOP9mo ago
I fixed it by adding RUN echo "export PATH=\$PATH:/usr/local/cargo/bin" >> ~/.profile to the bottom of the Dockerfile. Its still quite annoying that that needs to be done.
Phorcys
Phorcys9mo ago
could you send your template over so we can take a look ? Coder template*
flyerzrule
flyerzruleOP9mo ago
Sure! These are the files for the broken version. dockerfile:
FROM rust:1.77-bookworm

RUN apt-get update \
&& apt-get install -y \
curl \
git \
sudo \
vim \
wget \
&& rm -rf /var/lib/apt/lists/*

ARG USER=coder
RUN useradd --groups sudo --no-create-home --shell /bin/bash ${USER} \
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \
&& chmod 0440 /etc/sudoers.d/${USER}
USER ${USER}
WORKDIR /home/${USER}
FROM rust:1.77-bookworm

RUN apt-get update \
&& apt-get install -y \
curl \
git \
sudo \
vim \
wget \
&& rm -rf /var/lib/apt/lists/*

ARG USER=coder
RUN useradd --groups sudo --no-create-home --shell /bin/bash ${USER} \
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \
&& chmod 0440 /etc/sudoers.d/${USER}
USER ${USER}
WORKDIR /home/${USER}
flyerzrule
flyerzruleOP9mo ago
if you create a workspace using that template and open the terminal, you will not be able to run cargo
WheeledOne
WheeledOne6mo ago
Can confirm, just hit this myself
z_z
z_z5mo ago
have you ever found any other fix?
flyerzrule
flyerzruleOP5mo ago
No I didnt
Want results from more Discord servers?
Add your server