diff --git a/Dockerfile.ubuntu b/Dockerfile.ubuntu index d0bf61d..324c77d 100644 --- a/Dockerfile.ubuntu +++ b/Dockerfile.ubuntu @@ -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 diff --git a/Makefile b/Makefile index 469e2a0..93dd88f 100644 --- a/Makefile +++ b/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 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8546329 --- /dev/null +++ b/docker-compose.yml @@ -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 +