Created
January 29, 2022 07:20
-
-
Save awkward-ninja/f85a6487d0331b392263a4601d9eb84f to your computer and use it in GitHub Desktop.
Rust dev container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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