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
Codercord2y ago
<#1218577988187193355>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
flyerzrule
flyerzruleOP2y 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
Phorcys2y ago
could you send your template over so we can take a look ? Coder template*
flyerzrule
flyerzruleOP2y 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
flyerzruleOP2y ago
if you create a workspace using that template and open the terminal, you will not be able to run cargo
WheeledOne
WheeledOne16mo ago
Can confirm, just hit this myself
vvvvvvvvvvvvvvv
vvvvvvvvvvvvvvv16mo ago
have you ever found any other fix?
flyerzrule
flyerzruleOP16mo ago
No I didnt

Did you find this page helpful?