Skip to content

Instantly share code, notes, and snippets.

@awkward-ninja
Created January 29, 2022 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awkward-ninja/f85a6487d0331b392263a4601d9eb84f to your computer and use it in GitHub Desktop.
Save awkward-ninja/f85a6487d0331b392263a4601d9eb84f to your computer and use it in GitHub Desktop.
Rust dev container
FROM rust:1
ARG UID
ARG USER
ARG GID
ARG GROUP
RUN \
groupadd --gid ${GID} ${GROUP} && \
useradd --uid ${UID} --gid ${GID} ${USER}
USER ${USER}
WORKDIR /work
#!/bin/sh
TAG=hyper-core
UID=$(id -u)
USER=$(id -un)
GID=$(id -g)
GROUP=$(id -gn)
docker build \
--quiet \
--tag ${TAG} \
--build-arg UID=${UID} \
--build-arg USER=${USER} \
--build-arg GID=${GID} \
--build-arg GROUP=${GROUP} \
${PWD} && \
docker run \
--interactive \
--tty --rm \
--env TERM=xterm-256color \
--volume ${HOME}:/home/${USER}:ro \
--volume ${PWD}:/work \
${TAG} $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment