mirror of
https://github.com/ViViDboarder/shoestrap.git
synced 2024-12-03 17:26:47 +00:00
Add Dockerfile to run dev env in an image
This is a large, 2.8GB image, but doable!
This commit is contained in:
parent
feeb17fd00
commit
5401bd67c6
34
Dockerfile
Normal file
34
Dockerfile
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
FROM ubuntu:hirsute
|
||||||
|
|
||||||
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends sudo
|
||||||
|
|
||||||
|
RUN useradd -m vividboarder
|
||||||
|
RUN echo "vividboarder:vividboarder" | chpasswd
|
||||||
|
RUN adduser vividboarder sudo
|
||||||
|
|
||||||
|
VOLUME /home/vividboarder
|
||||||
|
ENV HOME /home/vividboarder
|
||||||
|
|
||||||
|
RUN mkdir /shoestrap
|
||||||
|
WORKDIR /shoestrap
|
||||||
|
COPY ./helpers ./helpers
|
||||||
|
COPY ./ansible-cookbook ./
|
||||||
|
|
||||||
|
RUN mkdir -p ./recipes/default ./assets/default
|
||||||
|
COPY ./recipes/default/packages ./recipes/default/
|
||||||
|
RUN ./ansible-cookbook default packages
|
||||||
|
|
||||||
|
COPY ./recipes/default/vim-settings ./recipes/default/
|
||||||
|
RUN ./ansible-cookbook default vim-settings
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
RUN ./ansible-cookbook default dotfiles
|
||||||
|
RUN ./ansible-cookbook default bin
|
||||||
|
RUN ./ansible-cookbook default fish
|
||||||
|
RUN ./ansible-cookbook default git
|
||||||
|
|
||||||
|
RUN chown -R vividboarder:vividboarder /home/vividboarder
|
||||||
|
USER vividboarder
|
||||||
|
WORKDIR /home/vividboarder
|
4
Makefile
4
Makefile
@ -9,3 +9,7 @@ install-hooks:
|
|||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test:
|
||||||
pre-commit run --all-files
|
pre-commit run --all-files
|
||||||
|
|
||||||
|
.PHONY: docker-build
|
||||||
|
docker-build:
|
||||||
|
docker build . -t devenv-$(USER)
|
||||||
|
19
docker-devenv.sh
Executable file
19
docker-devenv.sh
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
image_name=devenv-$(whoami)
|
||||||
|
container_name=$image_name-run
|
||||||
|
|
||||||
|
if ! docker inspect "$container_name" > /dev/null ; then
|
||||||
|
echo "start new"
|
||||||
|
docker run -it \
|
||||||
|
--hostname="$(hostname)-docker" \
|
||||||
|
--env SSH_CLIENT=true \
|
||||||
|
--env TERM_PROGRAM="$TERM_PROGRAM" \
|
||||||
|
--env ITERM_PROFILE="$ITERM_PROFILE" \
|
||||||
|
--volume /:/host \
|
||||||
|
--name "$container_name" \
|
||||||
|
"$image_name" fish
|
||||||
|
else
|
||||||
|
echo "start existing"
|
||||||
|
docker start --attach --interactive "$container_name"
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user