diff --git a/.github/workflows/docker-hub-description.yml b/.github/workflows/docker-hub-description.yml index 834c149..3b32ae8 100644 --- a/.github/workflows/docker-hub-description.yml +++ b/.github/workflows/docker-hub-description.yml @@ -19,11 +19,20 @@ jobs: with: fetch-depth: 1 - - name: Docker Hub Description + - name: Docker Hub Description ZSHbuntu uses: peter-evans/dockerhub-description@v3 with: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - repository: macabrequinox/zshbuntu + repository: ${{ vars.DOCKERHUB_USERNAME }}/zshbuntu short-description: "Your Ultimate Ubuntu Image with Zsh Magic!" - readme-filepath: "./zshbuntu/docs/README.md" \ No newline at end of file + readme-filepath: "./zshbuntu/docs/README.md" + + - name: Docker Hub Description ZSHmazon + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: ${{ vars.DOCKERHUB_USERNAME }}/zshmazon + short-description: "Your Ultimate AmazonLinux2023 Image with Zsh Magic!" + readme-filepath: "./zshmazon/docs/README.md" \ No newline at end of file diff --git a/.github/workflows/docker-image-build.yml b/.github/workflows/docker-image-build.yml index 673d87c..071ae28 100644 --- a/.github/workflows/docker-image-build.yml +++ b/.github/workflows/docker-image-build.yml @@ -42,7 +42,7 @@ jobs: echo "git_tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT - id: zshbuntu - name: Build zshbuntu + name: Build ZSHbuntu uses: docker/build-push-action@v5 with: context: zshbuntu/ @@ -57,10 +57,26 @@ jobs: org.opencontainers.image.created=${{ steps.metadata.outputs.current_date }} org.opencontainers.image.revision=${{ github.sha }} + - id: zshmazon + name: Build ZSHmazon + uses: docker/build-push-action@v5 + with: + context: zshmazon/ + no-cache: true + push: true + tags: ${{ vars.DOCKERHUB_USERNAME }}/zshmazon:latest,${{ vars.DOCKERHUB_USERNAME }}/zshmazon:${{ steps.metadata.outputs.git_tag }} + platforms: linux/amd64,linux/arm64/v8 + labels: | + org.opencontainers.image.title=zshmazon + org.opencontainers.image.url=${{ github.repositoryUrl }} + org.opencontainers.image.version=${{ steps.metadata.outputs.git_tag }} + org.opencontainers.image.created=${{ steps.metadata.outputs.current_date }} + org.opencontainers.image.revision=${{ github.sha }} + - name: Summary run: | { - echo -e "Image: ${{ fromJson(steps.zshbuntu.outputs.metadata)['image.name'] }}\n" + echo -e "# Image: ${{ fromJson(steps.zshbuntu.outputs.metadata)['image.name'] }}\n" echo '
' echo 'Details' echo -e '\n```' @@ -68,4 +84,15 @@ jobs: echo -e '```' echo '
' echo -e '\n' + } >> $GITHUB_STEP_SUMMARY + + { + echo -e "# Image: ${{ fromJson(steps.zshmazon.outputs.metadata)['image.name'] }}\n" + echo '
' + echo 'Details' + echo -e '\n```' + echo -e "${{ steps.zshmazon.outputs.metadata }}" + echo -e '```' + echo '
' + echo -e '\n' } >> $GITHUB_STEP_SUMMARY \ No newline at end of file diff --git a/zshbuntu/Dockerfile b/zshbuntu/Dockerfile index cecff18..2b8a241 100644 --- a/zshbuntu/Dockerfile +++ b/zshbuntu/Dockerfile @@ -4,7 +4,8 @@ FROM ubuntu:${UBUNTU_VERSION} RUN apt update RUN apt install -y zsh sudo systemd vim iputils-ping curl && \ # apt install -y python3 pip && \ - apt install -y git tig + apt install -y git tig && \ + apt clean # Creating user RUN useradd -rm -d /home/sandbox -s /usr/bin/zsh -g root -G root -u 1001 sandbox && \ diff --git a/zshmazon/Dockerfile b/zshmazon/Dockerfile new file mode 100644 index 0000000..2d8179c --- /dev/null +++ b/zshmazon/Dockerfile @@ -0,0 +1,29 @@ +ARG AMAZON_LINUX_VERSION=2023 +FROM amazonlinux:${AMAZON_LINUX_VERSION} + +RUN yum update +RUN yum install -y zsh sudo vim iputils tar && \ + # apt install -y python3 pip && \ + yum install -y git tig && \ + yum clean all + +# Creating user +RUN useradd -rm -d /home/sandbox -s /usr/bin/zsh -g root -G root -u 1001 sandbox && \ + echo "sandbox ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/sudoers + +USER sandbox +WORKDIR /home/sandbox + +RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" +RUN git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions && \ + git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting && \ + git clone --depth=1 https://github.com/akarzim/zsh-docker-aliases.git ~/.oh-my-zsh/custom/plugins/zsh-docker-aliases && \ + sed -i 's/plugins=(git)/plugins=(git zsh-autosuggestions zsh-syntax-highlighting zsh-docker-aliases)/' .zshrc && \ + git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/custom/themes/powerlevel10k && \ + sed -i 's|ZSH_THEME=.*|ZSH_THEME="powerlevel10k/powerlevel10k"|' .zshrc + +RUN git config --global init.defaultBranch main && \ + git config --global user.name "Ubuntu Sandbox" && \ + git config --global user.email "sandbox@ubuntu.sanbdox.com" + +CMD ["zsh"] \ No newline at end of file diff --git a/zshmazon/docs/README.md b/zshmazon/docs/README.md new file mode 100644 index 0000000..cafe637 --- /dev/null +++ b/zshmazon/docs/README.md @@ -0,0 +1,46 @@ +Welcome to ZSHmazon – Your Ultimate AmazonLinux Image with Zsh Magic! + +Discover a world of command-line sophistication with our ZSHmazon Docker image. We've curated the perfect AmazonLinux environment enhanced with the power of Zsh, Oh-My-Zsh. Elevate your terminal experience with this feature-packed image, designed to boost your productivity and style. + +Whether you're a developer, system administrator, or terminal enthusiast, ZSHmazon empowers you with a captivating, efficient, and fun command-line experience. Download now and unlock the full potential of your AmazonLinux-based containers. + +Terminal Example + +## Key Features: + +- AmazonLinux base with [Zsh](https://en.wikipedia.org/wiki/Z_shell) magic. +- [Oh-My-Zsh](https://ohmyz.sh) for enhanced shell capabilities. +- [Powerlevel10k](https://github.com/romkatv/powerlevel10k) for eye-catching, customizable prompts. +- [Syntax highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) for code clarity. +- Vibrant [auto-suggestions](https://github.com/zsh-users/zsh-autosuggestions) for faster typing. +- [Zsh Docker Aliases](https://github.com/akarzim/zsh-docker-aliases) for streamlined container management. + +## Modules Installed +zsh, sudo, vim, tar, iputils, git, tig + +## How to Use ZSHmazon + +### Run the ZSHmazon Docker Sandbox: +- To run the Docker image with the previously created volume mounted to `/home/sandbox` for the user `sandbox`, use the following command: +```shell +docker run --name sandbox -v zshmazon-sandbox:/home/sandbox --rm -it macabrequinox/zshmazon +``` +- Along with running the container, this command creates a docker volume named `zshmazon-sandbox`. +- This command starts the ZSHmazon Docker container, providing you with a secure and permission-free environment to run commands and experiment. +- Once you exit, it automatically deletes the container instance. + +Now you're ready to enjoy your ZSHmazon Docker Sandbox, where you can safely execute commands without worrying about permissions or security issues. +Feel free to customize your environment and configurations within the sandbox, and any changes on home directory will be stored in the `zshmazon-sandbox` volume for future use. + +### To Have a Fresh Start Again: +- reset all settings just delete the `ZSHmazon-sandbox` volume by running the following command: +```shell +docker volume rm zshmazon-sandbox +``` +- This volume was storing your configuration and setups of docker image's home directory. + +## Contribute +On [GitHub](https://github.com/snigdhasjg/docker-images/tree/main/zshmazon) by editing the [Dockerfile](https://github.com/snigdhasjg/docker-images/tree/main/zshmazon/Dockerfile) + +--- +Tags: #AmazonLinux #Zsh #OhMyZsh #Powerlevel10k #SyntaxHighlighting #AutoSuggestions #DockerImage #CommandLine #DeveloperTools #Productivity \ No newline at end of file diff --git a/zshmazon/docs/terminal.png b/zshmazon/docs/terminal.png new file mode 100644 index 0000000..c9ba03e Binary files /dev/null and b/zshmazon/docs/terminal.png differ