Skip to content

Commit

Permalink
feat: add zig, go, rust
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroenflvr committed Aug 9, 2024
1 parent b9f26f1 commit 98838b2
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=x86_64 debian:latest
FROM --platform=linux/amd64 debian:latest

ARG USERNAME=remotedev
ARG USER_UID=1000
Expand All @@ -9,7 +9,7 @@ RUN apt update -y && apt upgrade -y && \
libssl-dev zlib1g-dev libbz2-dev libreadline-dev libffi-dev libsqlite3-dev libgdbm-dev libncursesw5-dev liblzma-dev \
python3-dev python3-pip python3-venv

RUN apt install -y sudo openssh-server && apt clean
RUN apt install -y sudo openssh-server && apt clean && mkdir /var/run/sshd

RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
Expand All @@ -20,6 +20,30 @@ RUN groupadd --gid $USER_GID $USERNAME \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

RUN mkdir /var/run/sshd

# Install Golang
RUN wget https://go.dev/dl/go1.22.6.linux-amd64.tar.gz && \
mkdir /usr/local/go1.22.6.linux-amd64 &&\
tar -C /usr/local/go1.22.6.linux-amd64 -xzf go1.22.6.linux-amd64.tar.gz && \
ln -s /usr/local/go1.22.6.linux-amd64/go/bin/go /usr/local/bin/go &&\
rm go1.22.6.linux-amd64.tar.gz

# Set up Go environment variables
RUN echo "export PATH=$PATH:/usr/local/go/bin" >> /home/remotedev/.bashrc &&\
echo "export GOPATH=$HOME/go" >> /home/remotedev/.bashrc &&\
echo "export PATH=$PATH:$GOPATH/bin" >> /home/remotedev/.bashrc

# Install Zig
RUN wget https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz && \
tar -C /usr/local -xf zig-linux-x86_64-0.13.0.tar.xz && \
rm zig-linux-x86_64-0.13.0.tar.xz && \
ln -s /usr/local/zig-linux-x86_64-0.13.0/zig /usr/local/bin/zig

USER remotedev

# Install Rust using rustup
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN echo "PATH=/home/remotedev/.cargo/bin:$PATH" >> /home/remotedev/.bashrc

USER root
CMD ["/usr/sbin/sshd", "-D"]

0 comments on commit 98838b2

Please sign in to comment.