diff --git a/.github/workflows/502-docker-build-push-coder-minimal.yml b/.github/workflows/502-docker-build-push-coder-minimal.yml new file mode 100644 index 0000000..0e99ea7 --- /dev/null +++ b/.github/workflows/502-docker-build-push-coder-minimal.yml @@ -0,0 +1,42 @@ +name: build-push-coder-minimal + +on: + workflow_dispatch: + pull_request: + paths: + - "docker/coder/minimal.Dockerfile" + +jobs: + build-and-push: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: tuana9a + password: ${{ secrets.DOCKER_HUB_PASSWORD }} + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: docker/coder + file: docker/coder/minimal.Dockerfile + push: true + tags: tuana9a/coder:minimal + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: Send Telegram message + env: + TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} + TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} + run: | + MESSAGE="OK build tuana9a/coder:minimal" + curl -s -X POST https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage -d chat_id=${TELEGRAM_CHAT_ID} -d text="${MESSAGE}" diff --git a/docker/coder/base.Dockerfile b/docker/coder/base.Dockerfile index 282d999..44419d9 100644 --- a/docker/coder/base.Dockerfile +++ b/docker/coder/base.Dockerfile @@ -1,4 +1,4 @@ -FROM codercom/enterprise-base:ubuntu +FROM codercom/enterprise-base:ubuntu-20240909 USER coder diff --git a/docker/coder/minimal.Dockerfile b/docker/coder/minimal.Dockerfile new file mode 100644 index 0000000..b80717e --- /dev/null +++ b/docker/coder/minimal.Dockerfile @@ -0,0 +1,5 @@ +FROM codercom/enterprise-minimal:ubuntu-20240909 + +USER coder + +RUN sudo apt update -y && sudo apt install -y tmux direnv jq dnsutils net-tools iputils-ping telnet zsh && sudo usermod -s /bin/zsh coder