mirror of
https://github.com/mentos1386/dotfiles.git
synced 2025-02-23 01:33:36 +00:00
feat(workspace): add rust/go/node and docker-compose
This commit is contained in:
parent
bdb8dab6d6
commit
6f3a342a96
3 changed files with 37 additions and 12 deletions
|
@ -21,12 +21,21 @@ RUN set -ueox pipefail \
|
|||
mosh \
|
||||
openssh-server \
|
||||
psmisc \
|
||||
&& sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \
|
||||
&& locale-gen \
|
||||
&& adduser --quiet --gecos '' --disabled-password --add_extra_groups "${SSH_USER}" \
|
||||
&& apt-get -yqq clean all \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
/tmp/* \
|
||||
/var/tmp/*
|
||||
|
||||
# Configure SSH
|
||||
RUN touch /etc/ssh/sshd_config.d/custom \
|
||||
&& echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config.d/custom \
|
||||
&& echo "PasswordAuthentication no" >> /etc/ssh/sshd_config.d/custom \
|
||||
&& echo "UsePAM no" >> /etc/ssh/sshd_config.d/custom \
|
||||
&& echo "X11Forwarding no" >> /etc/ssh/sshd_config.d/custom
|
||||
|
||||
# Install available packages
|
||||
RUN set -ueox pipefail \
|
||||
&& DEBIAN_FRONTEND=noninteractive \
|
||||
|
@ -44,6 +53,18 @@ RUN set -ueox pipefail \
|
|||
# Install other packages
|
||||
COPY --from=ghcr.io/mentos1386/starship:0.47.0 /starship /usr/local/bin/starship
|
||||
COPY --from=ghcr.io/mentos1386/kubectl:1.20.0 /kubectl /usr/local/bin/kubectl
|
||||
# Golang
|
||||
COPY --from=golang:1.15.6 --chown=${SSH_USER} /usr/local/go /home/${SSH_USER}/.go
|
||||
ENV PATH=/home/${SSH_USER}/.go/bin:$PATH
|
||||
# Rust
|
||||
COPY --from=rust:1.48.0 --chown=${SSH_USER} /usr/local/cargo /home/${SSH_USER}/.cargo
|
||||
COPY --from=rust:1.48.0 --chown=${SSH_USER} /usr/local/rustup /home/${SSH_USER}/.rustup
|
||||
ENV CARGO_HOME=/home/${SSH_USER}/.cargo
|
||||
ENV RUSTUP_HOME=/home/${SSH_USER}/.rustup
|
||||
ENV PATH=/home/${SSH_USER}/.cargo/bin:$PATH
|
||||
# Node
|
||||
COPY --from=node:15.5.0 --chown=${SSH_USER} /usr/local/bin/node /usr/local/bin/node
|
||||
# TODO: Add yarbn/npm/npx/yarnpkg??
|
||||
|
||||
# Create .dotfiles
|
||||
COPY --chown=${SSH_USER}:${SSH_USER} dotfiles /home/${SSH_USER}/.dotfiles
|
||||
|
|
19
Makefile
19
Makefile
|
@ -1,21 +1,16 @@
|
|||
.PHONY: build-ubuntu
|
||||
build-ubuntu:
|
||||
@docker buildx build --load -t env-ubuntu -f Dockerfile.ubuntu .
|
||||
REGISTRY=ghcr.io/mentos1386
|
||||
|
||||
build:
|
||||
@docker buildx build --load -t ${REGISTRY}/workspace-ubuntu:edge -f Dockerfile.ubuntu .
|
||||
|
||||
.PHONY: build-package-starship
|
||||
build-package-starship:
|
||||
@docker buildx build --load -t starship -f packages/Dockerfile.starship packages/
|
||||
@docker buildx build --load -t ${REGISTRY}/starship:0.47.0 -f packages/Dockerfile.starship packages/
|
||||
|
||||
.PHONY: build-package-kubectl
|
||||
build-package-kubectl:
|
||||
@docker buildx build --load -t kubectl -f packages/Dockerfile.kubectl packages/
|
||||
@docker buildx build --load -t ${REGISTRY}/kubectl:1.20.0 -f packages/Dockerfile.kubectl packages/
|
||||
|
||||
.PHONY: build-packages
|
||||
build-packages: package-kubectl package-starship
|
||||
|
||||
build: packages ubuntu
|
||||
|
||||
.PHONY: template
|
||||
template:
|
||||
@go run ./main.go template package-action > .github/workflows/packages.yaml
|
||||
@go run ./main.go template ubuntu-action > .github/workflows/ubuntu.yaml
|
||||
|
@ -25,6 +20,6 @@ pull:
|
|||
@docker pull ghcr.io/mentos1386/starship:0.47.0
|
||||
@docker pull ghcr.io/mentos1386/kubectl:1.20.0
|
||||
|
||||
run-ubuntu:
|
||||
run:
|
||||
@docker run -it --rm --workdir /home/tine --user tine ghcr.io/mentos1386/workspace-ubuntu:edge zsh
|
||||
|
||||
|
|
9
docker-compose.yml
Normal file
9
docker-compose.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
version: "3"
|
||||
|
||||
services:
|
||||
workspace-ubuntu:
|
||||
image: ghcr.io/mentos1386/workspace-ubuntu:edge
|
||||
ports:
|
||||
- 0.0.0.0:22022:22/tcp
|
||||
- 0.0.0.0:22022:22022/udp
|
||||
|
Loading…
Reference in a new issue