├── .github └── workflows │ ├── alpine.yml │ ├── arch.yml │ ├── cron.yml │ ├── debian.yml │ ├── euler.yml │ ├── fedora.yml │ ├── go.yml │ ├── kali.yml │ ├── manjaro.yml │ ├── node.yml │ ├── push.yml │ ├── rebuild.yml │ ├── rust.yml │ ├── test.yml │ ├── ubuntu-dev.yml │ └── ubuntu.yml ├── .gitignore ├── License └── docker ├── action ├── build_zstd_image ├── compress_file ├── docker_build ├── docker_export ├── docker_run ├── gen_docker_readme ├── get_container_os └── write_to_toml ├── alpine ├── gui.dockerfile └── zsh.dockerfile ├── amazon └── base.dockerfile ├── arch ├── base.dockerfile ├── base02.dockerfile ├── gui.dockerfile └── zsh.dockerfile ├── assets ├── arch_key ├── clean_deb_cache ├── code.js ├── code │ └── init │ │ ├── 0.set │ │ ├── 1.build │ │ ├── 2.run │ │ └── init.dockerfile ├── configure_zsh ├── electron │ └── install_apps ├── gen_tool ├── get_arch ├── go.go ├── install_alpine_deps ├── install_cutefish ├── install_deb_deps ├── nginx.txt ├── node.js ├── rust.md ├── set_container_txt ├── set_locale ├── swift │ └── download_swift └── ubuntu │ └── devel ├── cblmariner └── base.dockerfile ├── code └── latest.dockerfile ├── debian ├── gui.dockerfile └── zsh.dockerfile ├── dotnet └── latest.dockerfile ├── euler ├── base.dockerfile └── dde.dockerfile ├── fedora ├── gui.dockerfile └── zsh.dockerfile ├── go ├── alpine.dockerfile └── latest.dockerfile ├── jdk └── latest.dockerfile ├── kali ├── gui.dockerfile └── zsh.dockerfile ├── manjaro ├── gui.dockerfile └── zsh.dockerfile ├── mongo └── latest.dockerfile ├── nginx ├── alpine.dockerfile └── latest.dockerfile ├── node ├── alpine.dockerfile └── latest.dockerfile ├── oracle └── base.dockerfile ├── php ├── alpine.dockerfile └── latest.dockerfile ├── ruby ├── alpine.dockerfile └── latest.dockerfile ├── rust ├── alpine.dockerfile └── latest.dockerfile ├── scratch └── zstd.dockerfile ├── swift └── latest.dockerfile ├── test └── hello.dockerfile ├── tmp.dockerfile └── ubuntu ├── cutefish.dockerfile ├── dde.dockerfile ├── gui.dockerfile ├── kinetic.dockerfile └── zsh.dockerfile /.github/workflows/cron.yml: -------------------------------------------------------------------------------- 1 | name: test cron 2 | # on: 3 | # schedule: 4 | # - cron: "*/5 * * * *" 5 | # watch: 6 | # types: started 7 | on: pull_request 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-20.04 12 | steps: 13 | # - uses: actions/checkout@v2 14 | - name: hello 15 | timeout-minutes: 3 16 | run: | 17 | echo hello world 18 | -------------------------------------------------------------------------------- /.github/workflows/euler.yml: -------------------------------------------------------------------------------- 1 | name: build euler images 2 | # begin_time = 2024-02-15 00:03:01+00:00 3 | 4 | on: 5 | push: 6 | branches: [master] 7 | paths: 8 | - ".github/workflows/euler.yml" 9 | 10 | jobs: 11 | job1: 12 | # needs: [job1] 13 | runs-on: ${{ matrix.os }} 14 | env: 15 | name: ${{ matrix.name }} 16 | user: cake233 17 | # tag: base 18 | platform: ${{ matrix.platform }} 19 | arch: ${{ matrix.arch }} 20 | zstd_level: 19 21 | 22 | strategy: 23 | # fail-fast: false 24 | matrix: 25 | include: 26 | - os: ubuntu-latest 27 | name: euler 28 | arch: amd64 29 | tag: base 30 | platform: "linux/amd64" 31 | - os: ubuntu-latest 32 | name: euler 33 | arch: arm64 34 | tag: base 35 | platform: "linux/arm64" 36 | 37 | - os: ubuntu-latest 38 | name: amazon 39 | arch: amd64 40 | tag: base 41 | platform: "linux/amd64" 42 | - os: ubuntu-latest 43 | name: amazon 44 | arch: arm64 45 | tag: base 46 | platform: "linux/arm64" 47 | 48 | - os: ubuntu-latest 49 | name: oracle 50 | arch: amd64 51 | tag: base 52 | platform: "linux/amd64" 53 | - os: ubuntu-latest 54 | name: oracle 55 | arch: arm64 56 | tag: base 57 | platform: "linux/arm64" 58 | # cblmariner 59 | - os: ubuntu-latest 60 | name: cblmariner 61 | arch: amd64 62 | tag: base 63 | platform: "linux/amd64" 64 | - os: ubuntu-latest 65 | name: cblmariner 66 | arch: arm64 67 | tag: base 68 | platform: "linux/arm64" 69 | # repeat... 70 | steps: 71 | - name: set time env 72 | run: | 73 | printf "%s\n" \ 74 | "time_begin=$(date -u --rfc-3339=ns)" \ 75 | "time_today=$(date -u --rfc-3339=date)" \ 76 | >> "$GITHUB_ENV" 77 | 78 | - uses: actions/checkout@v2 79 | with: 80 | # repository: "2moe/xxx" 81 | ref: "master" 82 | fetch-depth: 1 83 | 84 | - name: get architecture 85 | env: 86 | TARGETARCH: ${{ matrix.arch }} 87 | run: bash docker/assets/get_arch 88 | 89 | - name: get container os & set global env 90 | env: 91 | tag: ${{ matrix.tag }} 92 | run: bash docker/action/get_container_os 93 | 94 | - name: set up qemu-user & binfmt 95 | id: qemu 96 | uses: docker/setup-qemu-action@v1 97 | if: matrix.arch != 'amd64' && matrix.arch != 'i386' 98 | with: 99 | image: tonistiigi/binfmt:latest 100 | platforms: ${{ matrix.platform }} 101 | 102 | - name: set container name(notag latest/base) 103 | if: matrix.tag == 'base' || matrix.tag == 'latest' 104 | env: 105 | container: ${{ env.name }}-${{ matrix.arch }} 106 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 107 | 108 | - name: set container name(notag latest/base) 109 | if: matrix.tag == 'base' || matrix.tag == 'latest' 110 | env: 111 | container: ${{ env.name }}-${{ matrix.arch }} 112 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 113 | 114 | - name: set container name(normal) 115 | if: matrix.tag != 'base' && matrix.tag != 'latest' 116 | env: 117 | container: ${{ env.name }}-${{ matrix.tag }}-${{ matrix.arch }} 118 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 119 | 120 | - name: set repo (global env) 121 | env: 122 | repo: ${{ env.user }}/${{ env.Container_name }} 123 | m_arch: ${{ matrix.arch }} 124 | run: | 125 | printf "%s\n" \ 126 | "repo=$repo" \ 127 | "zsh_repo=${user}/${name}-zsh-${m_arch}" \ 128 | >> "$GITHUB_ENV" 129 | 130 | - name: build container 131 | env: 132 | file: "../${{ env.name }}/${{ matrix.tag }}.dockerfile" 133 | tag: ${{ matrix.tag }} 134 | run: bash docker/action/docker_build 135 | 136 | - name: Log in to Docker Hub 137 | uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 138 | with: 139 | username: ${{ env.user }} 140 | password: ${{ secrets.DOCKER_TOKEN }} 141 | - name: docker push 142 | run: | 143 | docker push -a "${repo}" 144 | 145 | - name: docker run (zsh) 146 | if: matrix.tag == 'zsh' 147 | timeout-minutes: 1 148 | continue-on-error: true 149 | run: bash docker/action/docker_run docker zsh 150 | 151 | - name: docker run 152 | if: matrix.tag != 'zsh' 153 | timeout-minutes: 1 154 | run: bash docker/action/docker_run 155 | 156 | - name: docker export 157 | run: bash docker/action/docker_export 158 | 159 | - name: start zstd 160 | # if: matrix.tag != 'base' 161 | run: bash docker/action/compress_file $zstd_level 162 | 163 | - name: docker build zstd image 164 | # if: matrix.tag != 'base' 165 | run: bash docker/action/build_zstd_image 166 | 167 | - name: set end time 168 | run: | 169 | printf "%s\n" \ 170 | "end_time_normal=$(date -u +%Y-%m-%d_%H-%M)" \ 171 | "end_time=$(date -u --rfc-3339=ns)" \ 172 | >>"$GITHUB_ENV" 173 | 174 | - name: write to toml file 175 | env: 176 | tag: ${{ matrix.tag }} 177 | platform: ${{ matrix.platform }} 178 | run: | 179 | bash docker/action/write_to_toml 180 | 181 | - name: cat i.toml 182 | run: cat i.toml 183 | 184 | - name: gen docker readme 185 | env: 186 | dir: docker/assets 187 | run: | 188 | bash docker/action/gen_docker_readme 189 | cat docker-readme.md 190 | 191 | # - name: push README to Dockerhub 192 | # uses: christian-korneck/update-container-description-action@v1 193 | # env: 194 | # DOCKER_USER: ${{ env.user }} 195 | # DOCKER_PASS: ${{ secrets.DOCKER_TOKEN }} 196 | # with: 197 | # destination_container_repo: ${{ env.repo }} 198 | # provider: dockerhub 199 | # # short_description: "Quickly install ${{ env.Container_name }}" 200 | # readme_file: "docker-readme.md" 201 | 202 | - name: copy docker readme.md to home dir 203 | run: | 204 | cp docker-readme.md ~/${Container_name}.md 205 | cp i.toml ~/${Container_name}.toml 206 | 207 | - name: repo(index) 208 | uses: actions/checkout@v2 209 | with: 210 | repository: "2cd/index" 211 | ref: "master" 212 | persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. 213 | fetch-depth: 1 # otherwise, there would be errors pushing refs to the destination repository. 214 | - name: create local changes 215 | run: | 216 | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" 217 | git config --local user.name "github-actions[bot]" 218 | git reset --hard origin/master 219 | git pull --rebase --stat origin master --allow-unrelated-histories 220 | mkdir -p doc/${name} 221 | cp ~/${Container_name}.md ~/${Container_name}.toml doc/${name} 222 | 223 | - name: commit files 224 | run: | 225 | git add . 226 | git commit -m "docs(docker): ${Container_name}.md" -a 227 | - name: push changes 228 | uses: ad-m/github-push-action@master 229 | with: 230 | repository: "2cd/index" 231 | github_token: ${{ secrets.GH_TOKEN }} 232 | branch: "master" 233 | #------------------------------------------------ 234 | job2: 235 | needs: [job1] 236 | runs-on: ${{ matrix.os }} 237 | env: 238 | name: euler 239 | user: cake233 240 | platform: ${{ matrix.platform }} 241 | arch: ${{ matrix.arch }} 242 | zstd_level: 18 243 | 244 | strategy: 245 | # fail-fast: false 246 | matrix: 247 | include: 248 | - os: ubuntu-latest 249 | tag: dde 250 | arch: amd64 251 | platform: "linux/amd64" 252 | 253 | - os: ubuntu-latest 254 | tag: dde 255 | arch: arm64 256 | platform: "linux/arm64" 257 | 258 | # repeat... 259 | steps: 260 | - name: set time env 261 | run: | 262 | printf "%s\n" \ 263 | "time_begin=$(date -u --rfc-3339=ns)" \ 264 | "time_today=$(date -u --rfc-3339=date)" \ 265 | >> "$GITHUB_ENV" 266 | 267 | - uses: actions/checkout@v2 268 | with: 269 | # repository: "2moe/xxx" 270 | ref: "master" 271 | fetch-depth: 1 272 | 273 | - name: get architecture 274 | env: 275 | TARGETARCH: ${{ matrix.arch }} 276 | run: bash docker/assets/get_arch 277 | 278 | - name: get container os & set global env 279 | env: 280 | tag: ${{ matrix.tag }} 281 | run: bash docker/action/get_container_os 282 | 283 | - name: set up qemu-user & binfmt 284 | id: qemu 285 | uses: docker/setup-qemu-action@v1 286 | if: matrix.arch != 'amd64' && matrix.arch != 'i386' 287 | with: 288 | image: tonistiigi/binfmt:latest 289 | platforms: ${{ matrix.platform }} 290 | 291 | - name: set container name(notag latest/base) 292 | if: matrix.tag == 'base' || matrix.tag == 'latest' 293 | env: 294 | container: ${{ env.name }}-${{ matrix.arch }} 295 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 296 | 297 | - name: set container name(notag latest/base) 298 | if: matrix.tag == 'base' || matrix.tag == 'latest' 299 | env: 300 | container: ${{ env.name }}-${{ matrix.arch }} 301 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 302 | 303 | - name: set container name(normal) 304 | if: matrix.tag != 'base' && matrix.tag != 'latest' 305 | env: 306 | container: ${{ env.name }}-${{ matrix.tag }}-${{ matrix.arch }} 307 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 308 | 309 | - name: set repo (global env) 310 | env: 311 | repo: ${{ env.user }}/${{ env.Container_name }} 312 | m_arch: ${{ matrix.arch }} 313 | run: | 314 | printf "%s\n" \ 315 | "repo=$repo" \ 316 | "zsh_repo=${user}/${name}-zsh-${m_arch}" \ 317 | >> "$GITHUB_ENV" 318 | 319 | - name: build container 320 | env: 321 | file: "../${{ env.name }}/${{ matrix.tag }}.dockerfile" 322 | tag: ${{ matrix.tag }} 323 | run: bash docker/action/docker_build 324 | 325 | - name: Log in to Docker Hub 326 | uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 327 | with: 328 | username: ${{ env.user }} 329 | password: ${{ secrets.DOCKER_TOKEN }} 330 | - name: docker push 331 | run: | 332 | docker push -a "${repo}" 333 | 334 | - name: docker run (zsh) 335 | if: matrix.tag == 'zsh' 336 | timeout-minutes: 1 337 | continue-on-error: true 338 | run: bash docker/action/docker_run docker zsh 339 | 340 | - name: docker run 341 | if: matrix.tag != 'zsh' 342 | timeout-minutes: 1 343 | run: bash docker/action/docker_run 344 | 345 | - name: docker export 346 | run: bash docker/action/docker_export 347 | 348 | - name: start zstd 349 | # if: matrix.tag != 'base' 350 | run: bash docker/action/compress_file $zstd_level 351 | 352 | - name: docker build zstd image 353 | # if: matrix.tag != 'base' 354 | run: bash docker/action/build_zstd_image 355 | 356 | - name: set end time 357 | run: | 358 | printf "%s\n" \ 359 | "end_time_normal=$(date -u +%Y-%m-%d_%H-%M)" \ 360 | "end_time=$(date -u --rfc-3339=ns)" \ 361 | >>"$GITHUB_ENV" 362 | 363 | - name: write to toml file 364 | env: 365 | tag: ${{ matrix.tag }} 366 | platform: ${{ matrix.platform }} 367 | run: | 368 | bash docker/action/write_to_toml 369 | 370 | - name: cat i.toml 371 | run: cat i.toml 372 | 373 | - name: gen docker readme 374 | env: 375 | dir: docker/assets 376 | run: | 377 | bash docker/action/gen_docker_readme 378 | cat docker-readme.md 379 | 380 | - name: copy docker readme.md to home dir 381 | run: | 382 | cp docker-readme.md ~/${Container_name}.md 383 | cp i.toml ~/${Container_name}.toml 384 | 385 | - name: repo(index) 386 | uses: actions/checkout@v2 387 | with: 388 | repository: "2cd/index" 389 | ref: "master" 390 | persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. 391 | fetch-depth: 1 # otherwise, there would be errors pushing refs to the destination repository. 392 | - name: create local changes 393 | run: | 394 | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" 395 | git config --local user.name "github-actions[bot]" 396 | git reset --hard origin/master 397 | git pull --rebase --stat origin master --allow-unrelated-histories 398 | mkdir -p doc/${name} 399 | cp ~/${Container_name}.md ~/${Container_name}.toml doc/${name} 400 | 401 | - name: commit files 402 | run: | 403 | git add . 404 | git commit -m "docs(docker): ${Container_name}.md" -a 405 | - name: push changes 406 | uses: ad-m/github-push-action@master 407 | with: 408 | repository: "2cd/index" 409 | github_token: ${{ secrets.GH_TOKEN }} 410 | branch: "master" 411 | # job3: 412 | # needs: [job1, job2] 413 | # runs-on: ubuntu-latest 414 | # env: 415 | # user: cake233 416 | 417 | # steps: 418 | # - name: fedora manifest 419 | # env: 420 | # name: fedora 421 | # run: | 422 | # # name=fedora 423 | # echo ${{ secrets.DOCKER_TOKEN }} | docker login -u ${{ env.user }} --password-stdin 424 | # for i in kde xfce mate lxqt zsh;do 425 | # docker manifest create --amend ${{ env.user }}/${i}:${{ env.name }} \ 426 | # ${{ env.user }}/${{ env.name }}-${i}-amd64 \ 427 | # ${{ env.user }}/${{ env.name }}-${i}-arm64 428 | # docker manifest push ${{ env.user }}/${i}:${{ env.name }} 429 | # done 430 | -------------------------------------------------------------------------------- /.github/workflows/go.yml: -------------------------------------------------------------------------------- 1 | name: build go, nginx, code, jdk & mongo 2 | # begin_time = 2024-02-26 12:02:02+00:00 3 | 4 | on: 5 | push: 6 | branches: [master] 7 | paths: 8 | - ".github/workflows/go.yml" 9 | 10 | jobs: 11 | job1: 12 | # needs: [job0, job1] 13 | runs-on: ${{ matrix.os }} 14 | env: 15 | name: ${{ matrix.name }} 16 | user: cake233 17 | platform: ${{ matrix.platform }} 18 | arch: ${{ matrix.arch }} 19 | zstd_level: 22 20 | 21 | strategy: 22 | fail-fast: false 23 | matrix: 24 | include: 25 | - os: ubuntu-latest 26 | name: code 27 | tag: latest 28 | arch: amd64 29 | platform: "linux/amd64" 30 | - os: ubuntu-latest 31 | name: code 32 | tag: latest 33 | arch: arm64 34 | platform: "linux/arm64" 35 | - os: ubuntu-latest 36 | name: code 37 | tag: latest 38 | arch: armv7 39 | platform: "linux/arm/v7" 40 | 41 | - os: ubuntu-latest 42 | name: go 43 | tag: latest 44 | arch: amd64 45 | platform: "linux/amd64" 46 | - os: ubuntu-latest 47 | name: go 48 | tag: latest 49 | arch: arm64 50 | platform: "linux/arm64" 51 | 52 | - os: ubuntu-latest 53 | name: go 54 | tag: alpine 55 | arch: amd64 56 | platform: "linux/amd64" 57 | - os: ubuntu-latest 58 | name: go 59 | tag: alpine 60 | arch: arm64 61 | platform: "linux/arm64" 62 | - os: ubuntu-latest 63 | name: go 64 | tag: alpine 65 | arch: armv7 66 | platform: "linux/arm/v7" 67 | 68 | - os: ubuntu-latest 69 | name: jdk 70 | tag: latest 71 | arch: amd64 72 | platform: "linux/amd64" 73 | - os: ubuntu-latest 74 | name: jdk 75 | tag: latest 76 | arch: arm64 77 | platform: "linux/arm64" 78 | # - os: ubuntu-latest 79 | # name: jdk 80 | # tag: latest 81 | # arch: armv7 82 | # platform: "linux/arm/v7" 83 | 84 | # - os: ubuntu-latest 85 | # name: mongo 86 | # tag: latest 87 | # arch: amd64 88 | # platform: "linux/amd64" 89 | # - os: ubuntu-latest 90 | # name: mongo 91 | # tag: latest 92 | # arch: arm64 93 | # platform: "linux/arm64" 94 | 95 | - os: ubuntu-latest 96 | name: nginx 97 | tag: latest 98 | arch: amd64 99 | platform: "linux/amd64" 100 | - os: ubuntu-latest 101 | name: nginx 102 | tag: latest 103 | arch: arm64 104 | platform: "linux/arm64" 105 | 106 | - os: ubuntu-latest 107 | name: nginx 108 | tag: alpine 109 | arch: amd64 110 | platform: "linux/amd64" 111 | - os: ubuntu-latest 112 | name: nginx 113 | tag: alpine 114 | arch: arm64 115 | platform: "linux/arm64" 116 | - os: ubuntu-latest 117 | name: nginx 118 | tag: alpine 119 | arch: armv7 120 | platform: "linux/arm/v7" 121 | 122 | # - os: ubuntu-latest 123 | # tag: latest 124 | # arch: mips32le 125 | # platform: "linux/mips32le" 126 | 127 | # - os: self-hosted-debian 128 | # tag: hello 129 | # arch: amd64 130 | # platform: "linux/amd64" 131 | 132 | # repeat... 133 | steps: 134 | - name: set time env 135 | run: | 136 | printf "%s\n" \ 137 | "time_begin=$(date -u --rfc-3339=ns)" \ 138 | "time_today=$(date -u --rfc-3339=date)" \ 139 | >> "$GITHUB_ENV" 140 | 141 | - uses: actions/checkout@v2 142 | with: 143 | # repository: "2moe/xxx" 144 | ref: "master" 145 | fetch-depth: 1 146 | 147 | - name: get architecture 148 | env: 149 | TARGETARCH: ${{ matrix.arch }} 150 | run: bash docker/assets/get_arch 151 | 152 | - name: get container os & set global env 153 | env: 154 | tag: ${{ matrix.tag }} 155 | run: bash docker/action/get_container_os 156 | 157 | - name: set up qemu-user & binfmt 158 | id: qemu 159 | uses: docker/setup-qemu-action@v1 160 | if: matrix.arch != 'amd64' && matrix.arch != 'i386' 161 | with: 162 | image: tonistiigi/binfmt:latest 163 | platforms: ${{ matrix.platform }} 164 | 165 | - name: set container name(notag latest/base) 166 | if: matrix.tag == 'base' || matrix.tag == 'latest' 167 | env: 168 | container: ${{ env.name }}-${{ matrix.arch }} 169 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 170 | 171 | - name: set container name(normal) 172 | if: matrix.tag != 'base' && matrix.tag != 'latest' 173 | env: 174 | container: ${{ env.name }}-${{ matrix.tag }}-${{ matrix.arch }} 175 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 176 | 177 | - name: set repo (global env) 178 | env: 179 | repo: ${{ env.user }}/${{ env.Container_name }} 180 | m_arch: ${{ matrix.arch }} 181 | run: | 182 | printf "%s\n" \ 183 | "repo=$repo" \ 184 | "zsh_repo=${user}/${name}-zsh-${m_arch}" \ 185 | >> "$GITHUB_ENV" 186 | 187 | - name: go.dockerfile -> beta 188 | if: matrix.name == 'go' 189 | env: 190 | file: "docker/${{ env.name }}/${{ matrix.tag }}.dockerfile" 191 | run: | 192 | TODAY="$(date -u +%Y%m%d)" 193 | if ((TODAY<=20220630));then 194 | sed -E \ 195 | -e "s@( golang):(alpine)@\1:1.18-\2@" \ 196 | -e "s@( golang):latest@\1:1.18-bullseye@" \ 197 | -i ${{ env.file }} 198 | # rc-bullseye, rc-alpine 199 | fi 200 | 201 | - name: jdk.dockerfile -> ea 202 | if: matrix.name == 'jdk' 203 | env: 204 | file: "docker/${{ env.name }}/${{ matrix.tag }}.dockerfile" 205 | run: | 206 | TODAY="$(date -u +%Y%m%d)" 207 | if ((TODAY<=20230922));then 208 | VERSION=20 209 | elif ((TODAY<=20240922));then 210 | VERSION=21 211 | fi 212 | 213 | sed -E \ 214 | -e "s@( openjdk):jdk-(slim)@\1:${VERSION}-\2@" \ 215 | -i ${{ env.file }} 216 | 217 | - name: build container 218 | env: 219 | file: "../${{ env.name }}/${{ matrix.tag }}.dockerfile" 220 | tag: ${{ matrix.tag }} 221 | run: bash docker/action/docker_build 222 | 223 | - name: build base 224 | if: matrix.tag == 'base' 225 | env: 226 | file: "../${{ env.name }}/${{ matrix.tag }}02.dockerfile" 227 | run: | 228 | docker run -d --name base_tmp ${{ env.repo }}:latest sh 229 | docker cp base_tmp:/arch.tar.xz . 230 | xz -dfv arch.tar.xz 231 | mv arch.tar docker/assets 232 | docker stop base_tmp 233 | docker rm -f base_tmp 234 | docker rmi -f ${repo} 235 | bash docker/action/docker_build 236 | rm -fv docker/assets/arch.tar 237 | 238 | - name: Log in to Docker Hub 239 | uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 240 | with: 241 | username: ${{ env.user }} 242 | password: ${{ secrets.DOCKER_TOKEN }} 243 | - name: docker push 244 | run: | 245 | docker push -a "${repo}" 246 | 247 | - name: docker run (zsh) 248 | if: matrix.tag == 'zsh' 249 | timeout-minutes: 1 250 | continue-on-error: true 251 | run: bash docker/action/docker_run docker zsh 252 | 253 | - name: docker run 254 | if: matrix.tag != 'zsh' 255 | timeout-minutes: 1 256 | run: bash docker/action/docker_run 257 | 258 | - name: docker export 259 | run: bash docker/action/docker_export 260 | 261 | - name: start zstd 262 | # if: matrix.tag != 'base' 263 | run: bash docker/action/compress_file $zstd_level 264 | 265 | - name: docker build zstd image 266 | # if: matrix.tag != 'base' 267 | run: bash docker/action/build_zstd_image 268 | 269 | - name: set end time 270 | run: | 271 | printf "%s\n" \ 272 | "end_time_normal=$(date -u +%Y-%m-%d_%H-%M)" \ 273 | "end_time=$(date -u --rfc-3339=ns)" \ 274 | >>"$GITHUB_ENV" 275 | 276 | - name: write to toml file 277 | env: 278 | tag: ${{ matrix.tag }} 279 | platform: ${{ matrix.platform }} 280 | run: | 281 | bash docker/action/write_to_toml 282 | 283 | - name: cat i.toml 284 | run: cat i.toml 285 | 286 | - name: gen docker readme 287 | env: 288 | dir: docker/assets 289 | run: | 290 | bash docker/action/gen_docker_readme 291 | cat docker-readme.md 292 | 293 | - name: push README to Dockerhub 294 | uses: christian-korneck/update-container-description-action@v1 295 | env: 296 | DOCKER_USER: ${{ env.user }} 297 | DOCKER_PASS: ${{ secrets.DOCKER_TOKEN }} 298 | with: 299 | destination_container_repo: ${{ env.repo }} 300 | provider: dockerhub 301 | # short_description: "Quickly install ${{ env.Container_name }}" 302 | readme_file: "docker-readme.md" 303 | 304 | - name: copy docker readme.md to home dir 305 | run: | 306 | cp docker-readme.md ~/${Container_name}.md 307 | cp i.toml ~/${Container_name}.toml 308 | 309 | - name: repo(index) 310 | uses: actions/checkout@v2 311 | with: 312 | repository: "2cd/index" 313 | ref: "master" 314 | persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. 315 | fetch-depth: 1 # otherwise, there would be errors pushing refs to the destination repository. 316 | - name: create local changes 317 | run: | 318 | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" 319 | git config --local user.name "github-actions[bot]" 320 | git reset --hard origin/master 321 | git pull --rebase --stat origin master --allow-unrelated-histories 322 | mkdir -p doc/${name} 323 | cp ~/${Container_name}.md ~/${Container_name}.toml doc/${name} 324 | 325 | - name: commit files 326 | run: | 327 | git add . 328 | git commit -m "docs(docker): ${Container_name}.md" -a 329 | - name: push changes 330 | uses: ad-m/github-push-action@master 331 | with: 332 | repository: "2cd/index" 333 | github_token: ${{ secrets.GH_TOKEN }} 334 | branch: "master" 335 | #--------------------------- 336 | manifest: 337 | needs: [job1] 338 | runs-on: ubuntu-latest 339 | env: 340 | user: cake233 341 | 342 | steps: 343 | - name: code manifest 344 | env: 345 | name: code 346 | run: | 347 | TODAY=$(date -u +%Y-%m-%d) 348 | echo ${{ secrets.DOCKER_TOKEN }} | docker login -u ${{ env.user }} --password-stdin 349 | for i in latest debian ${TODAY};do 350 | docker manifest create --amend ${{ env.user }}/${{ env.name }}:${i} \ 351 | ${{ env.user }}/${{ env.name }}-amd64 \ 352 | ${{ env.user }}/${{ env.name }}-arm64 \ 353 | ${{ env.user }}/${{ env.name }}-armv7 354 | docker manifest push ${{ env.user }}/${{ env.name }}:${i} 355 | done 356 | -------------------------------------------------------------------------------- /.github/workflows/kali.yml: -------------------------------------------------------------------------------- 1 | name: build kali images 2 | # begin_time = 2024-02-29 12:02:01+00:00 3 | 4 | on: 5 | push: 6 | branches: [master] 7 | paths: 8 | - ".github/workflows/kali.yml" 9 | 10 | jobs: 11 | job1: 12 | continue-on-error: true 13 | # needs: [job0, job1] 14 | runs-on: ${{ matrix.os }} 15 | env: 16 | name: kali 17 | user: cake233 18 | platform: ${{ matrix.platform }} 19 | arch: ${{ matrix.arch }} 20 | zstd_level: 20 21 | 22 | strategy: 23 | fail-fast: false 24 | matrix: 25 | include: 26 | - os: ubuntu-latest 27 | tag: zsh 28 | arch: amd64 29 | platform: "linux/amd64" 30 | 31 | - os: ubuntu-latest 32 | tag: zsh 33 | arch: arm64 34 | platform: "linux/arm64" 35 | 36 | - os: ubuntu-latest 37 | tag: zsh 38 | arch: armv7 39 | platform: "linux/arm/v7" 40 | 41 | # - os: ubuntu-latest 42 | # tag: latest 43 | # arch: armv6 44 | # platform: "linux/arm/v6" 45 | 46 | # - os: ubuntu-latest 47 | # tag: latest 48 | # arch: 386 49 | # platform: "linux/386" 50 | 51 | # - os: ubuntu-latest 52 | # tag: latest 53 | # arch: riscv64 54 | # platform: "linux/riscv64" 55 | 56 | # - os: ubuntu-latest 57 | # tag: latest 58 | # arch: ppc64le 59 | # platform: "linux/ppc64le" 60 | 61 | # - os: ubuntu-latest 62 | # tag: latest 63 | # arch: s390x 64 | # platform: "linux/s390x" 65 | 66 | # - os: ubuntu-latest 67 | # tag: latest 68 | # arch: mips64le 69 | # platform: "linux/mips64le" 70 | 71 | # - os: ubuntu-latest 72 | # tag: latest 73 | # arch: mips32le 74 | # platform: "linux/mips32le" 75 | 76 | # - os: self-hosted-debian 77 | # tag: hello 78 | # arch: amd64 79 | # platform: "linux/amd64" 80 | 81 | # repeat... 82 | steps: 83 | - name: set time env 84 | run: | 85 | printf "%s\n" \ 86 | "time_begin=$(date -u --rfc-3339=ns)" \ 87 | "time_today=$(date -u --rfc-3339=date)" \ 88 | >> "$GITHUB_ENV" 89 | 90 | - uses: actions/checkout@v2 91 | with: 92 | # repository: "2moe/xxx" 93 | ref: "master" 94 | fetch-depth: 1 95 | 96 | - name: get architecture 97 | env: 98 | TARGETARCH: ${{ matrix.arch }} 99 | run: bash docker/assets/get_arch 100 | 101 | - name: get container os & set global env 102 | env: 103 | tag: ${{ matrix.tag }} 104 | run: bash docker/action/get_container_os 105 | 106 | - name: set up qemu-user & binfmt 107 | id: qemu 108 | uses: docker/setup-qemu-action@v1 109 | if: matrix.arch != 'amd64' && matrix.arch != 'i386' 110 | with: 111 | image: tonistiigi/binfmt:latest 112 | platforms: ${{ matrix.platform }} 113 | 114 | - name: set container name(notag latest/base) 115 | if: matrix.tag == 'base' || matrix.tag == 'latest' 116 | env: 117 | container: ${{ env.name }}-${{ matrix.arch }} 118 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 119 | 120 | - name: set container name(normal) 121 | if: matrix.tag != 'base' && matrix.tag != 'latest' 122 | env: 123 | container: ${{ env.name }}-${{ matrix.tag }}-${{ matrix.arch }} 124 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 125 | 126 | - name: set repo (global env) 127 | env: 128 | repo: ${{ env.user }}/${{ env.Container_name }} 129 | m_arch: ${{ matrix.arch }} 130 | run: | 131 | printf "%s\n" \ 132 | "repo=$repo" \ 133 | "zsh_repo=${user}/${name}-zsh-${m_arch}" \ 134 | >> "$GITHUB_ENV" 135 | 136 | - name: build container 137 | env: 138 | file: "../${{ env.name }}/${{ matrix.tag }}.dockerfile" 139 | tag: ${{ matrix.tag }} 140 | run: bash docker/action/docker_build 141 | 142 | - name: build base 143 | if: matrix.tag == 'base' 144 | env: 145 | file: "../${{ env.name }}/${{ matrix.tag }}02.dockerfile" 146 | run: | 147 | docker run -d --name base_tmp ${{ env.repo }}:latest sh 148 | docker cp base_tmp:/arch.tar.xz . 149 | xz -dfv arch.tar.xz 150 | mv arch.tar docker/assets 151 | docker stop base_tmp 152 | docker rm -f base_tmp 153 | docker rmi -f ${repo} 154 | bash docker/action/docker_build 155 | rm -fv docker/assets/arch.tar 156 | 157 | - name: Log in to Docker Hub 158 | uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 159 | with: 160 | username: ${{ env.user }} 161 | password: ${{ secrets.DOCKER_TOKEN }} 162 | - name: docker push 163 | run: | 164 | docker push -a "${repo}" 165 | 166 | - name: docker run (zsh) 167 | if: matrix.tag == 'zsh' 168 | timeout-minutes: 1 169 | continue-on-error: true 170 | run: bash docker/action/docker_run docker zsh 171 | 172 | - name: docker run 173 | if: matrix.tag != 'zsh' 174 | timeout-minutes: 1 175 | run: bash docker/action/docker_run 176 | 177 | - name: docker export 178 | run: bash docker/action/docker_export 179 | 180 | - name: start zstd 181 | # if: matrix.tag != 'base' 182 | run: bash docker/action/compress_file $zstd_level 183 | 184 | - name: docker build zstd image 185 | # if: matrix.tag != 'base' 186 | run: bash docker/action/build_zstd_image 187 | 188 | - name: set end time 189 | run: | 190 | printf "%s\n" \ 191 | "end_time_normal=$(date -u +%Y-%m-%d_%H-%M)" \ 192 | "end_time=$(date -u --rfc-3339=ns)" \ 193 | >>"$GITHUB_ENV" 194 | 195 | - name: write to toml file 196 | env: 197 | tag: ${{ matrix.tag }} 198 | platform: ${{ matrix.platform }} 199 | run: | 200 | bash docker/action/write_to_toml 201 | 202 | - name: cat i.toml 203 | run: cat i.toml 204 | 205 | - name: gen docker readme 206 | env: 207 | dir: docker/assets 208 | run: | 209 | bash docker/action/gen_docker_readme 210 | cat docker-readme.md 211 | 212 | - name: push README to Dockerhub 213 | uses: christian-korneck/update-container-description-action@v1 214 | env: 215 | DOCKER_USER: ${{ env.user }} 216 | DOCKER_PASS: ${{ secrets.DOCKER_TOKEN }} 217 | with: 218 | destination_container_repo: ${{ env.repo }} 219 | provider: dockerhub 220 | # short_description: "Quickly install ${{ env.Container_name }}" 221 | readme_file: "docker-readme.md" 222 | 223 | - name: copy docker readme.md to home dir 224 | run: | 225 | cp docker-readme.md ~/${Container_name}.md 226 | cp i.toml ~/${Container_name}.toml 227 | 228 | - name: repo(index) 229 | uses: actions/checkout@v2 230 | with: 231 | repository: "2cd/index" 232 | ref: "master" 233 | persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. 234 | fetch-depth: 1 # otherwise, there would be errors pushing refs to the destination repository. 235 | - name: create local changes 236 | run: | 237 | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" 238 | git config --local user.name "github-actions[bot]" 239 | git reset --hard origin/master 240 | git pull --rebase --stat origin master --allow-unrelated-histories 241 | mkdir -p doc/${name} 242 | cp ~/${Container_name}.md ~/${Container_name}.toml doc/${name} 243 | 244 | - name: commit files 245 | run: | 246 | git add . 247 | git commit -m "docs(docker): ${Container_name}.md" -a 248 | - name: push changes 249 | uses: ad-m/github-push-action@master 250 | with: 251 | repository: "2cd/index" 252 | github_token: ${{ secrets.GH_TOKEN }} 253 | branch: "master" 254 | #------------------------------------------------ 255 | job2: 256 | needs: [job1] 257 | runs-on: ${{ matrix.os }} 258 | env: 259 | name: kali 260 | user: cake233 261 | platform: ${{ matrix.platform }} 262 | arch: ${{ matrix.arch }} 263 | zstd_level: 19 264 | 265 | strategy: 266 | fail-fast: false 267 | matrix: 268 | include: 269 | - os: ubuntu-latest 270 | tag: xfce 271 | arch: amd64 272 | platform: "linux/amd64" 273 | 274 | - os: ubuntu-latest 275 | tag: xfce 276 | arch: arm64 277 | platform: "linux/arm64" 278 | 279 | - os: ubuntu-latest 280 | tag: xfce 281 | arch: armv7 282 | platform: "linux/arm/v7" 283 | 284 | # - os: ubuntu-latest 285 | # tag: latest 286 | # arch: armv6 287 | # platform: "linux/arm/v6" 288 | 289 | # - os: ubuntu-latest 290 | # tag: mate 291 | # arch: 386 292 | # platform: "linux/386" 293 | 294 | # - os: ubuntu-latest 295 | # tag: latest 296 | # arch: riscv64 297 | # platform: "linux/riscv64" 298 | 299 | # - os: ubuntu-latest 300 | # tag: latest 301 | # arch: ppc64le 302 | # platform: "linux/ppc64le" 303 | 304 | # - os: ubuntu-latest 305 | # tag: latest 306 | # arch: s390x 307 | # platform: "linux/s390x" 308 | 309 | # - os: ubuntu-latest 310 | # tag: latest 311 | # arch: mips64le 312 | # platform: "linux/mips64le" 313 | 314 | # - os: ubuntu-latest 315 | # tag: latest 316 | # arch: mips32le 317 | # platform: "linux/mips32le" 318 | 319 | # - os: self-hosted-debian 320 | # tag: hello 321 | # arch: amd64 322 | # platform: "linux/amd64" 323 | 324 | # repeat... 325 | steps: 326 | - name: set time env 327 | run: | 328 | printf "%s\n" \ 329 | "time_begin=$(date -u --rfc-3339=ns)" \ 330 | "time_today=$(date -u --rfc-3339=date)" \ 331 | >> "$GITHUB_ENV" 332 | 333 | - uses: actions/checkout@v2 334 | with: 335 | # repository: "2moe/xxx" 336 | ref: "master" 337 | fetch-depth: 1 338 | 339 | - name: get architecture 340 | env: 341 | TARGETARCH: ${{ matrix.arch }} 342 | run: bash docker/assets/get_arch 343 | 344 | - name: get container os & set global env 345 | env: 346 | tag: ${{ matrix.tag }} 347 | run: bash docker/action/get_container_os 348 | 349 | - name: set up qemu-user & binfmt 350 | id: qemu 351 | uses: docker/setup-qemu-action@v1 352 | if: matrix.arch != 'amd64' && matrix.arch != 'i386' 353 | with: 354 | image: tonistiigi/binfmt:latest 355 | platforms: ${{ matrix.platform }} 356 | 357 | - name: set container name(notag latest/base) 358 | if: matrix.tag == 'base' || matrix.tag == 'latest' 359 | env: 360 | container: ${{ env.name }}-${{ matrix.arch }} 361 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 362 | 363 | - name: set container name(normal) 364 | if: matrix.tag != 'base' && matrix.tag != 'latest' 365 | env: 366 | container: ${{ env.name }}-${{ matrix.tag }}-${{ matrix.arch }} 367 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 368 | 369 | - name: set repo (global env) 370 | env: 371 | repo: ${{ env.user }}/${{ env.Container_name }} 372 | m_arch: ${{ matrix.arch }} 373 | run: | 374 | printf "%s\n" \ 375 | "repo=$repo" \ 376 | "zsh_repo=${user}/${name}-zsh-${m_arch}" \ 377 | >> "$GITHUB_ENV" 378 | 379 | - name: build container 380 | env: 381 | file: "../${{ env.name }}/${{ matrix.tag }}.dockerfile" 382 | tag: ${{ matrix.tag }} 383 | run: bash docker/action/docker_build 384 | 385 | - name: build base 386 | if: matrix.tag == 'base' 387 | env: 388 | file: "../${{ env.name }}/${{ matrix.tag }}02.dockerfile" 389 | run: | 390 | docker run -d --name base_tmp ${{ env.repo }}:latest sh 391 | docker cp base_tmp:/arch.tar.xz . 392 | xz -dfv arch.tar.xz 393 | mv arch.tar docker/assets 394 | docker stop base_tmp 395 | docker rm -f base_tmp 396 | docker rmi -f ${repo} 397 | bash docker/action/docker_build 398 | rm -fv docker/assets/arch.tar 399 | 400 | - name: Log in to Docker Hub 401 | uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 402 | with: 403 | username: ${{ env.user }} 404 | password: ${{ secrets.DOCKER_TOKEN }} 405 | - name: docker push 406 | run: | 407 | docker push -a "${repo}" 408 | 409 | - name: docker run (zsh) 410 | if: matrix.tag == 'zsh' 411 | timeout-minutes: 1 412 | continue-on-error: true 413 | run: bash docker/action/docker_run docker zsh 414 | 415 | - name: docker run 416 | if: matrix.tag != 'zsh' 417 | timeout-minutes: 1 418 | run: bash docker/action/docker_run 419 | 420 | - name: docker export 421 | run: bash docker/action/docker_export 422 | 423 | - name: start zstd 424 | # if: matrix.tag != 'base' 425 | run: bash docker/action/compress_file $zstd_level 426 | 427 | - name: docker build zstd image 428 | # if: matrix.tag != 'base' 429 | run: bash docker/action/build_zstd_image 430 | 431 | - name: set end time 432 | run: | 433 | printf "%s\n" \ 434 | "end_time_normal=$(date -u +%Y-%m-%d_%H-%M)" \ 435 | "end_time=$(date -u --rfc-3339=ns)" \ 436 | >>"$GITHUB_ENV" 437 | 438 | - name: write to toml file 439 | env: 440 | tag: ${{ matrix.tag }} 441 | platform: ${{ matrix.platform }} 442 | run: | 443 | bash docker/action/write_to_toml 444 | 445 | - name: cat i.toml 446 | run: cat i.toml 447 | 448 | - name: gen docker readme 449 | env: 450 | dir: docker/assets 451 | run: | 452 | bash docker/action/gen_docker_readme 453 | cat docker-readme.md 454 | 455 | - name: push README to Dockerhub 456 | uses: christian-korneck/update-container-description-action@v1 457 | env: 458 | DOCKER_USER: ${{ env.user }} 459 | DOCKER_PASS: ${{ secrets.DOCKER_TOKEN }} 460 | with: 461 | destination_container_repo: ${{ env.repo }} 462 | provider: dockerhub 463 | # short_description: "Quickly install ${{ env.Container_name }}" 464 | readme_file: "docker-readme.md" 465 | 466 | - name: copy docker readme.md to home dir 467 | run: | 468 | cp docker-readme.md ~/${Container_name}.md 469 | cp i.toml ~/${Container_name}.toml 470 | 471 | - name: repo(index) 472 | uses: actions/checkout@v2 473 | with: 474 | repository: "2cd/index" 475 | ref: "master" 476 | persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. 477 | fetch-depth: 1 # otherwise, there would be errors pushing refs to the destination repository. 478 | - name: create local changes 479 | run: | 480 | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" 481 | git config --local user.name "github-actions[bot]" 482 | git reset --hard origin/master 483 | git pull --rebase --stat origin master --allow-unrelated-histories 484 | mkdir -p doc/${name} 485 | cp ~/${Container_name}.md ~/${Container_name}.toml doc/${name} 486 | 487 | - name: commit files 488 | run: | 489 | git add . 490 | git commit -m "docs(docker): ${Container_name}.md" -a 491 | - name: push changes 492 | uses: ad-m/github-push-action@master 493 | with: 494 | repository: "2cd/index" 495 | github_token: ${{ secrets.GH_TOKEN }} 496 | branch: "master" 497 | #------------------------------------------------ 498 | job3: 499 | needs: [job1, job2] 500 | runs-on: ubuntu-latest 501 | env: 502 | user: cake233 503 | steps: 504 | - name: kali manifest 505 | env: 506 | name: kali 507 | run: | 508 | # name=kali 509 | echo ${{ secrets.DOCKER_TOKEN }} | docker login -u ${{ env.user }} --password-stdin 510 | for i in xfce zsh;do 511 | docker manifest create --amend ${{ env.user }}/${i}:${{ env.name }} \ 512 | ${{ env.user }}/${{ env.name }}-${i}-amd64 \ 513 | ${{ env.user }}/${{ env.name }}-${i}-arm64 \ 514 | ${{ env.user }}/${{ env.name }}-${i}-armv7 515 | docker manifest push ${{ env.user }}/${i}:${{ env.name }} 516 | done 517 | -------------------------------------------------------------------------------- /.github/workflows/manjaro.yml: -------------------------------------------------------------------------------- 1 | name: build manjaro images 2 | # begin_time = 2024-03-01 12:02:02+00:00 3 | 4 | on: 5 | push: 6 | branches: [master] 7 | paths: 8 | - ".github/workflows/manjaro.yml" 9 | 10 | jobs: 11 | job1: 12 | continue-on-error: true 13 | # needs: [job0, job1] 14 | runs-on: ${{ matrix.os }} 15 | env: 16 | name: manjaro 17 | user: cake233 18 | platform: ${{ matrix.platform }} 19 | arch: ${{ matrix.arch }} 20 | zstd_level: 20 21 | 22 | strategy: 23 | fail-fast: false 24 | matrix: 25 | include: 26 | - os: ubuntu-latest 27 | tag: zsh 28 | arch: amd64 29 | platform: "linux/amd64" 30 | 31 | - os: ubuntu-latest 32 | tag: zsh 33 | arch: arm64 34 | platform: "linux/arm64" 35 | 36 | # - os: ubuntu-latest 37 | # tag: zsh 38 | # arch: armv7 39 | # platform: "linux/arm/v7" 40 | 41 | # - os: ubuntu-latest 42 | # tag: latest 43 | # arch: armv6 44 | # platform: "linux/arm/v6" 45 | 46 | # - os: ubuntu-latest 47 | # tag: latest 48 | # arch: 386 49 | # platform: "linux/386" 50 | 51 | # - os: ubuntu-latest 52 | # tag: latest 53 | # arch: riscv64 54 | # platform: "linux/riscv64" 55 | 56 | # - os: ubuntu-latest 57 | # tag: latest 58 | # arch: ppc64le 59 | # platform: "linux/ppc64le" 60 | 61 | # - os: ubuntu-latest 62 | # tag: latest 63 | # arch: s390x 64 | # platform: "linux/s390x" 65 | 66 | # - os: ubuntu-latest 67 | # tag: latest 68 | # arch: mips64le 69 | # platform: "linux/mips64le" 70 | 71 | # - os: ubuntu-latest 72 | # tag: latest 73 | # arch: mips32le 74 | # platform: "linux/mips32le" 75 | 76 | # - os: self-hosted-debian 77 | # tag: hello 78 | # arch: amd64 79 | # platform: "linux/amd64" 80 | 81 | # repeat... 82 | steps: 83 | - name: set time env 84 | run: | 85 | printf "%s\n" \ 86 | "time_begin=$(date -u --rfc-3339=ns)" \ 87 | "time_today=$(date -u --rfc-3339=date)" \ 88 | >> "$GITHUB_ENV" 89 | 90 | - uses: actions/checkout@v2 91 | with: 92 | # repository: "2moe/xxx" 93 | ref: "master" 94 | fetch-depth: 1 95 | 96 | - name: get architecture 97 | env: 98 | TARGETARCH: ${{ matrix.arch }} 99 | run: bash docker/assets/get_arch 100 | 101 | - name: get container os & set global env 102 | env: 103 | tag: ${{ matrix.tag }} 104 | run: bash docker/action/get_container_os 105 | 106 | - name: set up qemu-user & binfmt 107 | id: qemu 108 | uses: docker/setup-qemu-action@v1 109 | if: matrix.arch != 'amd64' && matrix.arch != 'i386' 110 | with: 111 | image: tonistiigi/binfmt:latest 112 | platforms: ${{ matrix.platform }} 113 | 114 | - name: set container name(notag latest/base) 115 | if: matrix.tag == 'base' || matrix.tag == 'latest' 116 | env: 117 | container: ${{ env.name }}-${{ matrix.arch }} 118 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 119 | 120 | - name: set container name(normal) 121 | if: matrix.tag != 'base' && matrix.tag != 'latest' 122 | env: 123 | container: ${{ env.name }}-${{ matrix.tag }}-${{ matrix.arch }} 124 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 125 | 126 | - name: set repo (global env) 127 | env: 128 | repo: ${{ env.user }}/${{ env.Container_name }} 129 | m_arch: ${{ matrix.arch }} 130 | run: | 131 | printf "%s\n" \ 132 | "repo=$repo" \ 133 | "zsh_repo=${user}/${name}-zsh-${m_arch}" \ 134 | >> "$GITHUB_ENV" 135 | 136 | - name: build container 137 | env: 138 | file: "../${{ env.name }}/${{ matrix.tag }}.dockerfile" 139 | tag: ${{ matrix.tag }} 140 | run: bash docker/action/docker_build 141 | 142 | - name: build base 143 | if: matrix.tag == 'base' 144 | env: 145 | file: "../${{ env.name }}/${{ matrix.tag }}02.dockerfile" 146 | run: | 147 | docker run -d --name base_tmp ${{ env.repo }}:latest sh 148 | docker cp base_tmp:/arch.tar.xz . 149 | xz -dfv arch.tar.xz 150 | mv arch.tar docker/assets 151 | docker stop base_tmp 152 | docker rm -f base_tmp 153 | docker rmi -f ${repo} 154 | bash docker/action/docker_build 155 | rm -fv docker/assets/arch.tar 156 | 157 | - name: Log in to Docker Hub 158 | uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 159 | with: 160 | username: ${{ env.user }} 161 | password: ${{ secrets.DOCKER_TOKEN }} 162 | - name: docker push 163 | run: | 164 | docker push -a "${repo}" 165 | 166 | - name: docker run (zsh) 167 | if: matrix.tag == 'zsh' 168 | timeout-minutes: 1 169 | continue-on-error: true 170 | run: bash docker/action/docker_run docker zsh 171 | 172 | - name: docker run 173 | if: matrix.tag != 'zsh' 174 | timeout-minutes: 1 175 | run: bash docker/action/docker_run 176 | 177 | - name: docker export 178 | run: bash docker/action/docker_export 179 | 180 | - name: start zstd 181 | # if: matrix.tag != 'base' 182 | run: bash docker/action/compress_file $zstd_level 183 | 184 | - name: docker build zstd image 185 | # if: matrix.tag != 'base' 186 | run: bash docker/action/build_zstd_image 187 | 188 | - name: set end time 189 | run: | 190 | printf "%s\n" \ 191 | "end_time_normal=$(date -u +%Y-%m-%d_%H-%M)" \ 192 | "end_time=$(date -u --rfc-3339=ns)" \ 193 | >>"$GITHUB_ENV" 194 | 195 | - name: write to toml file 196 | env: 197 | tag: ${{ matrix.tag }} 198 | platform: ${{ matrix.platform }} 199 | run: | 200 | bash docker/action/write_to_toml 201 | 202 | - name: cat i.toml 203 | run: cat i.toml 204 | 205 | - name: gen docker readme 206 | env: 207 | dir: docker/assets 208 | run: | 209 | bash docker/action/gen_docker_readme 210 | cat docker-readme.md 211 | 212 | - name: push README to Dockerhub 213 | uses: christian-korneck/update-container-description-action@v1 214 | env: 215 | DOCKER_USER: ${{ env.user }} 216 | DOCKER_PASS: ${{ secrets.DOCKER_TOKEN }} 217 | with: 218 | destination_container_repo: ${{ env.repo }} 219 | provider: dockerhub 220 | # short_description: "Quickly install ${{ env.Container_name }}" 221 | readme_file: "docker-readme.md" 222 | 223 | - name: copy docker readme.md to home dir 224 | run: | 225 | cp docker-readme.md ~/${Container_name}.md 226 | cp i.toml ~/${Container_name}.toml 227 | 228 | - name: repo(index) 229 | uses: actions/checkout@v2 230 | with: 231 | repository: "2cd/index" 232 | ref: "master" 233 | persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. 234 | fetch-depth: 1 # otherwise, there would be errors pushing refs to the destination repository. 235 | - name: create local changes 236 | run: | 237 | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" 238 | git config --local user.name "github-actions[bot]" 239 | git reset --hard origin/master 240 | git pull --rebase --stat origin master --allow-unrelated-histories 241 | mkdir -p doc/${name} 242 | cp ~/${Container_name}.md ~/${Container_name}.toml doc/${name} 243 | 244 | - name: commit files 245 | run: | 246 | git add . 247 | git commit -m "docs(docker): ${Container_name}.md" -a 248 | - name: push changes 249 | uses: ad-m/github-push-action@master 250 | with: 251 | repository: "2cd/index" 252 | github_token: ${{ secrets.GH_TOKEN }} 253 | branch: "master" 254 | #------------------------------------------------ 255 | job2: 256 | needs: [job1] 257 | runs-on: ${{ matrix.os }} 258 | env: 259 | name: manjaro 260 | user: cake233 261 | platform: ${{ matrix.platform }} 262 | arch: ${{ matrix.arch }} 263 | zstd_level: 19 264 | 265 | strategy: 266 | fail-fast: false 267 | matrix: 268 | include: 269 | - os: ubuntu-latest 270 | tag: xfce 271 | arch: amd64 272 | platform: "linux/amd64" 273 | 274 | - os: ubuntu-latest 275 | tag: xfce 276 | arch: arm64 277 | platform: "linux/arm64" 278 | 279 | # - os: ubuntu-latest 280 | # tag: latest 281 | # arch: armv6 282 | # platform: "linux/arm/v6" 283 | 284 | # - os: ubuntu-latest 285 | # tag: mate 286 | # arch: 386 287 | # platform: "linux/386" 288 | 289 | # - os: ubuntu-latest 290 | # tag: latest 291 | # arch: riscv64 292 | # platform: "linux/riscv64" 293 | 294 | # - os: ubuntu-latest 295 | # tag: latest 296 | # arch: ppc64le 297 | # platform: "linux/ppc64le" 298 | 299 | # - os: ubuntu-latest 300 | # tag: latest 301 | # arch: s390x 302 | # platform: "linux/s390x" 303 | 304 | # - os: ubuntu-latest 305 | # tag: latest 306 | # arch: mips64le 307 | # platform: "linux/mips64le" 308 | 309 | # - os: ubuntu-latest 310 | # tag: latest 311 | # arch: mips32le 312 | # platform: "linux/mips32le" 313 | 314 | # - os: self-hosted-debian 315 | # tag: hello 316 | # arch: amd64 317 | # platform: "linux/amd64" 318 | 319 | # repeat... 320 | steps: 321 | - name: set time env 322 | run: | 323 | printf "%s\n" \ 324 | "time_begin=$(date -u --rfc-3339=ns)" \ 325 | "time_today=$(date -u --rfc-3339=date)" \ 326 | >> "$GITHUB_ENV" 327 | 328 | - uses: actions/checkout@v2 329 | with: 330 | # repository: "2moe/xxx" 331 | ref: "master" 332 | fetch-depth: 1 333 | 334 | - name: get architecture 335 | env: 336 | TARGETARCH: ${{ matrix.arch }} 337 | run: bash docker/assets/get_arch 338 | 339 | - name: get container os & set global env 340 | env: 341 | tag: ${{ matrix.tag }} 342 | run: bash docker/action/get_container_os 343 | 344 | - name: set up qemu-user & binfmt 345 | id: qemu 346 | uses: docker/setup-qemu-action@v1 347 | if: matrix.arch != 'amd64' && matrix.arch != 'i386' 348 | with: 349 | image: tonistiigi/binfmt:latest 350 | platforms: ${{ matrix.platform }} 351 | 352 | - name: set container name(notag latest/base) 353 | if: matrix.tag == 'base' || matrix.tag == 'latest' 354 | env: 355 | container: ${{ env.name }}-${{ matrix.arch }} 356 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 357 | 358 | - name: set container name(normal) 359 | if: matrix.tag != 'base' && matrix.tag != 'latest' 360 | env: 361 | container: ${{ env.name }}-${{ matrix.tag }}-${{ matrix.arch }} 362 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 363 | 364 | - name: set repo (global env) 365 | env: 366 | repo: ${{ env.user }}/${{ env.Container_name }} 367 | m_arch: ${{ matrix.arch }} 368 | run: | 369 | printf "%s\n" \ 370 | "repo=$repo" \ 371 | "zsh_repo=${user}/${name}-zsh-${m_arch}" \ 372 | >> "$GITHUB_ENV" 373 | 374 | - name: build container 375 | env: 376 | file: "../${{ env.name }}/${{ matrix.tag }}.dockerfile" 377 | tag: ${{ matrix.tag }} 378 | run: bash docker/action/docker_build 379 | 380 | - name: build base 381 | if: matrix.tag == 'base' 382 | env: 383 | file: "../${{ env.name }}/${{ matrix.tag }}02.dockerfile" 384 | run: | 385 | docker run -d --name base_tmp ${{ env.repo }}:latest sh 386 | docker cp base_tmp:/arch.tar.xz . 387 | xz -dfv arch.tar.xz 388 | mv arch.tar docker/assets 389 | docker stop base_tmp 390 | docker rm -f base_tmp 391 | docker rmi -f ${repo} 392 | bash docker/action/docker_build 393 | rm -fv docker/assets/arch.tar 394 | 395 | - name: Log in to Docker Hub 396 | uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 397 | with: 398 | username: ${{ env.user }} 399 | password: ${{ secrets.DOCKER_TOKEN }} 400 | - name: docker push 401 | run: | 402 | docker push -a "${repo}" 403 | 404 | - name: docker run (zsh) 405 | if: matrix.tag == 'zsh' 406 | timeout-minutes: 1 407 | continue-on-error: true 408 | run: bash docker/action/docker_run docker zsh 409 | 410 | - name: docker run 411 | if: matrix.tag != 'zsh' 412 | timeout-minutes: 1 413 | run: bash docker/action/docker_run 414 | 415 | - name: docker export 416 | run: bash docker/action/docker_export 417 | 418 | - name: start zstd 419 | # if: matrix.tag != 'base' 420 | run: bash docker/action/compress_file $zstd_level 421 | 422 | - name: docker build zstd image 423 | # if: matrix.tag != 'base' 424 | run: bash docker/action/build_zstd_image 425 | 426 | - name: set end time 427 | run: | 428 | printf "%s\n" \ 429 | "end_time_normal=$(date -u +%Y-%m-%d_%H-%M)" \ 430 | "end_time=$(date -u --rfc-3339=ns)" \ 431 | >>"$GITHUB_ENV" 432 | 433 | - name: write to toml file 434 | env: 435 | tag: ${{ matrix.tag }} 436 | platform: ${{ matrix.platform }} 437 | run: | 438 | bash docker/action/write_to_toml 439 | 440 | - name: cat i.toml 441 | run: cat i.toml 442 | 443 | - name: gen docker readme 444 | env: 445 | dir: docker/assets 446 | run: | 447 | bash docker/action/gen_docker_readme 448 | cat docker-readme.md 449 | 450 | - name: push README to Dockerhub 451 | uses: christian-korneck/update-container-description-action@v1 452 | env: 453 | DOCKER_USER: ${{ env.user }} 454 | DOCKER_PASS: ${{ secrets.DOCKER_TOKEN }} 455 | with: 456 | destination_container_repo: ${{ env.repo }} 457 | provider: dockerhub 458 | # short_description: "Quickly install ${{ env.Container_name }}" 459 | readme_file: "docker-readme.md" 460 | 461 | - name: copy docker readme.md to home dir 462 | run: | 463 | cp docker-readme.md ~/${Container_name}.md 464 | cp i.toml ~/${Container_name}.toml 465 | 466 | - name: repo(index) 467 | uses: actions/checkout@v2 468 | with: 469 | repository: "2cd/index" 470 | ref: "master" 471 | persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. 472 | fetch-depth: 1 # otherwise, there would be errors pushing refs to the destination repository. 473 | - name: create local changes 474 | run: | 475 | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" 476 | git config --local user.name "github-actions[bot]" 477 | git reset --hard origin/master 478 | git pull --rebase --stat origin master --allow-unrelated-histories 479 | mkdir -p doc/${name} 480 | cp ~/${Container_name}.md ~/${Container_name}.toml doc/${name} 481 | 482 | - name: commit files 483 | run: | 484 | git add . 485 | git commit -m "docs(docker): ${Container_name}.md" -a 486 | - name: push changes 487 | uses: ad-m/github-push-action@master 488 | with: 489 | repository: "2cd/index" 490 | github_token: ${{ secrets.GH_TOKEN }} 491 | branch: "master" 492 | #------------------------------------------------ 493 | job3: 494 | needs: [job1, job2] 495 | runs-on: ubuntu-latest 496 | env: 497 | user: cake233 498 | 499 | steps: 500 | - name: manjaro manifest 501 | env: 502 | name: manjaro 503 | run: | 504 | # name=manjaro 505 | echo ${{ secrets.DOCKER_TOKEN }} | docker login -u ${{ env.user }} --password-stdin 506 | for i in xfce zsh;do 507 | docker manifest create --amend ${{ env.user }}/${i}:${{ env.name }} \ 508 | ${{ env.user }}/${{ env.name }}-${i}-amd64 \ 509 | ${{ env.user }}/${{ env.name }}-${i}-arm64 510 | docker manifest push ${{ env.user }}/${i}:${{ env.name }} 511 | done 512 | -------------------------------------------------------------------------------- /.github/workflows/node.yml: -------------------------------------------------------------------------------- 1 | name: build node, dotnet, ruby & php 2 | # begin_time = 2024-03-04 12:02:02+00:00 3 | 4 | on: 5 | push: 6 | branches: [master] 7 | paths: 8 | - ".github/workflows/node.yml" 9 | 10 | jobs: 11 | job1: 12 | # needs: [job1] 13 | runs-on: ${{ matrix.os }} 14 | env: 15 | name: ${{ matrix.name }} 16 | user: cake233 17 | platform: ${{ matrix.platform }} 18 | arch: ${{ matrix.arch }} 19 | zstd_level: 22 20 | 21 | strategy: 22 | fail-fast: false 23 | matrix: 24 | include: 25 | - os: ubuntu-latest 26 | name: php 27 | tag: latest 28 | arch: amd64 29 | platform: "linux/amd64" 30 | - os: ubuntu-latest 31 | name: php 32 | tag: latest 33 | arch: arm64 34 | platform: "linux/arm64" 35 | 36 | - os: ubuntu-latest 37 | name: php 38 | tag: alpine 39 | arch: amd64 40 | platform: "linux/amd64" 41 | - os: ubuntu-latest 42 | name: php 43 | tag: alpine 44 | arch: arm64 45 | platform: "linux/arm64" 46 | - os: ubuntu-latest 47 | name: php 48 | tag: alpine 49 | arch: armv7 50 | platform: "linux/arm/v7" 51 | 52 | - os: ubuntu-latest 53 | name: ruby 54 | tag: latest 55 | arch: amd64 56 | platform: "linux/amd64" 57 | - os: ubuntu-latest 58 | name: ruby 59 | tag: latest 60 | arch: arm64 61 | platform: "linux/arm64" 62 | 63 | - os: ubuntu-latest 64 | name: ruby 65 | tag: alpine 66 | arch: amd64 67 | platform: "linux/amd64" 68 | - os: ubuntu-latest 69 | name: ruby 70 | tag: alpine 71 | arch: arm64 72 | platform: "linux/arm64" 73 | - os: ubuntu-latest 74 | name: ruby 75 | tag: alpine 76 | arch: armv7 77 | platform: "linux/arm/v7" 78 | 79 | - os: ubuntu-latest 80 | name: node 81 | tag: latest 82 | arch: amd64 83 | platform: "linux/amd64" 84 | - os: ubuntu-latest 85 | name: node 86 | tag: latest 87 | arch: arm64 88 | platform: "linux/arm64" 89 | 90 | - os: ubuntu-latest 91 | name: node 92 | tag: alpine 93 | arch: amd64 94 | platform: "linux/amd64" 95 | - os: ubuntu-latest 96 | name: node 97 | tag: alpine 98 | arch: arm64 99 | platform: "linux/arm64" 100 | - os: ubuntu-latest 101 | name: node 102 | tag: alpine 103 | arch: armv7 104 | platform: "linux/arm/v7" 105 | 106 | # .NET 107 | - os: ubuntu-latest 108 | name: dotnet 109 | tag: latest 110 | arch: arm64 111 | platform: "linux/arm64" 112 | 113 | - os: ubuntu-latest 114 | name: dotnet 115 | tag: latest 116 | arch: amd64 117 | platform: "linux/amd64" 118 | 119 | - os: ubuntu-latest 120 | name: swift 121 | tag: latest 122 | arch: arm64 123 | platform: "linux/arm64" 124 | 125 | - os: ubuntu-latest 126 | name: swift 127 | tag: latest 128 | arch: amd64 129 | platform: "linux/amd64" 130 | 131 | # - os: ubuntu-latest 132 | # name: dotnet 133 | # tag: latest 134 | # arch: armv7 135 | # platform: "linux/arm/v7" 136 | 137 | # - os: ubuntu-latest 138 | # tag: latest 139 | # arch: ppc64le 140 | # platform: "linux/ppc64le" 141 | 142 | # - os: ubuntu-latest 143 | # tag: latest 144 | # arch: s390x 145 | # platform: "linux/s390x" 146 | 147 | # - os: ubuntu-latest 148 | # tag: latest 149 | # arch: mips64le 150 | # platform: "linux/mips64le" 151 | 152 | # - os: ubuntu-latest 153 | # tag: latest 154 | # arch: mips32le 155 | # platform: "linux/mips32le" 156 | 157 | # - os: self-hosted-debian 158 | # tag: hello 159 | # arch: amd64 160 | # platform: "linux/amd64" 161 | 162 | # repeat... 163 | steps: 164 | - name: set time env 165 | run: | 166 | printf "%s\n" \ 167 | "time_begin=$(date -u --rfc-3339=ns)" \ 168 | "time_today=$(date -u --rfc-3339=date)" \ 169 | >> "$GITHUB_ENV" 170 | 171 | - uses: actions/checkout@v2 172 | with: 173 | # repository: "2moe/xxx" 174 | ref: "master" 175 | fetch-depth: 1 176 | 177 | - name: get architecture 178 | env: 179 | TARGETARCH: ${{ matrix.arch }} 180 | run: bash docker/assets/get_arch 181 | 182 | - name: get container os & set global env 183 | env: 184 | tag: ${{ matrix.tag }} 185 | run: bash docker/action/get_container_os 186 | 187 | - name: set up qemu-user & binfmt 188 | id: qemu 189 | uses: docker/setup-qemu-action@v1 190 | if: matrix.arch != 'amd64' && matrix.arch != 'i386' 191 | with: 192 | image: tonistiigi/binfmt:latest 193 | platforms: ${{ matrix.platform }} 194 | 195 | - name: set container name(notag latest/base) 196 | if: matrix.tag == 'base' || matrix.tag == 'latest' 197 | env: 198 | container: ${{ env.name }}-${{ matrix.arch }} 199 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 200 | 201 | - name: set container name(normal) 202 | if: matrix.tag != 'base' && matrix.tag != 'latest' 203 | env: 204 | container: ${{ env.name }}-${{ matrix.tag }}-${{ matrix.arch }} 205 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 206 | 207 | - name: set repo (global env) 208 | env: 209 | repo: ${{ env.user }}/${{ env.Container_name }} 210 | m_arch: ${{ matrix.arch }} 211 | run: | 212 | printf "%s\n" \ 213 | "repo=$repo" \ 214 | "zsh_repo=${user}/${name}-zsh-${m_arch}" \ 215 | >> "$GITHUB_ENV" 216 | 217 | - name: build container 218 | env: 219 | file: "../${{ env.name }}/${{ matrix.tag }}.dockerfile" 220 | tag: ${{ matrix.tag }} 221 | run: bash docker/action/docker_build 222 | 223 | - name: build base 224 | if: matrix.tag == 'base' 225 | env: 226 | file: "../${{ env.name }}/${{ matrix.tag }}02.dockerfile" 227 | run: | 228 | docker run -d --name base_tmp ${{ env.repo }}:latest sh 229 | docker cp base_tmp:/arch.tar.xz . 230 | xz -dfv arch.tar.xz 231 | mv arch.tar docker/assets 232 | docker stop base_tmp 233 | docker rm -f base_tmp 234 | docker rmi -f ${repo} 235 | bash docker/action/docker_build 236 | rm -fv docker/assets/arch.tar 237 | 238 | - name: Log in to Docker Hub 239 | uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 240 | with: 241 | username: ${{ env.user }} 242 | password: ${{ secrets.DOCKER_TOKEN }} 243 | - name: docker push 244 | run: | 245 | docker push -a "${repo}" 246 | 247 | - name: docker run (zsh) 248 | if: matrix.tag == 'zsh' 249 | timeout-minutes: 1 250 | continue-on-error: true 251 | run: bash docker/action/docker_run docker zsh 252 | 253 | - name: docker run 254 | if: matrix.tag != 'zsh' 255 | timeout-minutes: 1 256 | run: bash docker/action/docker_run 257 | 258 | - name: docker export 259 | run: bash docker/action/docker_export 260 | 261 | - name: start zstd 262 | # if: matrix.tag != 'base' 263 | run: bash docker/action/compress_file $zstd_level 264 | 265 | - name: docker build zstd image 266 | # if: matrix.tag != 'base' 267 | run: bash docker/action/build_zstd_image 268 | 269 | - name: set end time 270 | run: | 271 | printf "%s\n" \ 272 | "end_time_normal=$(date -u +%Y-%m-%d_%H-%M)" \ 273 | "end_time=$(date -u --rfc-3339=ns)" \ 274 | >>"$GITHUB_ENV" 275 | 276 | - name: write to toml file 277 | env: 278 | tag: ${{ matrix.tag }} 279 | platform: ${{ matrix.platform }} 280 | run: | 281 | bash docker/action/write_to_toml 282 | 283 | - name: cat i.toml 284 | run: cat i.toml 285 | 286 | - name: gen docker readme 287 | env: 288 | dir: docker/assets 289 | run: | 290 | bash docker/action/gen_docker_readme 291 | cat docker-readme.md 292 | 293 | - name: push README to Dockerhub 294 | uses: christian-korneck/update-container-description-action@v1 295 | env: 296 | DOCKER_USER: ${{ env.user }} 297 | DOCKER_PASS: ${{ secrets.DOCKER_TOKEN }} 298 | with: 299 | destination_container_repo: ${{ env.repo }} 300 | provider: dockerhub 301 | # short_description: "Quickly install ${{ env.Container_name }}" 302 | readme_file: "docker-readme.md" 303 | 304 | - name: copy docker readme.md to home dir 305 | run: | 306 | cp docker-readme.md ~/${Container_name}.md 307 | cp i.toml ~/${Container_name}.toml 308 | 309 | - name: repo(index) 310 | uses: actions/checkout@v2 311 | with: 312 | repository: "2cd/index" 313 | ref: "master" 314 | persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. 315 | fetch-depth: 1 # otherwise, there would be errors pushing refs to the destination repository. 316 | - name: create local changes 317 | run: | 318 | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" 319 | git config --local user.name "github-actions[bot]" 320 | git reset --hard origin/master 321 | git pull --rebase --stat origin master --allow-unrelated-histories 322 | mkdir -p doc/${name} 323 | cp ~/${Container_name}.md ~/${Container_name}.toml doc/${name} 324 | 325 | - name: commit files 326 | run: | 327 | git add . 328 | git commit -m "docs(docker): ${Container_name}.md" -a 329 | - name: push changes 330 | uses: ad-m/github-push-action@master 331 | with: 332 | repository: "2cd/index" 333 | github_token: ${{ secrets.GH_TOKEN }} 334 | branch: "master" 335 | #------------------------------------------------ 336 | manifest: 337 | needs: [job1] 338 | runs-on: ubuntu-latest 339 | env: 340 | user: cake233 341 | 342 | steps: 343 | - name: swift manifest 344 | env: 345 | name: swift 346 | run: | 347 | # name=swift 348 | TODAY=$(date -u +%Y-%m-%d) 349 | echo ${{ secrets.DOCKER_TOKEN }} | docker login -u ${{ env.user }} --password-stdin 350 | for i in latest ubuntu ${TODAY};do 351 | docker manifest create --amend ${{ env.user }}/${{ env.name }}:${i} \ 352 | ${{ env.user }}/${{ env.name }}-amd64 \ 353 | ${{ env.user }}/${{ env.name }}-arm64 354 | docker manifest push ${{ env.user }}/${{ env.name }}:${i} 355 | done 356 | 357 | - name: dotnet manifest 358 | env: 359 | name: dotnet 360 | run: | 361 | # name=dotnet 362 | TODAY=$(date -u +%Y-%m-%d) 363 | echo ${{ secrets.DOCKER_TOKEN }} | docker login -u ${{ env.user }} --password-stdin 364 | for i in latest ${TODAY};do 365 | docker manifest create --amend ${{ env.user }}/${{ env.name }}:${i} \ 366 | ${{ env.user }}/${{ env.name }}-amd64 \ 367 | ${{ env.user }}/${{ env.name }}-arm64 368 | docker manifest push ${{ env.user }}/${{ env.name }}:${i} 369 | done 370 | -------------------------------------------------------------------------------- /.github/workflows/push.yml: -------------------------------------------------------------------------------- 1 | name: gh push 2 | on: 3 | push: 4 | branches: [master] 5 | paths: 6 | - ".github/workflows/push.ymlllll" 7 | jobs: 8 | job1: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | with: 13 | repository: "2cd/index" 14 | ref: "master" 15 | persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. 16 | fetch-depth: 1 # otherwise, there would be errors pushing refs to the destination repository. 17 | - name: Create local changes 18 | run: | 19 | echo "hello world" > test.md 20 | - name: Commit files 21 | run: | 22 | git add . 23 | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" 24 | git config --local user.name "github-actions[bot]" 25 | git commit -m "test action" -a 26 | - name: Push changes 27 | uses: ad-m/github-push-action@master 28 | with: 29 | repository: "2cd/index" 30 | github_token: ${{ secrets.GH_TOKEN }} 31 | branch: "master" 32 | -------------------------------------------------------------------------------- /.github/workflows/rebuild.yml: -------------------------------------------------------------------------------- 1 | name: build cblmariner images 2 | # begin_time = 2022-04-22 3 | 4 | on: 5 | push: 6 | branches: [master] 7 | paths: 8 | - ".github/workflows/rebuild.yml" 9 | jobs: 10 | job1: 11 | # needs: [job1] 12 | runs-on: ${{ matrix.os }} 13 | env: 14 | name: ${{ matrix.name }} 15 | user: cake233 16 | # tag: base 17 | platform: ${{ matrix.platform }} 18 | arch: ${{ matrix.arch }} 19 | zstd_level: 19 20 | 21 | strategy: 22 | # fail-fast: false 23 | matrix: 24 | include: 25 | - os: ubuntu-latest 26 | name: euler 27 | arch: amd64 28 | tag: base 29 | platform: "linux/amd64" 30 | - os: ubuntu-latest 31 | name: euler 32 | arch: arm64 33 | tag: base 34 | platform: "linux/arm64" 35 | 36 | - os: ubuntu-latest 37 | name: amazon 38 | arch: amd64 39 | tag: base 40 | platform: "linux/amd64" 41 | - os: ubuntu-latest 42 | name: amazon 43 | arch: arm64 44 | tag: base 45 | platform: "linux/arm64" 46 | 47 | - os: ubuntu-latest 48 | name: oracle 49 | arch: amd64 50 | tag: base 51 | platform: "linux/amd64" 52 | - os: ubuntu-latest 53 | name: oracle 54 | arch: arm64 55 | tag: base 56 | platform: "linux/arm64" 57 | # cblmariner 58 | - os: ubuntu-latest 59 | name: cblmariner 60 | arch: amd64 61 | tag: base 62 | platform: "linux/amd64" 63 | - os: ubuntu-latest 64 | name: cblmariner 65 | arch: arm64 66 | tag: base 67 | platform: "linux/arm64" 68 | # repeat... 69 | steps: 70 | - name: set time env 71 | run: | 72 | printf "%s\n" \ 73 | "time_begin=$(date -u --rfc-3339=ns)" \ 74 | "time_today=$(date -u --rfc-3339=date)" \ 75 | >> "$GITHUB_ENV" 76 | 77 | - uses: actions/checkout@v2 78 | with: 79 | # repository: "2moe/xxx" 80 | ref: "master" 81 | fetch-depth: 1 82 | 83 | - name: get architecture 84 | env: 85 | TARGETARCH: ${{ matrix.arch }} 86 | run: bash docker/assets/get_arch 87 | 88 | - name: get container os & set global env 89 | env: 90 | tag: ${{ matrix.tag }} 91 | run: bash docker/action/get_container_os 92 | 93 | - name: set up qemu-user & binfmt 94 | id: qemu 95 | uses: docker/setup-qemu-action@v1 96 | if: matrix.arch != 'amd64' && matrix.arch != 'i386' 97 | with: 98 | image: tonistiigi/binfmt:latest 99 | platforms: ${{ matrix.platform }} 100 | 101 | - name: set container name(notag latest/base) 102 | if: matrix.tag == 'base' || matrix.tag == 'latest' 103 | env: 104 | container: ${{ env.name }}-${{ matrix.arch }} 105 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 106 | 107 | - name: set container name(notag latest/base) 108 | if: matrix.tag == 'base' || matrix.tag == 'latest' 109 | env: 110 | container: ${{ env.name }}-${{ matrix.arch }} 111 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 112 | 113 | - name: set container name(normal) 114 | if: matrix.tag != 'base' && matrix.tag != 'latest' 115 | env: 116 | container: ${{ env.name }}-${{ matrix.tag }}-${{ matrix.arch }} 117 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 118 | 119 | - name: set repo (global env) 120 | env: 121 | repo: ${{ env.user }}/${{ env.Container_name }} 122 | m_arch: ${{ matrix.arch }} 123 | run: | 124 | printf "%s\n" \ 125 | "repo=$repo" \ 126 | "zsh_repo=${user}/${name}-zsh-${m_arch}" \ 127 | >> "$GITHUB_ENV" 128 | 129 | - name: build container 130 | env: 131 | file: "../${{ env.name }}/${{ matrix.tag }}.dockerfile" 132 | tag: ${{ matrix.tag }} 133 | run: bash docker/action/docker_build 134 | 135 | - name: Log in to Docker Hub 136 | uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 137 | with: 138 | username: ${{ env.user }} 139 | password: ${{ secrets.DOCKER_TOKEN }} 140 | - name: docker push 141 | run: | 142 | docker push -a "${repo}" 143 | 144 | - name: docker run (zsh) 145 | if: matrix.tag == 'zsh' 146 | timeout-minutes: 1 147 | continue-on-error: true 148 | run: bash docker/action/docker_run docker zsh 149 | 150 | - name: docker run 151 | if: matrix.tag != 'zsh' 152 | timeout-minutes: 1 153 | run: bash docker/action/docker_run 154 | 155 | - name: docker export 156 | run: bash docker/action/docker_export 157 | 158 | - name: start zstd 159 | # if: matrix.tag != 'base' 160 | run: bash docker/action/compress_file $zstd_level 161 | 162 | - name: docker build zstd image 163 | # if: matrix.tag != 'base' 164 | run: bash docker/action/build_zstd_image 165 | 166 | - name: set end time 167 | run: | 168 | printf "%s\n" \ 169 | "end_time_normal=$(date -u +%Y-%m-%d_%H-%M)" \ 170 | "end_time=$(date -u --rfc-3339=ns)" \ 171 | >>"$GITHUB_ENV" 172 | 173 | - name: write to toml file 174 | env: 175 | tag: ${{ matrix.tag }} 176 | platform: ${{ matrix.platform }} 177 | run: | 178 | bash docker/action/write_to_toml 179 | 180 | - name: cat i.toml 181 | run: cat i.toml 182 | 183 | - name: gen docker readme 184 | env: 185 | dir: docker/assets 186 | run: | 187 | bash docker/action/gen_docker_readme 188 | cat docker-readme.md 189 | 190 | # - name: push README to Dockerhub 191 | # uses: christian-korneck/update-container-description-action@v1 192 | # env: 193 | # DOCKER_USER: ${{ env.user }} 194 | # DOCKER_PASS: ${{ secrets.DOCKER_TOKEN }} 195 | # with: 196 | # destination_container_repo: ${{ env.repo }} 197 | # provider: dockerhub 198 | # # short_description: "Quickly install ${{ env.Container_name }}" 199 | # readme_file: "docker-readme.md" 200 | 201 | - name: copy docker readme.md to home dir 202 | run: | 203 | cp docker-readme.md ~/${Container_name}.md 204 | cp i.toml ~/${Container_name}.toml 205 | 206 | - name: repo(index) 207 | uses: actions/checkout@v2 208 | with: 209 | repository: "2cd/index" 210 | ref: "master" 211 | persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. 212 | fetch-depth: 1 # otherwise, there would be errors pushing refs to the destination repository. 213 | - name: create local changes 214 | run: | 215 | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" 216 | git config --local user.name "github-actions[bot]" 217 | git reset --hard origin/master 218 | git pull --rebase --stat origin master --allow-unrelated-histories 219 | mkdir -p doc/${name} 220 | cp ~/${Container_name}.md ~/${Container_name}.toml doc/${name} 221 | 222 | - name: commit files 223 | run: | 224 | git add . 225 | git commit -m "docs(docker): ${Container_name}.md" -a 226 | - name: push changes 227 | uses: ad-m/github-push-action@master 228 | with: 229 | repository: "2cd/index" 230 | github_token: ${{ secrets.GH_TOKEN }} 231 | branch: "master" 232 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: test ubuntu images 2 | # begin_time = 2022-06-02 01:45 3 | 4 | on: 5 | push: 6 | branches: [master] 7 | paths: 8 | - ".github/workflows/test.yml" 9 | 10 | jobs: 11 | job1: 12 | continue-on-error: true 13 | # needs: [job0, job1] 14 | runs-on: ${{ matrix.os }} 15 | env: 16 | name: ubuntu 17 | user: cake233 18 | platform: ${{ matrix.platform }} 19 | arch: ${{ matrix.arch }} 20 | zstd_level: 20 21 | 22 | strategy: 23 | fail-fast: false 24 | matrix: 25 | include: 26 | - os: ubuntu-latest 27 | tag: zsh 28 | arch: amd64 29 | platform: "linux/amd64" 30 | 31 | # repeat... 32 | steps: 33 | - name: set time env 34 | run: | 35 | printf "%s\n" \ 36 | "time_begin=$(date -u --rfc-3339=ns)" \ 37 | "time_today=$(date -u --rfc-3339=date)" \ 38 | >> "$GITHUB_ENV" 39 | 40 | - uses: actions/checkout@v2 41 | with: 42 | # repository: "2moe/xxx" 43 | ref: "master" 44 | fetch-depth: 1 45 | 46 | - name: get architecture 47 | env: 48 | TARGETARCH: ${{ matrix.arch }} 49 | run: bash docker/assets/get_arch 50 | 51 | - name: get container os & set global env 52 | env: 53 | tag: ${{ matrix.tag }} 54 | run: bash docker/action/get_container_os 55 | 56 | - name: set up qemu-user & binfmt 57 | id: qemu 58 | uses: docker/setup-qemu-action@v1 59 | if: matrix.arch != 'amd64' && matrix.arch != 'i386' 60 | with: 61 | image: tonistiigi/binfmt:latest 62 | platforms: ${{ matrix.platform }} 63 | 64 | - name: set container name(notag latest/base) 65 | if: matrix.tag == 'base' || matrix.tag == 'latest' 66 | env: 67 | container: ${{ env.name }}-${{ matrix.arch }} 68 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 69 | 70 | - name: set container name(normal) 71 | if: matrix.tag != 'base' && matrix.tag != 'latest' 72 | env: 73 | container: ${{ env.name }}-${{ matrix.tag }}-${{ matrix.arch }} 74 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 75 | 76 | - name: set repo (global env) 77 | env: 78 | repo: ${{ env.user }}/${{ env.Container_name }} 79 | m_arch: ${{ matrix.arch }} 80 | run: | 81 | printf "%s\n" \ 82 | "repo=$repo" \ 83 | "zsh_repo=${user}/${name}-zsh-${m_arch}" \ 84 | >> "$GITHUB_ENV" 85 | 86 | - name: build container 87 | env: 88 | file: "../${{ env.name }}/${{ matrix.tag }}.dockerfile" 89 | tag: ${{ matrix.tag }} 90 | run: bash docker/action/docker_build 91 | 92 | - name: build base 93 | if: matrix.tag == 'base' 94 | env: 95 | file: "../${{ env.name }}/${{ matrix.tag }}02.dockerfile" 96 | run: | 97 | docker run -d --name base_tmp ${{ env.repo }}:latest sh 98 | docker cp base_tmp:/arch.tar.xz . 99 | xz -dfv arch.tar.xz 100 | mv arch.tar docker/assets 101 | docker stop base_tmp 102 | docker rm -f base_tmp 103 | docker rmi -f ${repo} 104 | bash docker/action/docker_build 105 | rm -fv docker/assets/arch.tar 106 | 107 | - name: Log in to Docker Hub 108 | uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 109 | with: 110 | username: ${{ env.user }} 111 | password: ${{ secrets.DOCKER_TOKEN }} 112 | - name: docker push 113 | run: | 114 | docker push -a "${repo}" 115 | 116 | - name: docker run (zsh) 117 | if: matrix.tag == 'zsh' || matrix.tag == 'dde' 118 | timeout-minutes: 1 119 | continue-on-error: true 120 | run: bash docker/action/docker_run docker zsh 121 | 122 | - name: docker run 123 | if: matrix.tag != 'zsh' 124 | timeout-minutes: 1 125 | run: bash docker/action/docker_run 126 | 127 | - name: docker export 128 | run: bash docker/action/docker_export 129 | 130 | - name: start zstd 131 | # if: matrix.tag != 'base' 132 | run: bash docker/action/compress_file $zstd_level 133 | 134 | - name: docker build zstd image 135 | # if: matrix.tag != 'base' 136 | run: bash docker/action/build_zstd_image 137 | 138 | - name: set end time 139 | run: | 140 | printf "%s\n" \ 141 | "end_time_normal=$(date -u +%Y-%m-%d_%H-%M)" \ 142 | "end_time=$(date -u --rfc-3339=ns)" \ 143 | >>"$GITHUB_ENV" 144 | 145 | - name: write to toml file 146 | env: 147 | tag: ${{ matrix.tag }} 148 | platform: ${{ matrix.platform }} 149 | run: | 150 | bash docker/action/write_to_toml 151 | 152 | - name: cat i.toml 153 | run: cat i.toml 154 | 155 | - name: gen docker readme 156 | env: 157 | dir: docker/assets 158 | run: | 159 | bash docker/action/gen_docker_readme 160 | cat docker-readme.md 161 | 162 | - name: push README to Dockerhub 163 | uses: christian-korneck/update-container-description-action@v1 164 | env: 165 | DOCKER_USER: ${{ env.user }} 166 | DOCKER_PASS: ${{ secrets.DOCKER_TOKEN }} 167 | with: 168 | destination_container_repo: ${{ env.repo }} 169 | provider: dockerhub 170 | # short_description: "Quickly install ${{ env.Container_name }}" 171 | readme_file: "docker-readme.md" 172 | 173 | - name: copy docker readme.md to home dir 174 | run: | 175 | cp docker-readme.md ~/${Container_name}.md 176 | cp i.toml ~/${Container_name}.toml 177 | 178 | - name: repo(index) 179 | uses: actions/checkout@v2 180 | with: 181 | repository: "2cd/index" 182 | ref: "master" 183 | persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. 184 | fetch-depth: 1 # otherwise, there would be errors pushing refs to the destination repository. 185 | - name: create local changes 186 | run: | 187 | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" 188 | git config --local user.name "github-actions[bot]" 189 | git reset --hard origin/master 190 | git pull --rebase --stat origin master --allow-unrelated-histories 191 | mkdir -p doc/${name} 192 | cp ~/${Container_name}.md ~/${Container_name}.toml doc/${name} 193 | 194 | - name: commit files 195 | run: | 196 | git add . 197 | git commit -m "docs(docker): ${Container_name}.md" -a 198 | - name: push changes 199 | uses: ad-m/github-push-action@master 200 | with: 201 | repository: "2cd/index" 202 | github_token: ${{ secrets.GH_TOKEN }} 203 | branch: "master" 204 | -------------------------------------------------------------------------------- /.github/workflows/ubuntu-dev.yml: -------------------------------------------------------------------------------- 1 | name: build ubuntu-dev images 2 | # begin_time = 2022-05-12 00:04:01+00:00 3 | 4 | on: 5 | push: 6 | branches: [master] 7 | paths: 8 | - ".github/workflows/ubuntu-dev.yml" 9 | 10 | jobs: 11 | job1: 12 | # continue-on-error: true 13 | # needs: [job0, job1] 14 | runs-on: ${{ matrix.os }} 15 | env: 16 | name: ubuntu 17 | user: cake233 18 | platform: ${{ matrix.platform }} 19 | arch: ${{ matrix.arch }} 20 | zstd_level: 19 21 | 22 | strategy: 23 | fail-fast: false 24 | matrix: 25 | include: 26 | - os: ubuntu-latest 27 | tag: kinetic 28 | arch: amd64 29 | platform: "linux/amd64" 30 | 31 | - os: ubuntu-latest 32 | tag: kinetic 33 | arch: arm64 34 | platform: "linux/arm64" 35 | 36 | - os: ubuntu-latest 37 | tag: kinetic 38 | arch: armv7 39 | platform: "linux/arm/v7" 40 | 41 | # repeat... 42 | steps: 43 | - name: set time env 44 | run: | 45 | printf "%s\n" \ 46 | "time_begin=$(date -u --rfc-3339=ns)" \ 47 | "time_today=$(date -u --rfc-3339=date)" \ 48 | >> "$GITHUB_ENV" 49 | 50 | - uses: actions/checkout@v2 51 | with: 52 | # repository: "2moe/xxx" 53 | ref: "master" 54 | fetch-depth: 1 55 | 56 | - name: get architecture 57 | env: 58 | TARGETARCH: ${{ matrix.arch }} 59 | run: bash docker/assets/get_arch 60 | 61 | - name: get container os & set global env 62 | env: 63 | tag: ${{ matrix.tag }} 64 | run: bash docker/action/get_container_os 65 | 66 | - name: set up qemu-user & binfmt 67 | id: qemu 68 | uses: docker/setup-qemu-action@v1 69 | if: matrix.arch != 'amd64' && matrix.arch != 'i386' 70 | with: 71 | image: tonistiigi/binfmt:latest 72 | platforms: ${{ matrix.platform }} 73 | 74 | - name: set container name(notag latest/base) 75 | if: matrix.tag == 'base' || matrix.tag == 'latest' 76 | env: 77 | container: ${{ env.name }}-${{ matrix.arch }} 78 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 79 | 80 | - name: set container name(normal) 81 | if: matrix.tag != 'base' && matrix.tag != 'latest' 82 | env: 83 | container: ${{ env.name }}-${{ matrix.tag }}-${{ matrix.arch }} 84 | run: echo "Container_name=$container" >> "$GITHUB_ENV" 85 | 86 | - name: set repo (global env) 87 | env: 88 | repo: ${{ env.user }}/${{ env.Container_name }} 89 | m_arch: ${{ matrix.arch }} 90 | run: | 91 | printf "%s\n" \ 92 | "repo=$repo" \ 93 | "zsh_repo=${user}/${name}-zsh-${m_arch}" \ 94 | >> "$GITHUB_ENV" 95 | 96 | - name: build container 97 | env: 98 | file: "../${{ env.name }}/${{ matrix.tag }}.dockerfile" 99 | tag: ${{ matrix.tag }} 100 | run: bash docker/action/docker_build 101 | 102 | - name: build base 103 | if: matrix.tag == 'base' 104 | env: 105 | file: "../${{ env.name }}/${{ matrix.tag }}02.dockerfile" 106 | run: | 107 | docker run -d --name base_tmp ${{ env.repo }}:latest sh 108 | docker cp base_tmp:/arch.tar.xz . 109 | xz -dfv arch.tar.xz 110 | mv arch.tar docker/assets 111 | docker stop base_tmp 112 | docker rm -f base_tmp 113 | docker rmi -f ${repo} 114 | bash docker/action/docker_build 115 | rm -fv docker/assets/arch.tar 116 | 117 | - name: Log in to Docker Hub 118 | uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 119 | with: 120 | username: ${{ env.user }} 121 | password: ${{ secrets.DOCKER_TOKEN }} 122 | - name: docker push 123 | run: | 124 | docker push -a "${repo}" 125 | 126 | - name: docker run (zsh) 127 | if: matrix.tag == 'zsh' || matrix.tag == 'dde' 128 | timeout-minutes: 1 129 | continue-on-error: true 130 | run: bash docker/action/docker_run docker zsh 131 | 132 | - name: docker run 133 | if: matrix.tag != 'zsh' 134 | timeout-minutes: 1 135 | run: bash docker/action/docker_run 136 | 137 | - name: docker export 138 | run: bash docker/action/docker_export 139 | 140 | - name: start zstd 141 | # if: matrix.tag != 'base' 142 | run: bash docker/action/compress_file $zstd_level 143 | 144 | - name: docker build zstd image 145 | # if: matrix.tag != 'base' 146 | run: bash docker/action/build_zstd_image 147 | 148 | - name: set end time 149 | run: | 150 | printf "%s\n" \ 151 | "end_time_normal=$(date -u +%Y-%m-%d_%H-%M)" \ 152 | "end_time=$(date -u --rfc-3339=ns)" \ 153 | >>"$GITHUB_ENV" 154 | 155 | - name: write to toml file 156 | env: 157 | tag: ${{ matrix.tag }} 158 | platform: ${{ matrix.platform }} 159 | run: | 160 | bash docker/action/write_to_toml 161 | 162 | - name: cat i.toml 163 | run: cat i.toml 164 | 165 | - name: gen docker readme 166 | env: 167 | dir: docker/assets 168 | run: | 169 | bash docker/action/gen_docker_readme 170 | cat docker-readme.md 171 | 172 | - name: push README to Dockerhub 173 | uses: christian-korneck/update-container-description-action@v1 174 | env: 175 | DOCKER_USER: ${{ env.user }} 176 | DOCKER_PASS: ${{ secrets.DOCKER_TOKEN }} 177 | with: 178 | destination_container_repo: ${{ env.repo }} 179 | provider: dockerhub 180 | # short_description: "Quickly install ${{ env.Container_name }}" 181 | readme_file: "docker-readme.md" 182 | 183 | - name: copy docker readme.md to home dir 184 | run: | 185 | cp docker-readme.md ~/${Container_name}.md 186 | cp i.toml ~/${Container_name}.toml 187 | 188 | - name: repo(index) 189 | uses: actions/checkout@v2 190 | with: 191 | repository: "2cd/index" 192 | ref: "master" 193 | persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. 194 | fetch-depth: 1 # otherwise, there would be errors pushing refs to the destination repository. 195 | - name: create local changes 196 | run: | 197 | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" 198 | git config --local user.name "github-actions[bot]" 199 | git reset --hard origin/master 200 | git pull --rebase --stat origin master --allow-unrelated-histories 201 | mkdir -p doc/${name} 202 | cp ~/${Container_name}.md ~/${Container_name}.toml doc/${name} 203 | 204 | - name: commit files 205 | run: | 206 | git add . 207 | git commit -m "docs(docker): ${Container_name}.md" -a 208 | - name: push changes 209 | uses: ad-m/github-push-action@master 210 | with: 211 | repository: "2cd/index" 212 | github_token: ${{ secrets.GH_TOKEN }} 213 | branch: "master" 214 | #------------------------------------------------ 215 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | tmp 3 | # /test 4 | test 5 | logs 6 | *.log 7 | npm-debug.log* 8 | yarn-debug.log* 9 | yarn-error.log* 10 | lerna-debug.log* 11 | 12 | # Diagnostic reports (https://nodejs.org/api/report.html) 13 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 14 | 15 | # Runtime data 16 | pids 17 | *.pid 18 | *.seed 19 | *.pid.lock 20 | 21 | # Directory for instrumented libs generated by jscoverage/JSCover 22 | lib-cov 23 | 24 | # Coverage directory used by tools like istanbul 25 | coverage 26 | *.lcov 27 | 28 | # nyc test coverage 29 | .nyc_output 30 | 31 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 32 | .grunt 33 | 34 | # Bower dependency directory (https://bower.io/) 35 | bower_components 36 | 37 | # node-waf configuration 38 | .lock-wscript 39 | 40 | # Compiled binary addons (https://nodejs.org/api/addons.html) 41 | build/Release 42 | 43 | # Dependency directories 44 | node_modules/ 45 | jspm_packages/ 46 | 47 | # TypeScript v1 declaration files 48 | typings/ 49 | 50 | # TypeScript cache 51 | *.tsbuildinfo 52 | 53 | # Optional npm cache directory 54 | .npm 55 | 56 | # Optional eslint cache 57 | .eslintcache 58 | 59 | # Microbundle cache 60 | .rpt2_cache/ 61 | .rts2_cache_cjs/ 62 | .rts2_cache_es/ 63 | .rts2_cache_umd/ 64 | 65 | # Optional REPL history 66 | .node_repl_history 67 | 68 | # Output of 'npm pack' 69 | *.tgz 70 | 71 | # Yarn Integrity file 72 | .yarn-integrity 73 | 74 | # dotenv environment variables file 75 | .env 76 | .env.test 77 | 78 | # parcel-bundler cache (https://parceljs.org/) 79 | .cache 80 | 81 | # Next.js build output 82 | .next 83 | 84 | # Nuxt.js build / generate output 85 | .nuxt 86 | dist 87 | 88 | # Gatsby files 89 | .cache/ 90 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 91 | # https://nextjs.org/blog/next-9-1#public-directory-support 92 | # public 93 | 94 | # vuepress build output 95 | .vuepress/dist 96 | 97 | # Serverless directories 98 | .serverless/ 99 | 100 | # FuseBox cache 101 | .fusebox/ 102 | 103 | # DynamoDB Local files 104 | .dynamodb/ 105 | 106 | # TernJS port file 107 | .tern-port 108 | docker/tmp 109 | old 110 | old/ 111 | .github/workflows/hello.yml 112 | .github/workflows/*.yaml 113 | # .github/workflows/test.yml 114 | 115 | # docker/assets/electron/install_apps 116 | # docker/euler/dde.dockerfile 117 | -------------------------------------------------------------------------------- /License: -------------------------------------------------------------------------------- 1 | Copyright 2022 Moe Master 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | -------------------------------------------------------------------------------- /docker/action/build_zstd_image: -------------------------------------------------------------------------------- 1 | set -ex 2 | 3 | tempdir=$(mktemp) 4 | rm -rfv $tempdir 2>/dev/null 5 | mkdir -pv $tempdir 6 | mv -v ${Container_name}.tar.zst "$tempdir"/rootfs.tar.zst 7 | cp -v docker/scratch/zstd.dockerfile "$tempdir"/Dockerfile 8 | cd "$tempdir" 9 | # today=$(date -u +%Y-%m-%d) 10 | 11 | DOCKER_BUILDKIT=1 \ 12 | docker build \ 13 | -t "${repo}:zstd" \ 14 | --platform=${platform} \ 15 | --pull \ 16 | . 17 | 18 | cd - 19 | rm -rfv ${tempdir} 20 | 21 | docker push "${repo}:zstd" 22 | 23 | printf "%s\n" \ 24 | "time_end_sync_1=$(date -u +%H:%M:%S)" \ 25 | >>"$GITHUB_ENV" 26 | -------------------------------------------------------------------------------- /docker/action/compress_file: -------------------------------------------------------------------------------- 1 | set -ex 2 | #--------- 3 | compress_podman_image() { 4 | 5 | Zstd_level=$1 6 | # for i in /tmp/version/*; do 7 | # if [ -r "${i}" ]; then 8 | # sed -i 's@^export @@g' "${i}" 9 | # sed -i "$ r${i}" build.txt 10 | # fi 11 | # done 12 | 13 | printf "%s\n" \ 14 | "time_start_zstd=$(date -u +%H:%M:%S)" \ 15 | >>"$GITHUB_ENV" 16 | 17 | # max 22 18 | zstd \ 19 | -z \ 20 | -${Zstd_level} \ 21 | -T0 \ 22 | -v \ 23 | --ultra \ 24 | "${Container_name}".tar 25 | #调试时使用nice -n 20 zstd -z -5 -T0 -v "${Rootfs_lite_name}".tar 26 | #zstd -z -19 -T0 -v "${Rootfs_lite_name}".tar 27 | #chmod 666 -v "${Rootfs_lite_name}".tar.zst 28 | printf "%s\n" \ 29 | "file_size_tar=$(du -sh ${Container_name}.tar | awk '{print $1}')" \ 30 | "file_size_tar_bytes=$(stat --format=%s ${Container_name}.tar)" \ 31 | "file_size_zst=$(du -sh ${Container_name}.tar.zst | awk '{print $1}')" \ 32 | "file_size_zstd_bytes=$(stat --format=%s ${Container_name}.tar.zst)" \ 33 | "file_sha256=$(sha256sum ${Container_name}.tar.zst | awk '{print $1}')" \ 34 | "time_start_sync_1=$(date -u +%H:%M:%S)" \ 35 | >>"$GITHUB_ENV" 36 | ls -lh 37 | } 38 | compress_podman_image "$@" 39 | -------------------------------------------------------------------------------- /docker/action/docker_build: -------------------------------------------------------------------------------- 1 | set -ex 2 | #--------------------- 3 | workdir="docker/assets" 4 | cd "$workdir" 5 | 6 | if [[ ! -e $file ]]; then 7 | export file="../${name}/gui.dockerfile" 8 | docker pull ${zsh_repo}:zstd 9 | docker run -d --name zsh_tmp ${zsh_repo}:zstd sh 10 | docker cp zsh_tmp:/root/rootfs.tar.zst . 11 | zstd -dfv rootfs.tar.zst 12 | rm rootfs.tar.zst 2>/dev/null 13 | docker stop zsh_tmp 14 | docker rm -f zsh_tmp 15 | docker rmi -f ${zsh_repo}:zstd 16 | fi 17 | 18 | DOCKER_BUILDKIT=1 \ 19 | docker build \ 20 | -t "${repo}:latest" \ 21 | -t "${repo}:${time_today}" \ 22 | -f "$file" \ 23 | --build-arg TAG=${tag} \ 24 | --build-arg OS=${name} \ 25 | --build-arg ARCH=${DEB_ARCH} \ 26 | --build-arg GNU_TARGET=${GNU_TARGET} \ 27 | --build-arg MUSL_TARGET=${MUSL_TARGET} \ 28 | --platform=${platform} \ 29 | --pull \ 30 | . 31 | 32 | case "file" in 33 | *gui.dockerfile) rm -fv rootrfs.tar 2>/dev/null ;; 34 | esac 35 | 36 | printf "%s\n" \ 37 | "time_start_sync_0=$(date -u +%H:%M:%S)" \ 38 | >>"$GITHUB_ENV" 39 | -------------------------------------------------------------------------------- /docker/action/docker_export: -------------------------------------------------------------------------------- 1 | docker_export() { 2 | docker export \ 3 | ${Container_name} \ 4 | >${Container_name}.tar 5 | } 6 | docker_remove() { 7 | docker rm -f "${Container_name}" 8 | docker rmi -f "$repo" 9 | yes | docker system prune 10 | } 11 | docker_export 12 | docker_remove -------------------------------------------------------------------------------- /docker/action/docker_run: -------------------------------------------------------------------------------- 1 | set -ex 2 | #--------- 3 | docker_run_main() { 4 | case $1 in 5 | podman) Container=podman ;; 6 | docker | *) Container=docker ;; 7 | esac 8 | case $2 in 9 | zsh) run_zsh_container ;; 10 | *) run_normal_container ;; 11 | esac 12 | } 13 | run_normal_container() { 14 | mkdir -pv /tmp/version 15 | "${Container}" \ 16 | run \ 17 | -t \ 18 | --name "${Container_name}" \ 19 | -v /tmp/version:/tmp/version \ 20 | "$repo" \ 21 | /bin/bash -c \ 22 | "for i in /root/version.toml /usr/local/etc/tmoe-linux/environment/container.env ;do 23 | if [ -r \${i} ];then 24 | cp -vf \${i} /tmp/version 25 | fi 26 | done" 27 | } 28 | run_zsh_container() { 29 | run_normal_container 30 | docker stop "${Container_name}" 2>/dev/null 31 | docker rm -f "${Container_name}" 32 | "${Container}" \ 33 | run \ 34 | -t \ 35 | --name "${Container_name}" \ 36 | "$repo" \ 37 | /bin/zsh 38 | } 39 | #--------- 40 | docker_run_main "$@" 41 | -------------------------------------------------------------------------------- /docker/action/gen_docker_readme: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | #----------------- 4 | cat_gui_readme() { 5 | cat >docker-readme.md <<-EOF 6 | # ${Container_name} 7 | 8 | ## How to run it? 9 | 10 | \`\`\`sh 11 | # install docker 12 | if [ -z "\$(command -v docker)" ]; then 13 | apt update 14 | apt install docker.io 15 | # If your host architecture is not ${arch}, then install qemu & binfmt-support. 16 | apt install qemu-user-static 17 | fi 18 | 19 | # 5903 is the host vnc port 20 | # 5902 is the container vnc port 21 | # 36080 is the container novnc port 22 | docker run \\ 23 | -it \\ 24 | --shm-size 512m \\ 25 | -p 5903:5902 \\ 26 | -p 36081:36080 \\ 27 | --name ${Container_name} \\ 28 | -e LANG=en_US.UTF-8 \\ 29 | ${repo} 30 | 31 | # optional: bind audio server 32 | # host cmd: pactl load-module module-native-protocol-unix socket=/path/to/src.socket 33 | # docker args: -v /path/to/src.socket:/path/to/target.socket \\ 34 | # -e PULSE_SERVER=unix:/path/to/target.socket 35 | 36 | \`\`\` 37 | 38 | ## How to start vnc? 39 | 40 | \`\`\`sh 41 | docker exex -it ${Container_name} zsh 42 | \`\`\` 43 | 44 | The default user is root. 45 | 46 | After entering the container, you can create a new user, and then switch to it. 47 | 48 | Finally, run the following commands. 49 | 50 | \`\`\`sh 51 | startvnc 52 | \`\`\` 53 | 54 | or 55 | 56 | \`\`\` 57 | startx11vnc 58 | \`\`\` 59 | 60 | or 61 | 62 | \`\`\`sh 63 | novnc 64 | \`\`\` 65 | 66 | Note: 67 | 68 | If you want to use novnc, then open your browser, and type the address: 69 | 70 | \`\`\` 71 | http://localhost:36081 72 | \`\`\` 73 | 74 | If you want to use tiger/x11vnc, then open vnc viewer, then type the address: 75 | 76 | \`\`\` 77 | localhost:5903 78 | \`\`\` 79 | EOF 80 | } 81 | cat_nogui_readme() { 82 | cat >docker-readme.md <<-EOF 83 | # ${Container_name} 84 | 85 | ## How to run it? 86 | 87 | \`\`\`sh 88 | docker run \\ 89 | -it \\ 90 | --name ${Container_name} \\ 91 | ${repo} 92 | \`\`\` 93 | 94 | ## How to exec shell? 95 | 96 | \`\`\`sh 97 | docker exec -it ${Container_name} ${LOGIN_SHELL} 98 | \`\`\` 99 | EOF 100 | } 101 | cat_dotnet_readme() { 102 | cat >docker-readme.md <<-EOF 103 | # ${Container_name} 104 | 105 | ## Example 106 | 107 | \`\`\`sh 108 | TMP="/tmp/hello" 109 | mkdir -p "\$TMP" 110 | 111 | docker run \\ 112 | -t \\ 113 | --rm \\ 114 | -v "\$TMP":/app \\ 115 | -w /app \\ 116 | ${repo} \\ 117 | dotnet new console -o world 118 | 119 | docker run \\ 120 | -t \\ 121 | --rm \\ 122 | -v "\$TMP"/world:/app \\ 123 | -w /app \\ 124 | ${repo} \\ 125 | dotnet run --verbosity 4 126 | \`\`\` 127 | 128 | ## How to exec shell? 129 | 130 | \`\`\`sh 131 | docker run \\ 132 | -it \\ 133 | --name ${Container_name} \\ 134 | ${repo} 135 | \`\`\` 136 | 137 | You can also specify the absolute path to the shell. 138 | 139 | \`\`\`sh 140 | docker exec -it ${Container_name} ${LOGIN_SHELL} 141 | \`\`\` 142 | 143 | EOF 144 | } 145 | 146 | cat_swift_readme() { 147 | cat >docker-readme.md <<-EOF 148 | # ${Container_name} 149 | 150 | ## Example 151 | 152 | \`\`\`sh 153 | TMP="/tmp/hello" 154 | mkdir -p "\$TMP" 155 | 156 | docker run \\ 157 | -t \\ 158 | --rm \\ 159 | -v "\$TMP":/app \\ 160 | -w /app \\ 161 | ${repo} \\ 162 | swift package init --type executable 163 | 164 | docker run \\ 165 | -t \\ 166 | --rm \\ 167 | -v "\$TMP":/app \\ 168 | -w /app \\ 169 | ${repo} \\ 170 | swift run --verbose 171 | \`\`\` 172 | 173 | ## How to exec shell? 174 | 175 | \`\`\`sh 176 | docker run \\ 177 | -it \\ 178 | --security-opt seccomp=unconfined \\ 179 | --name ${Container_name} \\ 180 | ${repo} 181 | \`\`\` 182 | 183 | 184 | \`\`\`sh 185 | docker exec -it ${Container_name} bash 186 | \`\`\` 187 | 188 | EOF 189 | } 190 | 191 | cat_code_readme() { 192 | cat >docker-readme.md <<-EOF 193 | # ${Container_name} 194 | 195 | ## How to build and run it? 196 | 197 | ### Full 198 | 199 | #### create a dockerfile 200 | 201 | \`\`\`sh 202 | _TMP=\$TMPDIR/tmp/code-docker 203 | mkdir -pv \$_TMP 204 | cd \$_TMP 205 | \`\`\` 206 | 207 | 208 | \`\`\`Dockerfile 209 | cat >init.dockerfile<<-'EndOfDockerfile' 210 | $(cat "$dir"/code/init/init.dockerfile) 211 | EndOfDockerfile 212 | \`\`\` 213 | 214 | #### set env 215 | 216 | \`\`\`sh 217 | $(cat "$dir"/code/init/0.set) 218 | \`\`\` 219 | 220 | #### build container 221 | 222 | \`\`\`sh 223 | $(cat "$dir"/code/init/1.build) 224 | \`\`\` 225 | 226 | #### run 227 | 228 | \`\`\`sh 229 | $(cat "$dir"/code/init/2.run) 230 | \`\`\` 231 | 232 | ### Lite 233 | 234 | Do we really have to use such tedious steps as above? 235 | 236 | No! Although the steps are similar to those above, they are much simpler. 237 | 238 | #### copy the necessary folder to the temporary directory 239 | 240 | \`\`\`sh 241 | TMP=\$TMPDIR/tmp/code-docker 242 | mkdir -pv \$TMP 243 | cd \$TMP 244 | docker pull ${repo} 245 | docker run -t --rm -v \$TMP:/tmp/init ${repo} sh -c "cp -fpv /root/* /tmp/init" 246 | \`\`\` 247 | 248 | #### set env 249 | 250 | \`\`\`sh 251 | editor 0.set || nano 0.set 252 | 253 | . 0.set 254 | \`\`\` 255 | 256 | #### build 257 | 258 | \`\`\`sh 259 | . 1.build 260 | \`\`\` 261 | 262 | #### run 263 | 264 | \`\`\` 265 | . 2.run 266 | \`\`\` 267 | 268 | EOF 269 | } 270 | 271 | cat_build_info_title() { 272 | cat >build_info_title.md <<-EOF 273 | 274 | ## ${Container_name}.toml 275 | 276 | \`\`\`toml 277 | EOF 278 | cat build_info_title.md >>docker-readme.md 279 | } 280 | 281 | cat_go_readme() { 282 | cat >go-example.md <<-EOF 283 | 284 | ## example 285 | 286 | \`\`\`sh 287 | docker run \\ 288 | -t \\ 289 | --rm \\ 290 | -v "\$PWD"/go-project:/app \\ 291 | -w /app \\ 292 | -e GOOS=linux \\ 293 | -e CGO_ENABLED=0 \\ 294 | ${repo} \\ 295 | go build -trimpath --ldflags "-s -w -buildid=" -v -o main.bin 296 | \`\`\` 297 | EOF 298 | 299 | cat go-example.md >>docker-readme.md 300 | 301 | printf "%s\n" \ 302 | "" \ 303 | '## readme.go' \ 304 | '```go' \ 305 | >>docker-readme.md 306 | 307 | cat "$dir"/go.go >>docker-readme.md 308 | echo '```' >>docker-readme.md 309 | } 310 | 311 | cat_rust_readme() { 312 | cp -v "$dir"/rust.md ./rs-example.md 313 | # cake233/rust-amd64 314 | sed \ 315 | -e "s@cake233/rust-amd64@${repo}@g" \ 316 | -i rs-example.md 317 | cat rs-example.md >>docker-readme.md 318 | } 319 | 320 | case ${X11} in 321 | false) 322 | case "$name" in 323 | code) cat_code_readme ;; 324 | dotnet) 325 | LOGIN_SHELL="/usr/local/powershell/pwsh" 326 | cat_dotnet_readme 327 | ;; 328 | swift) cat_swift_readme ;; 329 | *) cat_nogui_readme ;; 330 | esac 331 | 332 | case "$name" in 333 | go) cat_go_readme ;; 334 | rust) cat_rust_readme ;; 335 | esac 336 | cat_build_info_title 337 | ;; 338 | true) 339 | cat_gui_readme 340 | cat_build_info_title 341 | ;; 342 | esac 343 | 344 | cat ./i.toml >>docker-readme.md 345 | echo '```' >>docker-readme.md 346 | -------------------------------------------------------------------------------- /docker/action/get_container_os: -------------------------------------------------------------------------------- 1 | set -ex 2 | #--------------------- 3 | case "$name" in 4 | test) 5 | container_os=alpine 6 | case "$tag" in 7 | hello) 8 | container_release=edge 9 | extra_tag=', "test"' 10 | ;; 11 | *) container_release=latest ;; 12 | esac 13 | ;; 14 | alpine) 15 | container_release=edge 16 | DISTRO_OS="alpine-edge" 17 | ;; 18 | arch) 19 | container_release=latest 20 | DISTRO_OS="arch" 21 | ;; 22 | debian) 23 | container_release=sid 24 | DISTRO_OS="debian-sid" 25 | ;; 26 | fedora) 27 | container_release=rawhide 28 | DISTRO_OS="fedora-rawhide" 29 | ;; 30 | kali) 31 | container_release=rolling 32 | DISTRO_OS="kali-rolling" 33 | ;; 34 | manjaro) 35 | container_release=stable 36 | DISTRO_OS="manjaro-stable" 37 | ;; 38 | mongo) 39 | container_os=ubuntu 40 | container_release=lts 41 | ;; 42 | rust) 43 | case "$tag" in 44 | latest) 45 | container_os=debian 46 | container_release=sid 47 | extra_tag=', "nightly", "unstable", "default", "gnu-libc"' 48 | ;; 49 | alpine | *) 50 | container_os=alpine 51 | container_release=edge 52 | extra_tag=', "nightly", "unstable", "minimal", "musl-libc", "musl"' 53 | ;; 54 | esac 55 | ;; 56 | code) 57 | container_os=debian 58 | container_release=sid 59 | extra_tag=', "vsc", "vscode", "web"' 60 | ;; 61 | dotnet) 62 | container_os=arch 63 | container_release=latest 64 | extra_tag=', ".NET", "dotnet-sdk"' 65 | ;; 66 | swift) 67 | container_os=ubuntu 68 | container_release=focal 69 | extra_tag=', "nightly"' 70 | ;; 71 | ubuntu) 72 | case "$tag" in 73 | bionic) 74 | container_release=bionic 75 | extra_tag=', "18.04"' 76 | DISTRO_OS="ubuntu-bionic" 77 | ;; 78 | dde) 79 | container_release=dde 80 | extra_tag=', "stable"' 81 | DISTRO_OS="ubuntu" 82 | ;; 83 | *) 84 | container_release=dev 85 | extra_tag=', "devel"' 86 | DISTRO_OS="ubuntu-dev" 87 | ;; 88 | esac 89 | ;; 90 | esac 91 | 92 | if [[ -z ${container_os} ]]; then 93 | container_os="$name" 94 | fi 95 | 96 | # node-alpine 97 | 98 | if [[ -z ${container_release} ]]; then 99 | # container_os=$tag 100 | case "$tag" in 101 | latest) 102 | container_os=debian 103 | container_release=stable 104 | ;; 105 | alpine) 106 | container_os=alpine 107 | container_release=stable 108 | extra_tag=', "musl-libc", "musl"' 109 | ;; 110 | *) container_release=$tag ;; 111 | esac 112 | fi 113 | 114 | if [[ -z ${DISTRO_OS} ]]; then 115 | DISTRO_OS="${name}" 116 | fi 117 | 118 | DISTRO_NAME="${DISTRO_OS}_${DEB_ARCH}" 119 | 120 | # if [[ -z ${DISTRO_NAME} ]]; then 121 | # case "$tag" in 122 | # latest) 123 | # DISTRO_NAME="${container_os}_${DEB_ARCH}" 124 | # ;; 125 | # alpine) 126 | # DISTRO_NAME="${container_os}-${container_release}_${DEB_ARCH}" 127 | # ;; 128 | # *) 129 | # case ${container_release} in 130 | # latest) DISTRO_NAME="${container_os}_${DEB_ARCH}" ;; 131 | # *) DISTRO_NAME="${container_os}-${container_release}_${DEB_ARCH}" ;; 132 | # esac 133 | # ;; 134 | # esac 135 | # fi 136 | case "$name" in 137 | alpine) LOCALE="C.UTF-8" ;; 138 | *) 139 | case "$tag" in 140 | alpine | musl) LOCALE="C.UTF-8" ;; 141 | *) LOCALE="en_US.UTF-8" ;; 142 | esac 143 | ;; 144 | esac 145 | 146 | case "$tag" in 147 | xfce* | kde* | lxde | lxqt | mate | cutefish | dde | ukui) 148 | X11=true 149 | LOGIN_SHELL=zsh 150 | ;; 151 | zsh) 152 | X11=false 153 | LOGIN_SHELL=zsh 154 | ;; 155 | base) 156 | X11=false 157 | LOGIN_SHELL=sh 158 | ;; 159 | alpine | latest) 160 | X11=false 161 | LOGIN_SHELL=bash 162 | ;; 163 | *) 164 | X11=false 165 | LOGIN_SHELL=sh 166 | ;; 167 | esac 168 | 169 | check_version_of_docker_image() { 170 | # Remote_dir="/share/next/down/share/Tmoe-linux/rootfs" 171 | Netdisk='http://cdn02.tmoe.me/node03' 172 | Distro_path="${DEB_ARCH}/${DISTRO_OS}/${tag}" 173 | 174 | VERSION_01=$(curl -L "${Netdisk}/latest01/${Distro_path}/build.txt") 175 | VERSION_02=$(curl -L "${Netdisk}/latest02/${Distro_path}/build.txt") 176 | Version_01_date=$(printf "%s\n" "$VERSION_01" | grep BUILD_DATE | awk -F '=' '{print $2}') 177 | Version_02_date=$(printf "%s\n" "$VERSION_02" | grep BUILD_DATE | awk -F '=' '{print $2}') 178 | # ROOTFS_FILE 179 | VERSION_01_FILE=$(printf "%s\n" "$VERSION_01" | grep ROOTFS_FILE | awk -F '=' '{print $2}') 180 | VERSION_02_FILE=$(printf "%s\n" "$VERSION_02" | grep ROOTFS_FILE | awk -F '=' '{print $2}') 181 | 182 | VERSION_01_TAG=$(printf "%s\n" "$VERSION_01" | grep BUILD_TAG | awk -F '=' '{print $2}') 183 | VERSION_02_TAG=$(printf "%s\n" "$VERSION_02" | grep BUILD_TAG | awk -F '=' '{print $2}') 184 | 185 | VERSION_01_SHA256=$(printf "%s\n" "$VERSION_01" | grep SHA256SUM | awk -F '=' '{print $2}') 186 | VERSION_02_SHA256=$(printf "%s\n" "$VERSION_02" | grep SHA256SUM | awk -F '=' '{print $2}') 187 | 188 | if [ -z "${Version_01_date}" ]; then 189 | Version_01_date=20211126 190 | fi 191 | 192 | if [ -z "${Version_02_date}" ]; then 193 | Version_02_date=20211128 194 | fi 195 | 196 | if ((Version_01_date < Version_02_date)); then 197 | Rootfs_version=latest01 198 | LAST_VERSION=latest02 199 | LAST_DATE="$Version_02_date" 200 | LAST_FILE="$VERSION_02_FILE" 201 | LAST_TAG="$VERSION_02_TAG" 202 | LAST_SHA256="$VERSION_02_SHA256" 203 | # old_file = current.old.file 204 | OLD_FILE="$VERSION_01_FILE" 205 | OLD_SHA256="$VERSION_01_SHA256" 206 | else 207 | Rootfs_version=latest02 208 | LAST_VERSION=latest01 209 | LAST_DATE="$Version_01_date" 210 | LAST_FILE="$VERSION_01_FILE" 211 | LAST_TAG="$VERSION_01_TAG" 212 | LAST_SHA256="$VERSION_01_SHA256" 213 | OLD_FILE="$VERSION_02_FILE" 214 | OLD_SHA256="$VERSION_02_SHA256" 215 | fi 216 | 217 | printf "%s\n" \ 218 | "v1 = ${Version_01_date}" \ 219 | "v2 = ${Version_02_date}" \ 220 | "ver = ${Rootfs_version}" 221 | case "$name-$tag" in 222 | arch-base) 223 | NODE_1=false 224 | NODE_2=false 225 | NODE_3=false 226 | ;; 227 | *-base) 228 | NODE_1=true 229 | NODE_2=true 230 | NODE_3=true 231 | ;; 232 | *) 233 | NODE_1=true 234 | NODE_2=true 235 | NODE_3=true 236 | ;; 237 | esac 238 | } 239 | check_version_of_docker_image 240 | 241 | printf "%s\n" \ 242 | "container_os=$container_os" \ 243 | "container_release=$container_release" \ 244 | "DISTRO_NAME=${DISTRO_NAME}" \ 245 | "X11=$X11" \ 246 | "LOGIN_SHELL=${LOGIN_SHELL}" \ 247 | "Rootfs_version=${Rootfs_version}" \ 248 | "LAST_VERSION=${LAST_VERSION}" \ 249 | "LAST_DATE=${LAST_DATE}" \ 250 | "LAST_FILE=${LAST_FILE}" \ 251 | "OLD_FILE=${OLD_FILE}" \ 252 | "LAST_TAG=${LAST_TAG}" \ 253 | "OLD_SHA256=${OLD_SHA256}" \ 254 | "LAST_SHA256=${LAST_SHA256}" \ 255 | "LOCALE=${LOCALE}" \ 256 | "NODE_1=${NODE_1}" \ 257 | "NODE_2=${NODE_2}" \ 258 | "NODE_3=${NODE_3}" \ 259 | >>"$GITHUB_ENV" 260 | 261 | if [[ -n $extra_tag ]]; then 262 | printf "%s\n" \ 263 | "extra_tag=$extra_tag" \ 264 | >>"$GITHUB_ENV" 265 | fi 266 | -------------------------------------------------------------------------------- /docker/action/write_to_toml: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | #----------------- 4 | write_to_toml_main() { 5 | write_main_toml 6 | check_toml_time 7 | write_extra_toml_data 8 | } 9 | 10 | write_main_toml() { 11 | case "$tag" in 12 | latest | base) Container_name="${name}_${DEB_ARCH}" ;; 13 | alpine) Container_name="${name}-musl_${DEB_ARCH}" ;; 14 | *) Container_name="${name}-${tag}_${DEB_ARCH}" ;; 15 | esac 16 | 17 | cat >i.toml <<-EOF 18 | [main] 19 | name = "$name" 20 | tag = ["$tag", "$time_today"${extra_tag}] 21 | os = "$container_os" 22 | release = "$container_release" 23 | arch = "$DEB_ARCH" 24 | platform = "$platform" 25 | xorg_or_wayland = $X11 26 | syntax_version = "0.0.0-alpha.4" 27 | 28 | [file] 29 | name = "${Container_name}_${end_time_normal}.tar.zst" 30 | 31 | # This value can be used to verify the integrity of the file 32 | sha256 = "${file_sha256}" 33 | 34 | # zstd: [1-22] 35 | zstd-level = ${zstd_level} 36 | 37 | [file.size] 38 | # Installed size ≈ tar-size 39 | # Installed size is approximately equal to the size of the tar file 40 | tar = "${file_size_tar}" 41 | tar_bytes = ${file_size_tar_bytes} 42 | 43 | # Space occupied ≈ tar-size + zstd-size 44 | # You will need to prepare a large enough space before installation. 45 | zstd = "${file_size_zst}" 46 | zstd_bytes = ${file_size_zstd_bytes} 47 | 48 | [compatibility] 49 | compatible_mode = true 50 | 51 | previous_version = "${LAST_VERSION}" 52 | 53 | # The value is &str, not int 54 | previous_date = "${LAST_DATE}" 55 | previous_tag = "${LAST_TAG}" 56 | previous_file = "${LAST_FILE}" 57 | previous_sha256 = "${LAST_SHA256}" 58 | 59 | current_version = "${Rootfs_version}" 60 | current_date = "$(date -u +%Y%m%d)" 61 | old_file = "${OLD_FILE}" 62 | old_sha256 = "${OLD_SHA256}" 63 | # edition 2021 64 | # DISTRO_NAME=${DISTRO_NAME} 65 | # ROOTFS_FILE=${Container_name}_${end_time_normal}-rootfs.tar.zst 66 | # SHA256SUM=${file_sha256} 67 | # BUILD_DATE=$(date -u +%Y%m%d) 68 | # BUILD_TAG=${time_today} 69 | # STATUS=completed 70 | # VERSION=${Rootfs_version} 71 | # END_TIME=$(date -u +%H:%M) 72 | 73 | [time] 74 | format = "rfc-3339" 75 | zone = "UTC" 76 | date = ${time_today} 77 | begin = ${time_begin} 78 | start-sync_0 = ${time_start_sync_0} 79 | EOF 80 | } 81 | check_toml_time() { 82 | if [ -n "${time_start_zstd}" ]; then 83 | echo "start-zstd = ${time_start_zstd}" >>i.toml 84 | fi 85 | 86 | if [ -n "${time_start_sync_1}" ]; then 87 | echo "start-sync_1 = ${time_start_sync_1}" >>i.toml 88 | fi 89 | 90 | if [ -n "${time_end_sync_1}" ]; then 91 | echo "end-sync_1 = ${time_end_sync_1}" >>i.toml 92 | fi 93 | } 94 | 95 | write_extra_toml_data() { 96 | # printf "%s\n" \ 97 | # "end = ${end_time}" \ 98 | # "" \ 99 | # '[server]' \ 100 | # 'name = "docker"' \ 101 | # "node = 4" \ 102 | # "repo = \"${repo}\"" \ 103 | # "" \ 104 | # '[server.availability]' \ 105 | # "node_1 = false" \o 106 | # "node_2 = false" \ 107 | # "node_3 = false" \ 108 | # "" \ 109 | # '# Environment variables (●>ω<●)' \ 110 | # '[env]' \ 111 | # "LANG = \"${LOCALE}\"" \ 112 | # >>i.toml 113 | 114 | # 注意:測試期間,server.node2 current=true ;server.node3 current=true 115 | # 正式版需要將 current 改爲 false 116 | cat >server_tmp.toml <<-EOF 117 | end = ${end_time} 118 | 119 | [server] 120 | repo = "${repo}" 121 | 122 | [server.node1] 123 | name = "cn" 124 | current = false 125 | previous = false 126 | in_sync = false 127 | split = false 128 | 129 | [server.node2] 130 | name = "tmoe" 131 | current = true 132 | previous = ${NODE_2} 133 | in_sync = false 134 | split = false 135 | 136 | [server.node3] 137 | name = "azure" 138 | current = true 139 | previous = ${NODE_3} 140 | in_sync = false 141 | split = false 142 | 143 | [server.node4] 144 | name = "docker" 145 | current = true 146 | 147 | # Environment variables (●>ω<●) 148 | [env] 149 | LANG = "${LOCALE}" 150 | EOF 151 | cat server_tmp.toml >>i.toml 152 | # for i in /tmp/version/container.env /tmp/version/version.toml; do 153 | # if [ -r "${i}" ]; then 154 | # sed -i 's@^export @@g' "${i}" 155 | # sed -i "$ r${i}" i.toml 156 | # fi 157 | # done 158 | i="/tmp/version/container.env" 159 | if [ -r "$i" ]; then 160 | cat "$i" 161 | sed -E \ 162 | -e "s@export@@g" \ 163 | -e 's@ (.*)=(true)@\1 = \2@g' \ 164 | -e 's@ (.*)=(false)@\1 = \2@g' \ 165 | -e 's@ (.*)=(")@\1 = \2@g' \ 166 | -e "s@ (.*)=(')@\1 = \2@g" \ 167 | -i "${i}" 168 | cat "$i" 169 | sed -i "$ r${i}" i.toml 170 | fi 171 | 172 | i="/tmp/version/version.toml" 173 | if [ -r "$i" ]; then 174 | sed -i "$ r${i}" i.toml 175 | fi 176 | } 177 | write_to_toml_main "$@" 178 | -------------------------------------------------------------------------------- /docker/alpine/gui.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | # FROM cake233/alpine-zsh-${TARGETARCH}${TARGETVARIANT} 4 | FROM scratch 5 | ADD rootfs.tar / 6 | 7 | ENV LANG="C.UTF-8" \ 8 | TMOE_CHROOT=true \ 9 | TMOE_DOCKER=true \ 10 | TMOE_DIR="/usr/local/etc/tmoe-linux" 11 | 12 | RUN apk add zstd 13 | 14 | ARG TAG 15 | ARG OS 16 | ARG ARCH 17 | COPY --chmod=755 gen_tool /tmp 18 | RUN . /tmp/gen_tool 19 | 20 | # auto install gui 21 | ARG AUTO_INSTALL_GUI=true 22 | RUN bash /tmp/install-gui.sh 23 | 24 | # clean 25 | RUN rm -rf \ 26 | /var/cache/apk/* \ 27 | ~/.cache/* \ 28 | /tmp/* \ 29 | ~/.vnc/*passwd 30 | 31 | # expose tcp ports 32 | EXPOSE 5902 36080 33 | 34 | # command: zsh 35 | CMD ["/bin/zsh"] 36 | -------------------------------------------------------------------------------- /docker/alpine/zsh.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} alpine:edge 4 | 5 | ENV TMOE_CHROOT=true \ 6 | TMOE_DOCKER=true \ 7 | TMOE_DIR="/usr/local/etc/tmoe-linux" \ 8 | LANG="C.UTF-8" 9 | 10 | # dependencies 11 | COPY --chmod=755 install_alpine_deps /tmp 12 | RUN . /tmp/install_alpine_deps 13 | 14 | ARG OS 15 | ARG TAG 16 | ARG ARCH 17 | COPY --chmod=755 set_container_txt /tmp 18 | RUN . /tmp/set_container_txt 19 | 20 | # configure zsh 21 | COPY --chmod=755 configure_zsh /tmp 22 | RUN . /tmp/configure_zsh 23 | 24 | CMD [ "/bin/zsh" ] 25 | -------------------------------------------------------------------------------- /docker/amazon/base.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM amazonlinux:latest 4 | 5 | ENV TMOE_CHROOT=true \ 6 | TMOE_DOCKER=true \ 7 | TMOE_DIR="/usr/local/etc/tmoe-linux" \ 8 | LANG="en_US.UTF-8" 9 | 10 | RUN yes | yum install -y --skip-broken dnf || echo "unable to install dnf" 11 | RUN if [ -z $(command -v dnf) ];then ln -svf $(command -v yum) /usr/bin/dnf; fi 12 | 13 | RUN yes | dnf update -y || echo "install failed" 14 | RUN yes | dnf install -y --skip-broken sudo tar xz newt glibc-all-langpacks passwd shadow-utils hostname ca-certificates 15 | RUN mkdir -p /run/dbus 16 | 17 | ARG OS 18 | ARG TAG 19 | ARG ARCH 20 | COPY --chmod=755 gen_tool /tmp 21 | RUN mkdir -p $TMOE_DIR/environment \ 22 | && cd $TMOE_DIR \ 23 | && printf "%s\n" \ 24 | "CONTAINER_TYPE=podman" \ 25 | "CONTAINER_NAME=${OS}_nogui-${TAG}" \ 26 | "ARCH=${ARCH}" \ 27 | >container.txt 28 | 29 | WORKDIR /root 30 | 31 | # clean 32 | RUN rm -rfv \ 33 | ~/.cache/* \ 34 | /tmp/* \ 35 | 2>/dev/null 36 | RUN dnf clean all 37 | 38 | CMD ["bash"] -------------------------------------------------------------------------------- /docker/arch/base.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | # DOCKER_BUILDKIT=1 docker build -t u2 -f ../arch/base.dockerfile --platform=linux/amd64 . 4 | # --build-arg ARCH=amd64 5 | 6 | FROM amd64/alpine 7 | # AS get_arch_rootfs 8 | ARG URL="https://github.com/2moe/build-container/releases/download/v0.0.0-alpha.2/get-lxc_0.0.0.alpha.2_amd64.deb" 9 | 10 | # install curl 11 | RUN apk add dpkg curl 12 | 13 | WORKDIR /tmp 14 | # install deb 15 | RUN curl -Lo get-lxc.deb "${URL}" \ 16 | && dpkg -i --force-architecture ./get-lxc.deb 17 | 18 | # get arch, get url & download file 19 | ARG TARGETARCH 20 | ARG TARGETVARIANT 21 | COPY --chmod=755 get_arch /tmp 22 | RUN . ./get_arch \ 23 | && get-lxc -o arch -c current --var default -a $ARCH --src gh -m us -t 2 -d . -f arch.tar.xz 24 | 25 | RUN mv arch.tar.xz / 26 | 27 | CMD ["/bin/sh"] 28 | -------------------------------------------------------------------------------- /docker/arch/base02.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM scratch 4 | ADD arch.tar / 5 | 6 | ARG TARGETARCH 7 | COPY --chmod=755 arch_key /tmp 8 | # SHELL [ "bash", "-cex" ] 9 | RUN . /tmp/arch_key 10 | 11 | # set locale 12 | COPY --chmod=755 set_locale /tmp 13 | RUN . /tmp/set_locale 14 | ENV LANG en_US.UTF-8 15 | 16 | WORKDIR /root 17 | 18 | # base 19 | RUN pacman -Syyu --needed --noconfirm base base-devel wget curl sudo 20 | 21 | RUN groupadd -f \ 22 | --non-unique \ 23 | runner \ 24 | --gid 1002 \ 25 | && useradd -m \ 26 | --gid 1002 \ 27 | --uid 1002 \ 28 | --non-unique \ 29 | runner \ 30 | && echo "runner ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/runner \ 31 | && printf "%s\n" "root:root" | chpasswd \ 32 | && printf "%s\n" "runner:runner" | chpasswd 33 | 34 | # clean /var/cache/pacman/ 35 | RUN yes | pacman -Scc 36 | 37 | CMD ["bash"] 38 | -------------------------------------------------------------------------------- /docker/arch/gui.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | # FROM cake233/arch-zsh-${TARGETARCH}${TARGETVARIANT} 4 | FROM scratch 5 | ADD rootfs.tar / 6 | 7 | ENV TMOE_CHROOT=true \ 8 | TMOE_DOCKER=true \ 9 | TMOE_DIR="/usr/local/etc/tmoe-linux" \ 10 | LANG="en_US.UTF-8" 11 | 12 | # install man 13 | RUN pacman -Syu --noconfirm --needed \ 14 | man-db \ 15 | man-pages 16 | 17 | # WORKDIR /tmp 18 | 19 | ARG OS 20 | ARG TAG 21 | ARG ARCH 22 | COPY --chmod=755 gen_tool /tmp 23 | RUN . /tmp/gen_tool 24 | 25 | # auto install gui 26 | ARG AUTO_INSTALL_GUI=true 27 | RUN bash /tmp/install-gui.sh 28 | 29 | WORKDIR /root 30 | # remove -Qdtq 31 | RUN pacman -R \ 32 | --noconfirm \ 33 | $(pacman -Qdtq); \ 34 | rm -rfv \ 35 | ~/.vnc/*passwd \ 36 | 2>/dev/null 37 | 38 | # clean /var/cache/pacman/pkg/ 39 | RUN rm -rfv \ 40 | ~/.cache/* \ 41 | /tmp/* \ 42 | 2>/dev/null; \ 43 | yes | pacman -Scc 44 | 45 | # expose tcp ports 46 | EXPOSE 5902 36080 47 | 48 | # command: zsh 49 | CMD ["zsh"] 50 | -------------------------------------------------------------------------------- /docker/arch/zsh.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM cake233/arch-${TARGETARCH}${TARGETVARIANT} 4 | 5 | ENV TMOE_CHROOT=true \ 6 | TMOE_DOCKER=true \ 7 | TMOE_DIR="/usr/local/etc/tmoe-linux" 8 | 9 | # install base-devel 10 | RUN pacman -Syu --noconfirm --needed base base-devel 11 | 12 | # remove runner user & group 13 | RUN if getent group runner; then groupdel -f runner && userdel --remove --force runner ; rm -fv /etc/sudoers.d/runner 2>/dev/null ;fi 14 | 15 | # install dependencies 16 | RUN pacman \ 17 | -S \ 18 | --noconfirm \ 19 | --needed \ 20 | git \ 21 | unzip \ 22 | neofetch \ 23 | iproute \ 24 | zsh \ 25 | libnewt 26 | 27 | RUN pacman -S --noconfirm --needed openssl-1.1 2>/dev/null 28 | 29 | ARG OS 30 | ARG TAG 31 | ARG ARCH 32 | COPY --chmod=755 set_container_txt /tmp 33 | RUN . /tmp/set_container_txt 34 | 35 | # configure zsh 36 | COPY --chmod=755 configure_zsh /tmp 37 | RUN . /tmp/configure_zsh 38 | 39 | # WORKDIR /tmp 40 | # add archlinux mirror repo & install fakeroot-tcp 41 | RUN cd /tmp; \ 42 | cp -fv "${TMOE_DIR}"/git/share/old-version/tools/sources/yay/build_fakeroot ./; \ 43 | chmod a+rx -v build_fakeroot; \ 44 | ./build_fakeroot --add-arch_for_edu-repo; \ 45 | ./build_fakeroot --add-archlinuxcn-repo; \ 46 | ./build_fakeroot --install-paru; \ 47 | ./build_fakeroot --install-fakeroot; \ 48 | ./build_fakeroot --archlinux-repo-mirror; \ 49 | cat /etc/pacman.conf 50 | 51 | WORKDIR /root 52 | 53 | # clean 54 | RUN rm -rfv \ 55 | /var/cache/pacman/pkg/* \ 56 | ~/.cache/* \ 57 | /tmp/* \ 58 | 2>/dev/null; \ 59 | yes | pacman -Scc 60 | 61 | CMD ["zsh"] -------------------------------------------------------------------------------- /docker/assets/arch_key: -------------------------------------------------------------------------------- 1 | case "$TARGETARCH" in 2 | arm*) KEY=archlinuxarm ;; 3 | *) KEY=archlinux ;; 4 | esac 5 | pacman-key --init 6 | pacman-key --populate 7 | pacman-key --populate "$KEY" 8 | -------------------------------------------------------------------------------- /docker/assets/clean_deb_cache: -------------------------------------------------------------------------------- 1 | rm -fv /var/cache/apt/archives/* \ 2 | /var/cache/apt/* \ 3 | /var/mail/* \ 4 | /var/lib/apt/lists/* \ 5 | ~/.cache/* \ 6 | 2>/dev/null 7 | 8 | dpkg_reconfigure_deb_frontend() { 9 | # debconf-show debconf 10 | echo "debconf debconf/priority select low" | debconf-set-selections 11 | echo "debconf debconf/frontend select Dialog" | debconf-set-selections 12 | DEBIAN_FRONTEND=noninteractive dpkg-reconfigure debconf 13 | } 14 | 15 | dpkg_reconfigure_deb_frontend 16 | apt clean 2>/dev/null 17 | -------------------------------------------------------------------------------- /docker/assets/code.js: -------------------------------------------------------------------------------- 1 | //node README.js 2 | // ADD code.js /root/README.js 3 | console.log("You can type code or code-server to start it."); 4 | console.log("Type pkill node to stop it."); 5 | console.log("If you want to modify the config, then type the following command."); 6 | console.log("nano ~/.config/code-server/config.yaml"); -------------------------------------------------------------------------------- /docker/assets/code/init/0.set: -------------------------------------------------------------------------------- 1 | # en_US, zh_CN, es_ES, de_DE, etc. 2 | # _LC=en_US 3 | _LC=${LANG%.*} 4 | 5 | # If LANG or _LC is empty, then _LC=C 6 | _LC=${_LC:-C} 7 | 8 | _UID=$(id -u) 9 | # It is not recommended or necessary to use root(uid=0). 10 | case "$_UID" in 11 | 0) 12 | _UID=1002 13 | _GID=1002 14 | _USER=moe 15 | ;; 16 | *) 17 | _GID=$(id -g) 18 | _USER=$(whoami) 19 | ;; 20 | esac 21 | _GROUP="$_USER" 22 | 23 | _Root_passwd="123456780_this_password_is_too_simple" 24 | _My_passwd="0_123_456_789-Oh-No-My_password_can_not_be_that_simple." 25 | _Code_passwd="You_should_set_a_complex_password_and_if_you_need_to_expose_the_service_to_the_internet_then_you_can_use_the_nginx_reverse_proxy-code:8080" 26 | 27 | if [ -n "$(command -v pwgen)" ]; then 28 | _Code_passwd=$(pwgen -snc1 200) 29 | elif [ -n "$(command -v apt-get)" ];then 30 | sudo apt update 31 | sudo apt install pwgen -y 32 | _Code_passwd=$(pwgen -snc1 300) 33 | fi 34 | 35 | _Code_image_tag="code-image" 36 | 37 | export _LC _UID _GID _USER _GROUP _Root_passwd _My_passwd _Code_passwd _Code_image_tag 38 | -------------------------------------------------------------------------------- /docker/assets/code/init/1.build: -------------------------------------------------------------------------------- 1 | docker build \ 2 | --pull \ 3 | -f ./init.dockerfile \ 4 | --build-arg _LC="$_LC" \ 5 | --build-arg _USER="$_USER" \ 6 | --build-arg _GROUP="$_GROUP" \ 7 | --build-arg _UID="$_UID" \ 8 | --build-arg _GID="$_GID" \ 9 | --build-arg _ROOT_PASSWD="$_Root_passwd" \ 10 | --build-arg _MY_PASSWD="$_My_passwd" \ 11 | --build-arg _CODE_PASSWD="$_Code_passwd" \ 12 | -t "$_Code_image_tag" \ 13 | . 14 | -------------------------------------------------------------------------------- /docker/assets/code/init/2.run: -------------------------------------------------------------------------------- 1 | # test1 2 | 3 | _Host_tcp_port=18080 4 | # docker run -it --rm -p "$_Host_tcp_port":8080 "$_Code_image_tag" bash 5 | 6 | # test2 7 | _Shared_dir="$HOME/.local/share/code-shared-dir" 8 | mkdir -pv "$_Shared_dir/hello-world" 9 | 10 | docker run \ 11 | --restart always \ 12 | --name code \ 13 | -v "$_Shared_dir":"/home/$_USER/shared_dir" \ 14 | -p "$_Host_tcp_port":8080 \ 15 | "$_Code_image_tag" & 16 | 17 | sleep 3 18 | 19 | docker exec -t code sh -c 'bat -pp ~/.config/code-server/config.yaml' 20 | 21 | # Get ip(v4) address 22 | # ip -4 a 23 | # Open your browser, and type the address 24 | # ip:port 25 | # For example, assume your ip is 172.x.x.y, port is 18080, then the address is http://172.x.x.y:18080 26 | -------------------------------------------------------------------------------- /docker/assets/code/init/init.dockerfile: -------------------------------------------------------------------------------- 1 | FROM cake233/code-amd64:latest 2 | 3 | ARG _LC 4 | ENV LANG="${_LC}.UTF-8" \ 5 | TZ=UTC 6 | 7 | RUN localedef \ 8 | -c \ 9 | -i "$_LC" \ 10 | -f UTF-8 \ 11 | -A /usr/share/locale/locale.alias \ 12 | ${_LC}.UTF-8 13 | 14 | # create a new group & user 15 | ARG _GROUP 16 | ARG _GID 17 | RUN groupadd --non-unique \ 18 | --force \ 19 | --gid "$_GID" \ 20 | "$_GROUP" 21 | 22 | ARG _USER 23 | ARG _UID 24 | RUN useradd --non-unique \ 25 | --gid "$_GID" \ 26 | --uid "$_UID" \ 27 | --groups sudo \ 28 | --create-home \ 29 | --shell /bin/bash \ 30 | "$_USER" 31 | 32 | # change password 33 | ARG _ROOT_PASSWD 34 | ARG _MY_PASSWD 35 | RUN printf "%s\n" \ 36 | "root":"$_ROOT_PASSWD" \ 37 | "$_USER":"$_MY_PASSWD" | chpasswd - 38 | 39 | ARG MY_HOME="/home/$_USER" 40 | 41 | WORKDIR "$MY_HOME" 42 | 43 | ARG CODE_DIR=".config/code-server" 44 | ARG CODE_CONF="$CODE_DIR/config.yaml" 45 | ARG _CODE_PASSWD 46 | 47 | RUN code-server --version \ 48 | && cat "$HOME/$CODE_CONF" \ 49 | && sed -E \ 50 | -e "s@(bind-addr:).*@\1 0.0.0.0:8080@" \ 51 | -e "s@(password:).*@\1 $_CODE_PASSWD@" \ 52 | -i "$HOME/$CODE_CONF" \ 53 | && mkdir -pv "$MY_HOME/$CODE_DIR" \ 54 | && cp -v "$HOME/$CODE_CONF" "$MY_HOME/$CODE_CONF" \ 55 | && chown -Rv "$_UID":"$_GID" "$MY_HOME/.config" \ 56 | && cat "$HOME/$CODE_CONF" 57 | 58 | USER "$_UID":"$_GID" 59 | 60 | CMD ["code-server"] 61 | -------------------------------------------------------------------------------- /docker/assets/configure_zsh: -------------------------------------------------------------------------------- 1 | set -ex 2 | #------------ 3 | # configure zsh 4 | URL="https://github.com/2cd/zsh/raw/master/zsh.sh" 5 | cd /tmp || cd ~ 6 | curl -LO "$URL" || exit 1 7 | bash zsh.sh --tmoe_container_auto_configure 8 | 9 | URL="https://github.com/2moe/tmoe-linux" 10 | # set configuration 11 | cd "${TMOE_DIR}" 12 | git clone \ 13 | -b master \ 14 | --depth=1 \ 15 | "$URL" git 16 | 17 | cd /root 18 | printf "%s\n" \ 19 | "" \ 20 | '[version]' \ 21 | "ldd = '$(ldd --version 2>&1 | head -n 2 | grep -vi copyright | sed ":a;N;s/\n/ /g;ta")'" \ 22 | "zsh = '$(zsh --version)'" \ 23 | >version.toml 24 | cat version.toml 25 | -------------------------------------------------------------------------------- /docker/assets/electron/install_apps: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | install_electron() { 3 | case ${ARCH} in 4 | amd64|x86_64) ARCH_TYPE_02='x64' ;; 5 | arm64*|aarch64) ARCH_TYPE_02=arm64 ;; 6 | armhf|armv7|arm) ARCH_TYPE_02='armv7l' ;; 7 | i386|386) ARCH_TYPE_02='ia32' ;; 8 | esac 9 | dnf install -y --skip-broken libXScrnSaver unzip 10 | [[ -n ${ELECTRON_VERSION} ]] || ELECTRON_VERSION=18.0.4 11 | ELECTRON_ZIP_FILE="/tmp/electron.zip" 12 | # https://github.com/electron/electron/releases/download/v18.1.0/electron-v18.1.0-linux-arm64.zip 13 | URL=https://github.com/electron/electron/releases/download/v${ELECTRON_VERSION}/electron-v${ELECTRON_VERSION}-linux-${ARCH_TYPE_02}.zip 14 | echo $URL 15 | curl -Lo ${ELECTRON_ZIP_FILE} $URL || exit 1 16 | mkdir -p /opt/electron 17 | cd /opt/electron 18 | unzip -o ${ELECTRON_ZIP_FILE} 19 | rm -fv ${ELECTRON_ZIP_FILE} 20 | chmod a+rx -v electron 21 | 22 | printf "%s\n" "${GREEN}find ${YELLOW}${DOWNLOAD_PATH} ${BLUE}-type d -print${RESET} | ${GREEN}xargs ${BLUE}chmod -v a+rx${RESET}" 23 | find /opt/electron -type d -print | xargs chmod -v a+rx 24 | find /opt/electron -type f -print | xargs chmod a+r 25 | chmod -v 755 /opt/electron 26 | chmod -v 4755 /opt/electron/chrome-sandbox 27 | } 28 | 29 | download_tmoe_electron_app() { 30 | PKG_URL="https://packages.tmoe.me" 31 | DOWNLOAD_PATH="/tmp/.${DEPENDENCY_01}_TEMP_FOLDER" 32 | APPS_LNK_DIR=/usr/share/applications 33 | [ -e "${DOWNLOAD_PATH}" ] && rm -rvf ${DOWNLOAD_PATH} 34 | [ ! -e /opt ] && mkdir -pv /opt 35 | mkdir -p ${DOWNLOAD_PATH} 36 | cd ${DOWNLOAD_PATH} 37 | curl -Lo app.tar.xz "${PKG_URL}/apps/${DEPENDENCY_01}/app.tar.xz" || echo "Download app.tar.xz failed" 38 | 39 | cd ${DOWNLOAD_PATH} 40 | tar -Jxvf app.tar.xz -C /opt 41 | if [ -n "${OPT_APP_VERSION_TXT}" ]; then 42 | [ -e ${OPT_APP_VERSION_TXT} ] || printf "%s\n" "${THE_LATEST_DEB_FILE}" >${OPT_APP_VERSION_TXT} 43 | fi 44 | if [ -e "/opt/${DEPENDENCY_01}" ]; then 45 | printf "%s\n" "${GREEN}find ${YELLOW}/opt/${DEPENDENCY_01} ${BLUE}-type d -print${RESET} | ${GREEN}xargs ${BLUE}chmod -v a+rx${RESET}" 46 | chmod -Rv 755 /opt/${DEPENDENCY_01}/usr/bin/ 2>/dev/null 47 | find /opt/${DEPENDENCY_01} -type d -print | xargs chmod -v a+rx 48 | find /opt/${DEPENDENCY_01} -type f -print | xargs chmod a+r 49 | cd /opt/${DEPENDENCY_01} 50 | pwd 51 | # cp -vf .${APPS_LNK_DIR}/${DEPENDENCY_01}.desktop ${APPS_LNK_DIR} 52 | else 53 | cd /tmp 54 | fi 55 | rm -rfv ${DOWNLOAD_PATH} 56 | } 57 | 58 | install_electron_apps(){ 59 | for DEPENDENCY_01 in obsidian electron-netease-cloud-music bilibili-web listen1 yesplaymusic; do 60 | download_tmoe_electron_app 61 | done 62 | } 63 | 64 | install_electron 65 | install_electron_apps -------------------------------------------------------------------------------- /docker/assets/gen_tool: -------------------------------------------------------------------------------- 1 | set -ex 2 | 3 | cd "${TMOE_DIR}" 4 | printf "%s\n" \ 5 | "CONTAINER_TYPE=podman" \ 6 | "CONTAINER_NAME=${OS}_gui-${TAG}" \ 7 | "ARCH=${ARCH}" \ 8 | >container.txt 9 | 10 | cp -fv git/share/old-version/tools/app/tool /tmp/docker_tool 11 | 12 | cd /tmp 13 | sed -i 's@*) #main@2333)@g' docker_tool 14 | 15 | printf "%s\n" \ 16 | "git -C /usr/local/etc/tmoe-linux/git reset --hard" \ 17 | "git -C /usr/local/etc/tmoe-linux/git pull --rebase --allow-unrelated-histories" \ 18 | "source /tmp/docker_tool -install-deps" \ 19 | "cd /usr/local/etc/tmoe-linux/git/share/old-version/tools/gui/" \ 20 | "source gui --auto-install-gui-${TAG}" \ 21 | >install-gui.sh 22 | 23 | cd /root 24 | printf "%s\n" \ 25 | "" \ 26 | '[port]' \ 27 | "tcp = [5902, 36080]" \ 28 | >>version.toml 29 | cat version.toml 30 | -------------------------------------------------------------------------------- /docker/assets/get_arch: -------------------------------------------------------------------------------- 1 | set -ex 2 | #----------------- 3 | # get_docker_arch(){ 4 | # local target_arch="${TARGETARCH}" 5 | # local target_variant="${TARGETVARIANT}" 6 | # } 7 | 8 | DOCKER_ARCH="${TARGETARCH}${TARGETVARIANT}" 9 | 10 | case "$DOCKER_ARCH" in 11 | amd64) 12 | ARCH=amd64 13 | GNU_TARGET="x86_64-unknown-linux-gnu" 14 | MUSL_TARGET="x86_64-unknown-linux-musl" 15 | ;; 16 | 386 | i*86) 17 | ARCH=i386 18 | GNU_TARGET="i686-unknown-linux-gnu" 19 | MUSL_TARGET="i686-unknown-linux-musl" 20 | ;; 21 | arm64*) 22 | ARCH=arm64 23 | GNU_TARGET="aarch64-unknown-linux-gnu" 24 | MUSL_TARGET="aarch64-unknown-linux-musl" 25 | ;; 26 | armv7*) 27 | ARCH=armhf 28 | GNU_TARGET="armv7-unknown-linux-gnueabihf" 29 | MUSL_TARGET="armv7-unknown-linux-musleabihf" 30 | ;; 31 | armv5*) 32 | ARCH=armel 33 | GNU_TARGET="armv5te-unknown-linux-gnueabi" 34 | # no musl? 35 | MUSL_TARGET="armv5te-unknown-linux-musleabi" 36 | ;; 37 | armv6*) 38 | ARCH=armel 39 | # armv6 40 | GNU_TARGET="arm-unknown-linux-gnueabi" 41 | MUSL_TARGET="arm-unknown-linux-musleabi" 42 | ;; 43 | mips64*) 44 | ARCH=mips64el 45 | GNU_TARGET="mips64el-unknown-linux-gnuabi64" 46 | MUSL_TARGET="mips64el-unknown-linux-muslabi64" 47 | ;; 48 | mips*) 49 | ARCH=mipsel 50 | GNU_TARGET="mipsel-unknown-linux-gnu" 51 | MUSL_TARGET="mipsel-unknown-linux-musl" 52 | ;; 53 | ppc64*) 54 | ARCH=ppc64el 55 | GNU_TARGET="powerpc64le-unknown-linux-gnu" 56 | # no musl 57 | MUSL_TARGET="powerpc64le-unknown-linux-musl" 58 | ;; 59 | s390*) 60 | ARCH=s390x 61 | GNU_TARGET="s390x-unknown-linux-gnu" 62 | # no musl 63 | MUSL_TARGET="s390x-unknown-linux-musl" 64 | ;; 65 | riscv64*) 66 | ARCH=riscv64 67 | GNU_TARGET="riscv64gc-unknown-linux-gnu" 68 | # no musl 69 | MUSL_TARGET="riscv64gc-unknown-linux-musl" 70 | ;; 71 | esac 72 | export ARCH DOCKER_ARCH 73 | 74 | if [ -n "$GITHUB_ENV" ]; then 75 | printf "%s\n" \ 76 | "DEB_ARCH=${ARCH}" \ 77 | "GNU_TARGET=${GNU_TARGET}" \ 78 | "MUSL_TARGET=${MUSL_TARGET}" \ 79 | >>"$GITHUB_ENV" 80 | fi 81 | -------------------------------------------------------------------------------- /docker/assets/go.go: -------------------------------------------------------------------------------- 1 | // go run readme.go 2 | package main 3 | 4 | import "fmt" 5 | 6 | func main() { 7 | var ( 8 | country, proxy_site string 9 | ) 10 | 11 | country = "China" 12 | proxy_site = "https://goproxy.cn" 13 | fmt.Printf("If you live in\x1b[%dm %v. \x1b[0m\n", 32, country) 14 | fmt.Printf("Then you can run the following\x1b[%dm commands. \x1b[0m\n", 31) 15 | 16 | fmt.Println("go env -w GO111MODULE=on") 17 | fmt.Printf("go env -w GOPROXY=%v,direct\n", proxy_site) 18 | } 19 | -------------------------------------------------------------------------------- /docker/assets/install_alpine_deps: -------------------------------------------------------------------------------- 1 | set -ex 2 | apk update 3 | apk upgrade 4 | apk add \ 5 | sudo \ 6 | tar \ 7 | grep \ 8 | curl \ 9 | wget \ 10 | bash \ 11 | tzdata \ 12 | newt \ 13 | shadow 14 | -------------------------------------------------------------------------------- /docker/assets/install_cutefish: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #----------------- 3 | install_deps() { 4 | apt update 5 | yes | DEBIAN_FRONTEND=noninteractive apt install -y \ 6 | automake \ 7 | autotools-dev \ 8 | breeze-dev \ 9 | breeze-icon-theme-rcc \ 10 | build-essential \ 11 | cmake \ 12 | cryptsetup \ 13 | curl \ 14 | debhelper \ 15 | devscripts \ 16 | equivs \ 17 | extra-cmake-modules \ 18 | gettext \ 19 | git \ 20 | gcc \ 21 | g++ \ 22 | kirigami2-dev \ 23 | kwin-dev \ 24 | libboost-python-dev \ 25 | libcanberra-dev \ 26 | libcap-dev \ 27 | libcrypt-dev \ 28 | libdbus-1-dev \ 29 | libdbusmenu-qt5-dev \ 30 | libecm1-dev \ 31 | libfftw3-dev \ 32 | libfreetype6-dev \ 33 | libfontconfig1-dev \ 34 | libicu-dev \ 35 | libkdecorations2-dev \ 36 | libkf5config-dev \ 37 | libkf5bluezqt-dev \ 38 | libkf5codecs-dev \ 39 | libkf5coreaddons-dev \ 40 | libkf5configwidgets-dev \ 41 | libkf5doctools-dev \ 42 | libkf5filemetadata-dev \ 43 | libkf5globalaccel-dev \ 44 | libkf5guiaddons-dev \ 45 | libkf5i18n-dev \ 46 | libkf5iconthemes-dev \ 47 | libkf5idletime-dev \ 48 | libkf5kio-dev \ 49 | libkf5networkmanagerqt-dev \ 50 | libkf5package-dev \ 51 | libkf5parts-dev \ 52 | libkf5qqc2desktopstyle-dev \ 53 | libkf5service-dev \ 54 | libkf5syntaxhighlighting-dev \ 55 | libkf5screen-dev \ 56 | libkf5solid-dev \ 57 | libkf5widgetsaddons-dev \ 58 | libkf5windowsystem-dev \ 59 | libkpmcore-dev \ 60 | libmpv-dev \ 61 | libpam0g-dev \ 62 | libparted-dev \ 63 | libpolkit-agent-1-dev \ 64 | libpolkit-qt5-1-dev \ 65 | libpulse-dev \ 66 | libpwquality-dev \ 67 | libqapt-dev \ 68 | libqqc2breezestyle-dev \ 69 | libqt5x11extras5-dev \ 70 | libqt5xdg-dev \ 71 | libqt5sensors5-dev \ 72 | libqt5svg5-dev \ 73 | libqt5webkit5-dev \ 74 | libsm-dev \ 75 | libsystemd-dev \ 76 | libx11-dev \ 77 | libx11-xcb-dev \ 78 | libxcb1-dev \ 79 | libxcb-composite0-dev \ 80 | libxcb-damage0-dev \ 81 | libxcb-dpms0-dev \ 82 | libxcb-dri2-0-dev \ 83 | libxcb-dri3-dev \ 84 | libxcb-ewmh-dev \ 85 | libxcb-glx0-dev \ 86 | libxcb-icccm4-dev \ 87 | libxcb-image0-dev \ 88 | libxcb-keysyms1-dev \ 89 | libxcb-randr0-dev \ 90 | libxcb-record0-dev \ 91 | libxcb-shape0-dev \ 92 | libxcb-shm0-dev \ 93 | libxcb-util0-dev \ 94 | libxcb-util-dev \ 95 | libxcb-xfixes0-dev \ 96 | libxcursor-dev \ 97 | libxi-dev \ 98 | libxtst-dev \ 99 | libyaml-cpp-dev \ 100 | lintian \ 101 | modemmanager-qt-dev \ 102 | os-prober \ 103 | pkg-config \ 104 | pkg-kde-tools \ 105 | policykit-1 \ 106 | python3-dev \ 107 | qml-module-org-kde-kwindowsystem \ 108 | qml-module-qt-labs-platform \ 109 | qml-module-qt-labs-settings \ 110 | qml-module-qtqml \ 111 | qml-module-qtquick-controls2 \ 112 | qml-module-qtquick-dialogs \ 113 | qml-module-qtquick-layouts \ 114 | qml-module-qtquick-privatewidgets \ 115 | qml-module-qtquick-window2 \ 116 | qml-module-qtquick-shapes \ 117 | qml-module-qtquick2 \ 118 | qtbase5-dev \ 119 | qtbase5-private-dev \ 120 | qtdeclarative5-dev \ 121 | qtquickcontrols2-5-dev \ 122 | qttools5-dev \ 123 | qttools5-dev-tools \ 124 | sound-theme-freedesktop \ 125 | xserver-xorg-dev \ 126 | xserver-xorg-input-libinput-dev \ 127 | xserver-xorg-input-synaptics-dev 128 | } 129 | make_dir() { 130 | mkdir -p ~/cutefish 131 | cd ~/cutefish || exit 1 132 | } 133 | 134 | git_clone_and_build_deb() { 135 | for i in fishui libcutefish qt-plugins kwin-plugins core daemon filemanager dock screenshot terminal launcher settings debinstaller icons gtk-themes statusbar updator screenlocker calculator videoplayer sddm-theme appmotor wallpapers calamares texteditor; do 136 | git clone --depth=1 --recursive https://github.com/cutefishos/${i} 137 | cd $i || exit 1 138 | mk-build-deps -i -t "apt-get --yes" -r 139 | dpkg-buildpackage -b -uc -us 140 | cd .. || exit 1 141 | done 142 | } 143 | 144 | main() { 145 | install_deps 146 | make_dir 147 | git_clone_and_build_deb 148 | } 149 | 150 | main "$@" 151 | -------------------------------------------------------------------------------- /docker/assets/install_deb_deps: -------------------------------------------------------------------------------- 1 | set -ex 2 | #------------------- 3 | # upgrade 4 | apt update 5 | apt dist-upgrade -y 6 | dpkg --configure -a 7 | 8 | apt install \ 9 | -y \ 10 | sudo \ 11 | locales \ 12 | curl \ 13 | whiptail \ 14 | eatmydata \ 15 | procps \ 16 | apt-utils 17 | 18 | apt install \ 19 | -y \ 20 | --no-install-recommends \ 21 | neofetch 22 | -------------------------------------------------------------------------------- /docker/assets/nginx.txt: -------------------------------------------------------------------------------- 1 | //README.txt 2 | If you are not root, please use a port above 1024. 3 | Please change the default port 80 and 443. -------------------------------------------------------------------------------- /docker/assets/node.js: -------------------------------------------------------------------------------- 1 | //node README.js 2 | var country = "China"; 3 | console.log('\x1B[36m%s\x1B[0m \x1B[31m%s\x1B[0m.', "If you live in", country); 4 | console.log("%s \x1B[32m%s\x1B[0m.","Then you can run the following", "commands"); 5 | console.log("\x1B[33m%s\n%s\n%s\n\x1B[0m", "npm config set registry https://repo.huaweicloud.com/repository/npm/", "npm config set disturl https://repo.huaweicloud.com/nodejs", "npm config set electron_mirror https://repo.huaweicloud.com/electron/"); 6 | -------------------------------------------------------------------------------- /docker/assets/rust.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Example 4 | 5 | ### set env 6 | 7 | ```sh 8 | _UID="$(id -u)" || _UID=0 9 | _GID="$(id -g)" || _GID=0 10 | ``` 11 | 12 | ### create a new project 13 | 14 | If "tmp/hello" already exists in the current directory, it can be skipped. 15 | 16 | ```sh 17 | mkdir -p tmp 18 | 19 | docker run \ 20 | -t \ 21 | --rm \ 22 | -u "$_UID":"$_GID" \ 23 | -v "$PWD"/tmp:/app \ 24 | -w /app \ 25 | cake233/rust-amd64 \ 26 | cargo new hello 27 | ``` 28 | 29 | ### cargo build 30 | 31 | ```sh 32 | docker run \ 33 | -t \ 34 | --rm \ 35 | -u "$_UID":"$_GID" \ 36 | -v "$PWD"/tmp/hello:/app \ 37 | -w /app \ 38 | cake233/rust-amd64 \ 39 | cargo b --release 40 | ``` 41 | 42 | ### check file 43 | 44 | ```sh 45 | FILE="tmp/hello/target/release/hello" 46 | 47 | file "$FILE" 48 | ldd "$FILE" 49 | ``` 50 | -------------------------------------------------------------------------------- /docker/assets/set_container_txt: -------------------------------------------------------------------------------- 1 | set -x 2 | 3 | printf "%s\n" "root:root" | chpasswd 4 | ln -svf /usr/share/zoneinfo/UTC /etc/localtime 5 | 6 | set_systemd_container() { 7 | mkdir -p /run/systemd 8 | printf "%s\n" \ 9 | "docker" \ 10 | >/run/systemd/container 11 | } 12 | 13 | get_dpkg_arch() { 14 | [ -e "/bin/dpkg" ] && { 15 | dpkg --print-architecture 16 | return 0 17 | } 18 | 19 | case $(uname -m) in 20 | amd64 | x86_64) echo amd64 ;; 21 | armv7* | armv8l) echo armhf ;; 22 | aarch64 | arm64 | armv9* | armv8*) echo arm64 ;; 23 | pcc64*) echo ppc64el ;; 24 | mips64*) echo misp64el ;; 25 | misp*) echo mipsel ;; 26 | s390*) echo s390x ;; 27 | riscv64*) echo riscv64 ;; 28 | *) echo unknown ;; 29 | esac 30 | } 31 | 32 | if [ -n "$(command -v ldd)" ]; then 33 | if ldd --version 2>&1 | grep -q 'musl'; then 34 | echo "skipped." 35 | else 36 | set_systemd_container 37 | fi 38 | fi 39 | 40 | mkdir -pv "$TMOE_DIR" 41 | cd "$TMOE_DIR" || exit 1 42 | printf "%s\n" \ 43 | "CONTAINER_TYPE=podman" \ 44 | "CONTAINER_NAME=${OS}_nogui-${TAG}" \ 45 | "ARCH=${ARCH}" \ 46 | >container.txt 47 | mkdir -p environment 48 | -------------------------------------------------------------------------------- /docker/assets/set_locale: -------------------------------------------------------------------------------- 1 | locale_def_utf8() { 2 | lang=$1 3 | # lang=en_US 4 | localedef \ 5 | -c \ 6 | -i "${lang}" \ 7 | -f UTF-8 \ 8 | -A /usr/share/locale/locale.alias \ 9 | "${lang}".UTF-8 10 | # -c(--force), -v(--verbose), -f(--charmap), -i(--inputfile) 11 | locale -a 12 | } 13 | 14 | if [ -n "$(command -v localedef)" ]; then 15 | locale_def_utf8 en_US 16 | else 17 | echo ERROR, failed to generate locale. 18 | fi 19 | -------------------------------------------------------------------------------- /docker/assets/swift/download_swift: -------------------------------------------------------------------------------- 1 | case ${ARCH} in 2 | amd64) 3 | OS_ARCH_SUFFIX="" 4 | ;; 5 | arm64) 6 | OS_ARCH_SUFFIX=-aarch64 7 | # ADDITIONAL_TAR_OPTIONS="" 8 | ;; 9 | esac 10 | ADDITIONAL_TAR_OPTIONS="--strip-components=1" 11 | 12 | # https://github.com/apple/swift-docker/blob/main/nightly-main/ubuntu/20.04/buildx/Dockerfile 13 | OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER.$OS_MIN_VER$OS_ARCH_SUFFIX 14 | PLATFORM_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER$OS_ARCH_SUFFIX" 15 | echo "${PLATFORM_WEBROOT}/latest-build.yml" 16 | BUILD_YAML=$(curl -sL ${PLATFORM_WEBROOT}/latest-build.yml) 17 | 18 | export $(printf "%s\n" "$BUILD_YAML" | grep 'download:' | sed 's/:[^:\/\/]/=/g') 19 | export $(printf "%s\n" "$BUILD_YAML" | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') 20 | export DOWNLOAD_DIR=$(echo $download | sed "s/-${OS_VER}.tar.gz//g") 21 | echo $DOWNLOAD_DIR >.swift_tag 22 | 23 | # - Download the Swift toolchain 24 | export GNUPGHOME="$(mktemp -d)" 25 | curl -fsSL ${PLATFORM_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz 26 | 27 | # - Unpack the toolchain, set libs permissions, and clean up. 28 | tar -xzf latest_toolchain.tar.gz --directory / ${ADDITIONAL_TAR_OPTIONS} 29 | chmod -R o+r /usr/lib/swift 30 | rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz 2>/dev/null 31 | -------------------------------------------------------------------------------- /docker/assets/ubuntu/devel: -------------------------------------------------------------------------------- 1 | set_new_os_release() { 2 | cat >$RELEASE<<-'EOF' 3 | PRETTY_NAME="Ubuntu Kinetic Kudu (development branch)" 4 | NAME="Ubuntu" 5 | VERSION_ID="22.10" 6 | VERSION="Kinetic Kudu (development branch)" 7 | VERSION_CODENAME=kinetic 8 | ID=ubuntu 9 | ID_LIKE=debian 10 | HOME_URL="https://www.ubuntu.com/" 11 | SUPPORT_URL="https://help.ubuntu.com/" 12 | BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" 13 | PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" 14 | UBUNTU_CODENAME=kinetic 15 | EOF 16 | chmod 644 $RELEASE 17 | } 18 | set_new_lib_release() { 19 | cat > /etc/lsb-release<<-'EOF' 20 | DISTRIB_ID=Ubuntu 21 | DISTRIB_RELEASE=22.10 22 | DISTRIB_CODENAME=kinetic 23 | DISTRIB_DESCRIPTION="Ubuntu Kinetic Kudu (development branch)" 24 | EOF 25 | } 26 | 27 | get_ubuntu_codename() { 28 | for i in /usr/lib/os-release /etc/os-release;do 29 | if [ -s $i ];then 30 | RELEASE=$i 31 | break 32 | fi 33 | done 34 | RELEASE_CONTENT="$(cat $RELEASE)" 35 | SOURCE_LIST="/etc/apt/sources.list" 36 | Current_day=$(date -u +%Y%m%d) 37 | if ((Current_day <= 20220515)); then 38 | case "${RELEASE_CONTENT}" in 39 | *Jammy*Jellyfish*) 40 | set_new_os_release 41 | # if ((Current_day <= 20220430)); then 42 | # sed -i -E "s@(VERSION_CODENAME)=kinetic@\1=devel@" $RELEASE 43 | # else 44 | set_new_lib_release 45 | # fi 46 | ;; 47 | esac 48 | sed -i "s@ jammy@ kinetic@" ${SOURCE_LIST} 49 | fi 50 | } 51 | get_ubuntu_codename -------------------------------------------------------------------------------- /docker/cblmariner/base.dockerfile: -------------------------------------------------------------------------------- 1 | 2 | # syntax=docker/dockerfile:1 3 | #--------------------------- 4 | FROM cblmariner.azurecr.io/base/core:2.0 5 | # FROM cblmariner2preview.azurecr.io/base/core:2.0 6 | # FROM cake233/cblmariner-${TARGETARCH}${TARGETVARIANT} 7 | 8 | ENV TMOE_CHROOT=true \ 9 | TMOE_DOCKER=true \ 10 | TMOE_DIR="/usr/local/etc/tmoe-linux" \ 11 | LANG="en_US.UTF-8" 12 | 13 | # don't add --skip-broken 14 | RUN yes | yum install -y dnf 15 | RUN if [ -z $(command -v dnf) ];then ln -svf $(command -v yum) /usr/bin/dnf; fi 16 | 17 | RUN yes | dnf update -y || echo "install failed" 18 | RUN yes | dnf install -y --skip-broken sudo tar xz newt glibc-all-langpacks passwd shadow-utils hostname glibc-lang glibc-i18n ca-certificates 19 | RUN mkdir -p /run/dbus 20 | 21 | ARG OS 22 | ARG TAG 23 | ARG ARCH 24 | COPY --chmod=755 gen_tool /tmp 25 | RUN mkdir -p $TMOE_DIR/environment \ 26 | && cd $TMOE_DIR \ 27 | && printf "%s\n" \ 28 | "CONTAINER_TYPE=podman" \ 29 | "CONTAINER_NAME=${OS}_nogui-${TAG}" \ 30 | "ARCH=${ARCH}" \ 31 | >container.txt 32 | 33 | WORKDIR /root 34 | 35 | # clean 36 | RUN rm -rfv \ 37 | ~/.cache/* \ 38 | /tmp/* \ 39 | 2>/dev/null 40 | RUN dnf clean all 41 | 42 | CMD ["bash"] -------------------------------------------------------------------------------- /docker/code/latest.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} debian:unstable-slim 4 | 5 | ADD code.js /root/readme.js 6 | COPY --chmod=777 code/init /root 7 | ARG DEBIAN_FRONTEND=noninteractive 8 | ENV TMOE_CHROOT=true \ 9 | TMOE_DOCKER=true \ 10 | TMOE_DIR="/usr/local/etc/tmoe-linux" 11 | 12 | # install dependencies 13 | COPY --chmod=755 install_deb_deps /tmp 14 | RUN . /tmp/install_deb_deps 15 | 16 | # no-install-recommends 17 | RUN apt install \ 18 | -y \ 19 | --no-install-recommends \ 20 | nano \ 21 | bat 22 | 23 | # set locale 24 | COPY --chmod=755 set_locale /tmp 25 | RUN . /tmp/set_locale 26 | ENV LANG en_US.UTF-8 27 | 28 | # batcat -> bat 29 | RUN if [ -n "$(command -v batcat)" ];then ln -svf $(command -v batcat) /usr/bin/bat;fi 30 | 31 | ARG ARCH 32 | # install code 33 | RUN cd /tmp; \ 34 | THE_LATEST_LINK=$(curl -L https://api.github.com/repos/cdr/code-server/releases | grep "${ARCH}" | grep browser_download_url | grep \.deb | head -n 1 | awk -F ' ' '$0=$NF' | cut -d '"' -f 2); \ 35 | THE_LATEST_LINK=$(echo $THE_LATEST_LINK | sed -E -e "s@v(4.0).2/@v\1.1/@" -e "s@(_4.0).2_@\1.1_@"); \ 36 | curl -Lo code.deb ${THE_LATEST_LINK} || exit 1; \ 37 | apt install -y ./code.deb; \ 38 | rm -fv code.deb 39 | 40 | RUN apt install -y libatomic1 2>/dev/null 41 | 42 | ARG OS 43 | ARG TAG 44 | ARG ARCH 45 | COPY --chmod=755 set_container_txt /tmp 46 | RUN . /tmp/set_container_txt 47 | 48 | RUN cd "$TMOE_DIR"; \ 49 | printf "%s\n" \ 50 | 'cd ~' \ 51 | "/usr/local/bin/code" \ 52 | > environment/entrypoint; \ 53 | chmod -v a+rx environment/* 54 | 55 | # bin/code 56 | RUN printf "%s\n" \ 57 | '#!/usr/bin/env bash' \ 58 | 'code-server $@ &' \ 59 | "bat -ppnl yaml ~/.config/code-server/config.yaml || cat ~/.config/code-server/config.yaml" \ 60 | 'printf "You can type \033[32m%s\033[m or \033[32m%s\033[m to start it, type \033[32m%s\033[m to \033[31m%s\033[m.\n" "code" "code-server" "pkill node" "stop"' \ 61 | 'printf "You can also type code \$FILE_DIR to create a new window and open the specified directory.\n"' \ 62 | > /usr/local/bin/code; \ 63 | chmod a+rx /usr/local/bin/code 64 | 65 | # export version info to file 66 | RUN cd /root; \ 67 | code-server --version; \ 68 | printf "%s\n" \ 69 | "" \ 70 | '[version]' \ 71 | "ldd = '$(ldd --version 2>&1 | head -n 2 | grep -vi copyright | sed ":a;N;s/\n/ /g;ta")'" \ 72 | "code = '$(code-server --version)'" \ 73 | "" \ 74 | '[port]' \ 75 | "tcp = [8080]" \ 76 | > version.toml 77 | 78 | # clean 79 | COPY --chmod=755 clean_deb_cache /tmp 80 | RUN . /tmp/clean_deb_cache 81 | 82 | EXPOSE 8080 83 | 84 | CMD [ "code-server" ] 85 | -------------------------------------------------------------------------------- /docker/debian/gui.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | # FROM cake233/debian-zsh-${TARGETARCH}${TARGETVARIANT} 4 | FROM scratch 5 | ADD rootfs.tar / 6 | 7 | ARG DEBIAN_FRONTEND=noninteractive 8 | ENV TMOE_CHROOT=true \ 9 | TMOE_DOCKER=true \ 10 | TMOE_DIR="/usr/local/etc/tmoe-linux" \ 11 | LANG="en_US.UTF-8" 12 | 13 | ARG OS 14 | ARG TAG 15 | ARG ARCH 16 | COPY --chmod=755 gen_tool /tmp 17 | RUN . /tmp/gen_tool 18 | 19 | ARG AUTO_INSTALL_GUI=true 20 | RUN bash /tmp/install-gui.sh 21 | 22 | WORKDIR /root 23 | 24 | # clean 25 | COPY --chmod=755 clean_deb_cache /tmp 26 | RUN . /tmp/clean_deb_cache 27 | RUN rm -rfv \ 28 | ~/.vnc/*passwd \ 29 | /tmp/* \ 30 | 2>/dev/null 31 | 32 | EXPOSE 5902 36080 33 | 34 | CMD ["zsh"] 35 | -------------------------------------------------------------------------------- /docker/debian/zsh.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} debian:experimental 4 | 5 | WORKDIR /root 6 | ARG DEBIAN_FRONTEND=noninteractive 7 | ARG EXP_LIST="/etc/apt/sources.list.d/experimental.list" 8 | ENV TMOE_CHROOT=true \ 9 | TMOE_DOCKER=true \ 10 | TMOE_DIR="/usr/local/etc/tmoe-linux" 11 | 12 | # install dependencies 13 | COPY --chmod=755 install_deb_deps /tmp 14 | RUN . /tmp/install_deb_deps 15 | 16 | RUN apt install -y \ 17 | locales-all \ 18 | wget \ 19 | dialog \ 20 | aria2 \ 21 | zstd \ 22 | systemd \ 23 | aptitude \ 24 | whiptail 25 | 26 | RUN apt install -y \ 27 | --no-install-recommends \ 28 | lolcat \ 29 | unzip 30 | 31 | # set locale 32 | COPY --chmod=755 set_locale /tmp 33 | RUN . /tmp/set_locale 34 | ENV LANG en_US.UTF-8 35 | 36 | ARG OS 37 | ARG TAG 38 | ARG ARCH 39 | COPY --chmod=755 set_container_txt /tmp 40 | RUN . /tmp/set_container_txt 41 | 42 | # configure zsh 43 | COPY --chmod=755 configure_zsh /tmp 44 | RUN . /tmp/configure_zsh 45 | 46 | RUN mv -v ${EXP_LIST} ${EXP_LIST}.bak 47 | 48 | # clean 49 | COPY --chmod=755 clean_deb_cache /tmp 50 | RUN . /tmp/clean_deb_cache 51 | RUN rm -rfv /tmp/* 2>/dev/null 52 | 53 | CMD ["zsh"] 54 | -------------------------------------------------------------------------------- /docker/dotnet/latest.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM cake233/arch-${TARGETARCH}${TARGETVARIANT} 4 | 5 | # test: 6 | # FROM cake233/arch-amd64 7 | 8 | # ADD code.js /root/readme.js 9 | # COPY --chmod=777 code/init /root 10 | 11 | ENV TMOE_CHROOT=true \ 12 | TMOE_DOCKER=true \ 13 | TMOE_DIR="/usr/local/etc/tmoe-linux" \ 14 | DOTNET_RUNNING_IN_CONTAINER=true \ 15 | DOTNET_ROOT="/usr/local/dotnet" \ 16 | # ${HOME}/.dotnet/tools:$PATH 17 | PATH="/usr/local/powershell:/usr/local/dotnet/bin:$PATH" \ 18 | # Unset ASPNETCORE_URLS from aspnet base image 19 | ASPNETCORE_URLS="" \ 20 | # Do not generate certificate 21 | DOTNET_GENERATE_ASPNET_CERTIFICATE=false \ 22 | # Enable correct mode for dotnet watch (only mode supported in a container) 23 | DOTNET_USE_POLLING_FILE_WATCHER=true \ 24 | # Unset Logging__Console__FormatterName from aspnet base image 25 | Logging__Console__FormatterName="" \ 26 | # Skip extraction of XML docs - generally not useful within an image/container - helps performance 27 | NUGET_XMLDOC_MODE=skip 28 | 29 | # install base-devel 30 | RUN pacman -Syu --noconfirm --needed base base-devel 31 | # install dependencies 32 | RUN pacman \ 33 | -S \ 34 | --noconfirm \ 35 | --needed \ 36 | git \ 37 | unzip \ 38 | neofetch \ 39 | iproute 40 | 41 | # git clone tmoe 42 | ARG URL="https://github.com/2moe/tmoe-linux" 43 | RUN mkdir -p "$TMOE_DIR"/environment \ 44 | && cd "$TMOE_DIR" \ 45 | && git clone \ 46 | -b master \ 47 | --depth=1 \ 48 | "$URL" git 49 | 50 | # export env to file 51 | RUN cd "$TMOE_DIR"; \ 52 | printf "%s\n" \ 53 | 'export PATH="/usr/local/powershell:/usr/local/dotnet/bin${PATH:+:${PATH}}"' \ 54 | 'export DOTNET_ROOT="/usr/local/dotnet"' \ 55 | 'export DOTNET_RUNNING_IN_CONTAINER=true' \ 56 | 'export ASPNETCORE_URLS=""' \ 57 | 'export DOTNET_GENERATE_ASPNET_CERTIFICATE=false' \ 58 | 'export DOTNET_USE_POLLING_FILE_WATCHER=true' \ 59 | 'export Logging__Console__FormatterName=""' \ 60 | 'export NUGET_XMLDOC_MODE="skip"' \ 61 | > environment/container.env; \ 62 | chmod -R a+rx environment/ 63 | 64 | # install dotnet 65 | # https://docs.microsoft.com/dotnet/core/install/linux-scripted-manual#scripted-install 66 | RUN cd /tmp \ 67 | && mkdir -p /usr/local/dotnet \ 68 | && curl -LO https://dot.net/v1/dotnet-install.sh \ 69 | && yes | bash dotnet-install.sh -c Current --install-dir /usr/local/dotnet \ 70 | && cd /usr/local/dotnet \ 71 | && mkdir -p bin \ 72 | && ln -svf ../dotnet ./bin/ \ 73 | && chmod a+rx -v bin 74 | 75 | # install pwsh 76 | RUN mkdir -p /usr/local/powershell \ 77 | && dotnet tool install --tool-path /usr/local/powershell PowerShell \ 78 | && chmod a+rx -Rv /usr/local/powershell 79 | 80 | ARG OS 81 | ARG TAG 82 | ARG ARCH 83 | COPY --chmod=755 set_container_txt /tmp 84 | RUN . /tmp/set_container_txt 85 | 86 | # RUN cd "$TMOE_DIR"; \ 87 | # printf "%s\n" \ 88 | # 'cd ~' \ 89 | # "/usr/local/powershell/pwsh" \ 90 | # > environment/entrypoint; \ 91 | # chmod -v a+rx environment/* 92 | 93 | # Do not show first run text 94 | ARG DOTNET_NOLOGO=true 95 | # export version info to file 96 | RUN cd /root; \ 97 | dotnet --version; \ 98 | printf "%s\n" \ 99 | "" \ 100 | '[version]' \ 101 | "ldd = '$(ldd --version 2>&1 | head -n 2 | grep -vi copyright | sed ":a;N;s/\n/ /g;ta")'" \ 102 | "git = '$(git --version)'" \ 103 | "dotnet = '$(dotnet --version)'" \ 104 | "powershell = '$(pwsh -Version)'" \ 105 | "dotnet_info = '''" \ 106 | "$(dotnet --info)" \ 107 | "'''" \ 108 | "" \ 109 | '[other]' \ 110 | 'cmd = "/usr/local/powershell/pwsh"' \ 111 | > version.toml 112 | 113 | # add archlinux mirror repo & install fakeroot-tcp 114 | RUN cd /tmp; \ 115 | cp -fv "${TMOE_DIR}"/git/share/old-version/tools/sources/yay/build_fakeroot ./; \ 116 | chmod a+rx -v build_fakeroot; \ 117 | ./build_fakeroot --add-arch_for_edu-repo; \ 118 | ./build_fakeroot --add-archlinuxcn-repo; \ 119 | ./build_fakeroot --install-paru; \ 120 | ./build_fakeroot --install-fakeroot; \ 121 | ./build_fakeroot --archlinux-repo-mirror; \ 122 | cat /etc/pacman.conf 123 | 124 | # clean 125 | RUN rm -rfv \ 126 | /var/cache/pacman/pkg/* \ 127 | ~/.cache/* \ 128 | /tmp/* \ 129 | 2>/dev/null; \ 130 | yes | pacman -Scc 131 | 132 | CMD [ "/usr/local/powershell/pwsh" ] 133 | -------------------------------------------------------------------------------- /docker/euler/base.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM openeuler/openeuler 4 | 5 | ENV TMOE_CHROOT=true \ 6 | TMOE_DOCKER=true \ 7 | TMOE_DIR="/usr/local/etc/tmoe-linux" \ 8 | LANG="en_US.UTF-8" 9 | 10 | RUN yes | dnf update -y 11 | RUN yes | dnf install -y --skip-broken sudo tar xz newt glibc-all-langpacks passwd shadow-utils hostname ca-certificates 12 | RUN mkdir -p /run/dbus 13 | 14 | ARG OS 15 | ARG TAG 16 | ARG ARCH 17 | COPY --chmod=755 gen_tool /tmp 18 | RUN mkdir -p $TMOE_DIR/environment \ 19 | && cd $TMOE_DIR \ 20 | && printf "%s\n" \ 21 | "CONTAINER_TYPE=podman" \ 22 | "CONTAINER_NAME=${OS}_nogui-${TAG}" \ 23 | "ARCH=${ARCH}" \ 24 | >container.txt 25 | 26 | WORKDIR /root 27 | 28 | # clean 29 | RUN rm -rfv \ 30 | ~/.cache/* \ 31 | /tmp/* \ 32 | 2>/dev/null 33 | RUN dnf clean all 34 | 35 | CMD ["bash"] -------------------------------------------------------------------------------- /docker/euler/dde.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | # FROM cake233/fedora-zsh-${TARGETARCH}${TARGETVARIANT} 4 | FROM cake233/euler-${TARGETARCH}${TARGETVARIANT} 5 | 6 | ENV TMOE_CHROOT=true \ 7 | TMOE_DOCKER=true \ 8 | TMOE_DIR="/usr/local/etc/tmoe-linux" \ 9 | LANG="en_US.UTF-8" 10 | 11 | RUN yes | dnf install -y git zsh 12 | 13 | ARG URL="https://github.com/2moe/tmoe-linux" 14 | # set configuration 15 | RUN mkdir -p "${TMOE_DIR}" \ 16 | && cd "${TMOE_DIR}" \ 17 | && git clone \ 18 | -b master \ 19 | --depth=1 \ 20 | "$URL" git 21 | 22 | ARG OS 23 | ARG TAG 24 | ARG ARCH 25 | COPY --chmod=755 gen_tool /tmp 26 | RUN . /tmp/gen_tool 27 | 28 | # ARG AUTO_INSTALL_GUI=true 29 | # RUN bash /tmp/install-gui.sh 30 | RUN yes | dnf install -y --skip-broken dde || echo "failed to install dde" 31 | RUN yes | dnf install -y tigervnc-server iproute 32 | 33 | RUN cd "${TMOE_DIR}" \ 34 | && cd git/share/old-version/tools/gui \ 35 | && cp startvnc stopvnc startxsdl x11vncpasswd /usr/local/bin \ 36 | && cd /etc/X11/xinit/ \ 37 | && cp Xsession Xsession.bak \ 38 | && echo "dbus-launch startdde" > Xsession \ 39 | && chmod a+rx Xsession 40 | 41 | ARG ARCH 42 | COPY --chmod=755 electron/install_apps /tmp 43 | RUN . /tmp/install_apps 44 | 45 | WORKDIR /root 46 | 47 | # clean 48 | RUN rm -rfv \ 49 | ~/.vnc/*passwd \ 50 | ~/.cache/* \ 51 | /tmp/* \ 52 | 2>/dev/null 53 | RUN dnf clean all 54 | 55 | EXPOSE 5902 36080 56 | CMD ["bash"] 57 | -------------------------------------------------------------------------------- /docker/fedora/gui.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | # FROM cake233/fedora-zsh-${TARGETARCH}${TARGETVARIANT} 4 | FROM scratch 5 | ADD rootfs.tar / 6 | 7 | ENV TMOE_CHROOT=true \ 8 | TMOE_DOCKER=true \ 9 | TMOE_DIR="/usr/local/etc/tmoe-linux" \ 10 | LANG="en_US.UTF-8" 11 | 12 | ARG OS 13 | ARG TAG 14 | ARG ARCH 15 | COPY --chmod=755 gen_tool /tmp 16 | RUN . /tmp/gen_tool 17 | 18 | ARG AUTO_INSTALL_GUI=true 19 | RUN bash /tmp/install-gui.sh 20 | 21 | WORKDIR /root 22 | 23 | # clean 24 | RUN rm -rfv \ 25 | ~/.vnc/*passwd \ 26 | ~/.cache/* \ 27 | /tmp/* \ 28 | 2>/dev/null 29 | RUN dnf clean all 30 | 31 | EXPOSE 5902 36080 32 | CMD ["zsh"] 33 | -------------------------------------------------------------------------------- /docker/fedora/zsh.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} fedora:rawhide 4 | 5 | WORKDIR /root 6 | ARG DNF_RC=/etc/dnf/dnf.conf 7 | ENV TMOE_CHROOT=true \ 8 | TMOE_DOCKER=true \ 9 | TMOE_DIR="/usr/local/etc/tmoe-linux" 10 | 11 | # modify dnf conf 12 | RUN sed -E \ 13 | -e '$a\fastestmirror=True' \ 14 | -e '$a\max_parallel_downloads=5' \ 15 | -i "${DNF_RC}"; \ 16 | cat "${DNF_RC}" 17 | 18 | # install dependencies 19 | RUN yes | dnf update 20 | 21 | RUN [ -e /usr/bin/dnf ] || ln -svf /usr/bin/dnf5 /usr/bin/dnf 22 | 23 | RUN dnf install -y \ 24 | --skip-broken \ 25 | glibc-all-langpacks \ 26 | glibc-minimal-langpack \ 27 | glibc-locale-source 28 | # glibc-langpack-en 29 | 30 | # set locale 31 | COPY --chmod=755 set_locale /tmp 32 | RUN . /tmp/set_locale 33 | ENV LANG en_US.UTF-8 34 | 35 | RUN dnf install -y \ 36 | --skip-broken \ 37 | iproute \ 38 | lolcat \ 39 | newt \ 40 | systemd \ 41 | dnf-utils \ 42 | passwd \ 43 | findutils \ 44 | man-db \ 45 | procps-ng \ 46 | procps-ng-i18n \ 47 | tar \ 48 | hostname \ 49 | neofetch \ 50 | aria2 \ 51 | zstd \ 52 | curl \ 53 | wget 54 | 55 | ARG OS 56 | ARG TAG 57 | ARG ARCH 58 | COPY --chmod=755 set_container_txt /tmp 59 | RUN . /tmp/set_container_txt 60 | 61 | # configure zsh 62 | COPY --chmod=755 configure_zsh /tmp 63 | RUN . /tmp/configure_zsh 64 | 65 | # clean 66 | RUN rm -rfv \ 67 | ~/.cache/* \ 68 | /tmp/* \ 69 | 2>/dev/null 70 | RUN dnf clean all 71 | 72 | CMD [ "zsh" ] 73 | -------------------------------------------------------------------------------- /docker/go/alpine.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} golang:alpine 4 | COPY go.go /root/readme.go 5 | 6 | WORKDIR /go 7 | ENV LANG="C.UTF-8" \ 8 | TMOE_CHROOT=true \ 9 | TMOE_DOCKER=true \ 10 | TMOE_DIR="/usr/local/etc/tmoe-linux" 11 | 12 | COPY --chmod=755 install_alpine_deps /tmp 13 | RUN . /tmp/install_alpine_deps 14 | 15 | ARG OS 16 | ARG TAG 17 | ARG ARCH 18 | COPY --chmod=755 set_container_txt /tmp 19 | RUN . /tmp/set_container_txt 20 | 21 | # PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 22 | # GOPATH=/go 23 | RUN cd "$TMOE_DIR"; \ 24 | printf "%s\n" \ 25 | 'export PATH="/go/bin:/usr/local/go/bin${PATH:+:${PATH}}"' \ 26 | 'export GOPATH="/go"' \ 27 | > environment/container.env; \ 28 | chmod -R a+rx environment/ 29 | 30 | # export version info to file 31 | RUN cd /root; \ 32 | printf "%s\n" \ 33 | "" \ 34 | '[version]' \ 35 | "ldd = '$(ldd --version 2>&1 | head -n 2 | grep -vi copyright | sed ":a;N;s/\n/ /g;ta")'" \ 36 | "go = '$(go version)'" \ 37 | "gofmt = '$(go version $(command -v gofmt))'" \ 38 | "" \ 39 | '[other]' \ 40 | 'workdir = "/go"' \ 41 | > version.toml; \ 42 | cat version.toml 43 | 44 | # clean: apk -v cache clean 45 | RUN rm -rf \ 46 | /var/cache/apk/* \ 47 | ~/.cache/* \ 48 | 2>/dev/null 49 | 50 | CMD ["bash"] 51 | -------------------------------------------------------------------------------- /docker/go/latest.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} golang:latest 4 | COPY go.go /root/README.go 5 | 6 | # set workdir & env 7 | WORKDIR /go 8 | ARG DEBIAN_FRONTEND=noninteractive 9 | ENV TMOE_CHROOT=true \ 10 | TMOE_DOCKER=true \ 11 | TMOE_DIR="/usr/local/etc/tmoe-linux" 12 | 13 | # install dependencies 14 | COPY --chmod=755 install_deb_deps /tmp 15 | RUN . /tmp/install_deb_deps 16 | 17 | # set locale 18 | COPY --chmod=755 set_locale /tmp 19 | RUN . /tmp/set_locale 20 | ENV LANG en_US.UTF-8 21 | 22 | ARG OS 23 | ARG TAG 24 | ARG ARCH 25 | COPY --chmod=755 set_container_txt /tmp 26 | RUN . /tmp/set_container_txt 27 | 28 | # PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 29 | # GOPATH=/go 30 | # export env to file 31 | RUN cd "$TMOE_DIR"; \ 32 | printf "%s\n" \ 33 | 'export PATH="/go/bin:/usr/local/go/bin${PATH:+:${PATH}}"' \ 34 | 'export GOPATH="/go"' \ 35 | > environment/container.env; \ 36 | chmod -R a+rx environment/ 37 | 38 | # export version info to file 39 | RUN cd /root; \ 40 | printf "%s\n" \ 41 | "" \ 42 | '[version]' \ 43 | "ldd = '$(ldd --version 2>&1 | head -n 2 | grep -vi copyright | sed ":a;N;s/\n/ /g;ta")'" \ 44 | "go = '$(go version)'" \ 45 | "gofmt = '$(go version $(command -v gofmt))'" \ 46 | "" \ 47 | '[other]' \ 48 | 'workdir = "/go"' \ 49 | > version.toml; \ 50 | cat version.toml 51 | 52 | # clean 53 | COPY --chmod=755 clean_deb_cache /tmp 54 | RUN . /tmp/clean_deb_cache 55 | 56 | CMD ["bash"] -------------------------------------------------------------------------------- /docker/jdk/latest.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} openjdk:jdk-slim 4 | 5 | WORKDIR /root 6 | ARG DEBIAN_FRONTEND=noninteractive 7 | ENV TMOE_CHROOT=true \ 8 | TMOE_DOCKER=true \ 9 | TMOE_DIR="/usr/local/etc/tmoe-linux" 10 | 11 | COPY --chmod=755 install_deb_deps /tmp 12 | RUN . /tmp/install_deb_deps 13 | 14 | # set locale 15 | COPY --chmod=755 set_locale /tmp 16 | RUN . /tmp/set_locale 17 | ENV LANG en_US.UTF-8 18 | 19 | ARG OS 20 | ARG TAG 21 | ARG ARCH 22 | COPY --chmod=755 set_container_txt /tmp 23 | RUN . /tmp/set_container_txt 24 | 25 | RUN cd ${TMOE_DIR}; \ 26 | JAVA_DIR=$(command -v java); \ 27 | JAVA_PATH=${JAVA_DIR%/*}; \ 28 | printf "%s\n" \ 29 | "export PATH=\"${JAVA_PATH}\${PATH:+:\${PATH}}\"" \ 30 | "export JAVA_HOME='${JAVA_HOME}'" \ 31 | > environment/container.env; \ 32 | printf "%s\n" \ 33 | 'cd ~' \ 34 | "jshell" \ 35 | > environment/entrypoint; \ 36 | chmod -R a+rx environment/ 37 | 38 | RUN cd /root; \ 39 | printf "%s\n" \ 40 | "" \ 41 | '[version]' \ 42 | "ldd = '$(ldd --version 2>&1 | head -n 2 | grep -vi copyright | sed ":a;N;s/\n/ /g;ta")'" \ 43 | "java = '''" \ 44 | "$(java --version)" \ 45 | "'''" \ 46 | "javac = '$(javac --version)'" \ 47 | > version.toml; \ 48 | cat version.toml 49 | 50 | # clean 51 | COPY --chmod=755 clean_deb_cache /tmp 52 | RUN . /tmp/clean_deb_cache 53 | # RUN rm -rfv /tmp/* 2>/dev/null 54 | 55 | CMD [ "jshell" ] 56 | -------------------------------------------------------------------------------- /docker/kali/gui.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | # FROM cake233/kali-zsh-${TARGETARCH}${TARGETVARIANT} 4 | FROM scratch 5 | ADD rootfs.tar / 6 | 7 | ARG DEBIAN_FRONTEND=noninteractive 8 | ENV TMOE_CHROOT=true \ 9 | TMOE_DOCKER=true \ 10 | TMOE_DIR="/usr/local/etc/tmoe-linux" \ 11 | LANG="en_US.UTF-8" 12 | 13 | ARG OS 14 | ARG TAG 15 | ARG ARCH 16 | COPY --chmod=755 gen_tool /tmp 17 | RUN . /tmp/gen_tool 18 | 19 | ARG AUTO_INSTALL_GUI=true 20 | RUN bash /tmp/install-gui.sh 21 | 22 | WORKDIR /root 23 | 24 | # clean 25 | COPY --chmod=755 clean_deb_cache /tmp 26 | RUN . /tmp/clean_deb_cache 27 | RUN rm -rfv \ 28 | ~/.vnc/*passwd \ 29 | /tmp/* \ 30 | 2>/dev/null 31 | 32 | EXPOSE 5902 36080 33 | 34 | CMD ["zsh"] -------------------------------------------------------------------------------- /docker/kali/zsh.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} kalilinux/kali-rolling:latest 4 | 5 | WORKDIR /root 6 | # ARG EXP_LIST="/etc/apt/sources.list.d/kali-experimental.list" 7 | ARG DEBIAN_FRONTEND=noninteractive 8 | ARG EXP_LIST="/etc/apt/sources.list.d/experimental.list" 9 | ENV TMOE_CHROOT=true \ 10 | TMOE_DOCKER=true \ 11 | TMOE_DIR="/usr/local/etc/tmoe-linux" 12 | 13 | # install dependencies 14 | COPY --chmod=755 install_deb_deps /tmp 15 | RUN . /tmp/install_deb_deps 16 | 17 | RUN apt install -y \ 18 | locales-all \ 19 | wget \ 20 | dialog \ 21 | aria2 \ 22 | zstd \ 23 | systemd \ 24 | aptitude \ 25 | whiptail 26 | 27 | RUN apt install -y \ 28 | --no-install-recommends \ 29 | lolcat \ 30 | unzip 31 | 32 | # set locale 33 | COPY --chmod=755 set_locale /tmp 34 | RUN . /tmp/set_locale 35 | ENV LANG en_US.UTF-8 36 | 37 | ARG OS 38 | ARG TAG 39 | ARG ARCH 40 | COPY --chmod=755 set_container_txt /tmp 41 | RUN . /tmp/set_container_txt 42 | 43 | # configure zsh 44 | COPY --chmod=755 configure_zsh /tmp 45 | RUN . /tmp/configure_zsh 46 | 47 | # RUN mv -v ${EXP_LIST} ${EXP_LIST}.bak 48 | 49 | # clean 50 | COPY --chmod=755 clean_deb_cache /tmp 51 | RUN . /tmp/clean_deb_cache 52 | RUN rm -rfv /tmp/* 2>/dev/null 53 | 54 | CMD ["zsh"] 55 | -------------------------------------------------------------------------------- /docker/manjaro/gui.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | # FROM cake233/manjaro-zsh-${TARGETARCH}${TARGETVARIANT} 4 | FROM scratch 5 | ADD rootfs.tar / 6 | 7 | ENV TMOE_CHROOT=true \ 8 | TMOE_DOCKER=true \ 9 | TMOE_DIR="/usr/local/etc/tmoe-linux" \ 10 | LANG="en_US.UTF-8" 11 | 12 | # install man 13 | RUN pacman -Syu --noconfirm --needed \ 14 | man-db \ 15 | man-pages 16 | 17 | # WORKDIR /tmp 18 | 19 | ARG OS 20 | ARG TAG 21 | ARG ARCH 22 | COPY --chmod=755 gen_tool /tmp 23 | RUN . /tmp/gen_tool 24 | 25 | # auto install gui 26 | ARG AUTO_INSTALL_GUI=true 27 | RUN bash /tmp/install-gui.sh 28 | 29 | WORKDIR /root 30 | # remove -Qdtq 31 | RUN pacman -R \ 32 | --noconfirm \ 33 | $(pacman -Qdtq); \ 34 | rm -rfv \ 35 | ~/.vnc/*passwd \ 36 | 2>/dev/null 37 | 38 | # clean /var/cache/pacman/pkg/ 39 | RUN rm -rfv \ 40 | ~/.cache/* \ 41 | /tmp/* \ 42 | 2>/dev/null; \ 43 | yes | pacman -Scc 44 | 45 | # expose tcp ports 46 | EXPOSE 5902 36080 47 | 48 | # command: zsh 49 | CMD ["zsh"] 50 | -------------------------------------------------------------------------------- /docker/manjaro/zsh.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} manjarolinux/base:latest 4 | 5 | WORKDIR /root 6 | ENV TMOE_CHROOT=true \ 7 | TMOE_DOCKER=true \ 8 | TMOE_DIR="/usr/local/etc/tmoe-linux" 9 | 10 | ARG TARGETARCH 11 | COPY --chmod=755 arch_key /tmp 12 | # SHELL [ "bash", "-cex" ] 13 | RUN . /tmp/arch_key 14 | 15 | # set locale 16 | COPY --chmod=755 set_locale /tmp 17 | RUN . /tmp/set_locale 18 | ENV LANG en_US.UTF-8 19 | 20 | WORKDIR /root 21 | 22 | # base-devel 23 | RUN pacman -Syyu --needed --noconfirm base base-devel 24 | 25 | # install dependencies 26 | RUN pacman \ 27 | -S \ 28 | --noconfirm \ 29 | --needed \ 30 | git \ 31 | unzip \ 32 | neofetch \ 33 | iproute \ 34 | zsh \ 35 | wget \ 36 | curl \ 37 | libnewt 38 | 39 | RUN pacman -S --noconfirm --needed openssl-1.1 2>/dev/null 40 | 41 | ARG OS 42 | ARG TAG 43 | ARG ARCH 44 | COPY --chmod=755 set_container_txt /tmp 45 | RUN . /tmp/set_container_txt 46 | 47 | # configure zsh 48 | COPY --chmod=755 configure_zsh /tmp 49 | RUN . /tmp/configure_zsh 50 | 51 | # WORKDIR /tmp 52 | # add archlinux mirror repo & install fakeroot-tcp 53 | RUN cd /tmp; \ 54 | cp -fv "${TMOE_DIR}"/git/share/old-version/tools/sources/yay/build_fakeroot ./; \ 55 | chmod a+rx -v build_fakeroot; \ 56 | ./build_fakeroot --add-arch_for_edu-repo; \ 57 | ./build_fakeroot --add-archlinuxcn-repo; \ 58 | ./build_fakeroot --install-paru; \ 59 | ./build_fakeroot --install-fakeroot; \ 60 | ./build_fakeroot --archlinux-repo-mirror; \ 61 | cat /etc/pacman.conf 62 | 63 | # clean 64 | RUN rm -rfv \ 65 | /var/cache/pacman/pkg/* \ 66 | ~/.cache/* \ 67 | /tmp/* \ 68 | 2>/dev/null; \ 69 | yes | pacman -Scc 70 | 71 | CMD ["zsh"] 72 | 73 | -------------------------------------------------------------------------------- /docker/mongo/latest.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} mongo:latest 4 | 5 | # WORKDIR /root 6 | ARG DEBIAN_FRONTEND=noninteractive 7 | ENV TMOE_CHROOT=true \ 8 | TMOE_DOCKER=true \ 9 | TMOE_DIR="/usr/local/etc/tmoe-linux" 10 | 11 | COPY --chmod=755 install_deb_deps /tmp 12 | RUN . /tmp/install_deb_deps 13 | 14 | RUN apt install -y locales-all 15 | 16 | # set locale 17 | COPY --chmod=755 set_locale /tmp 18 | RUN . /tmp/set_locale 19 | ENV LANG en_US.UTF-8 20 | 21 | ARG OS 22 | ARG TAG 23 | ARG ARCH 24 | COPY --chmod=755 set_container_txt /tmp 25 | RUN . /tmp/set_container_txt 26 | 27 | # export env to file 28 | RUN cd ${TMOE_DIR}; \ 29 | printf "%s\n" \ 30 | "export MONGO_PACKAGE='${MONGO_PACKAGE}'" \ 31 | "export MONGO_REPO='${MONGO_REPO}'" \ 32 | > environment/container.env; \ 33 | printf "%s\n" \ 34 | 'cd ~' \ 35 | "mongod" \ 36 | > environment/entrypoint; \ 37 | chmod -R a+rx environment/ 38 | 39 | # export version info to file 40 | RUN cd /root; \ 41 | printf "%s\n" \ 42 | "" \ 43 | '[version]' \ 44 | "ldd = '$(ldd --version 2>&1 | head -n 2 | grep -vi copyright | sed ":a;N;s/\n/ /g;ta")'" \ 45 | "gosu = '$(gosu --version)'" \ 46 | "jsyaml = '${JSYAML_VERSION}'" \ 47 | "mongo_major = '${MONGO_MAJOR}'" \ 48 | "mongo_version = '${MONGO_VERSION}'" \ 49 | > version.toml; \ 50 | cat version.toml 51 | 52 | # clean 53 | COPY --chmod=755 clean_deb_cache /tmp 54 | RUN . /tmp/clean_deb_cache 55 | 56 | CMD [ "mongod" ] 57 | -------------------------------------------------------------------------------- /docker/nginx/alpine.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} nginx:alpine 4 | 5 | # WORKDIR /root 6 | ADD nginx.txt /root/readme.txt 7 | 8 | ENV LANG="C.UTF-8" \ 9 | TMOE_CHROOT=true \ 10 | TMOE_DOCKER=true \ 11 | TMOE_DIR="/usr/local/etc/tmoe-linux" 12 | 13 | COPY --chmod=755 install_alpine_deps /tmp 14 | RUN . /tmp/install_alpine_deps 15 | 16 | ARG OS 17 | ARG TAG 18 | ARG ARCH 19 | COPY --chmod=755 set_container_txt /tmp 20 | RUN . /tmp/set_container_txt 21 | 22 | RUN cd "$TMOE_DIR"; \ 23 | printf "%s\n" \ 24 | 'cd ~' \ 25 | "nginx -g 'daemon off;'" \ 26 | > environment/entrypoint; \ 27 | chmod -R a+rx environment/ 28 | 29 | # export version info to file 30 | RUN cd /root; \ 31 | printf "%s\n" \ 32 | "" \ 33 | '[version]' \ 34 | "ldd = '$(ldd --version 2>&1 | head -n 2 | grep -vi copyright | sed ":a;N;s/\n/ /g;ta")'" \ 35 | "nginx = '${NGINX_VERSION}'" \ 36 | "njs = '${NJS_VERSION}'" \ 37 | "pkg_release = '${PKG_RELEASE}'" \ 38 | > version.toml; \ 39 | cat version.toml 40 | 41 | # clean: apk -v cache clean 42 | RUN rm -rf \ 43 | /var/cache/apk/* \ 44 | ~/.cache/* \ 45 | 2>/dev/null 46 | 47 | CMD ["nginx", "-g", "daemon off;"] 48 | -------------------------------------------------------------------------------- /docker/nginx/latest.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} nginx:latest 4 | # WORKDIR /root 5 | ADD nginx.txt /root/readme.txt 6 | 7 | ARG DEBIAN_FRONTEND=noninteractive 8 | ENV TMOE_CHROOT=true \ 9 | TMOE_DOCKER=true \ 10 | TMOE_DIR="/usr/local/etc/tmoe-linux" 11 | 12 | COPY --chmod=755 install_deb_deps /tmp 13 | RUN . /tmp/install_deb_deps 14 | 15 | # set locale 16 | COPY --chmod=755 set_locale /tmp 17 | RUN . /tmp/set_locale 18 | ENV LANG en_US.UTF-8 19 | 20 | ARG OS 21 | ARG TAG 22 | ARG ARCH 23 | COPY --chmod=755 set_container_txt /tmp 24 | RUN . /tmp/set_container_txt 25 | 26 | RUN cd "$TMOE_DIR"; \ 27 | printf "%s\n" \ 28 | 'cd ~' \ 29 | "nginx -g 'daemon off;'" \ 30 | > environment/entrypoint; \ 31 | chmod -R a+rx environment/ 32 | 33 | # export version info to file 34 | RUN cd /root; \ 35 | printf "%s\n" \ 36 | "" \ 37 | '[version]' \ 38 | "ldd = '$(ldd --version 2>&1 | head -n 2 | grep -vi copyright | sed ":a;N;s/\n/ /g;ta")'" \ 39 | "nginx = '${NGINX_VERSION}'" \ 40 | "njs = '${NJS_VERSION}'" \ 41 | "pkg_release = '${PKG_RELEASE}'" \ 42 | > version.toml; \ 43 | cat version.toml 44 | 45 | # clean 46 | COPY --chmod=755 clean_deb_cache /tmp 47 | RUN . /tmp/clean_deb_cache 48 | 49 | CMD ["nginx", "-g", "daemon off;"] 50 | -------------------------------------------------------------------------------- /docker/node/alpine.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} node:alpine 4 | COPY node.js /root/readme.js 5 | 6 | ENV LANG="C.UTF-8" \ 7 | TMOE_CHROOT=true \ 8 | TMOE_DOCKER=true \ 9 | TMOE_DIR="/usr/local/etc/tmoe-linux" 10 | 11 | COPY --chmod=755 install_alpine_deps /tmp 12 | RUN . /tmp/install_alpine_deps 13 | 14 | ARG OS 15 | ARG TAG 16 | ARG ARCH 17 | COPY --chmod=755 set_container_txt /tmp 18 | RUN . /tmp/set_container_txt 19 | 20 | RUN cd "$TMOE_DIR"; \ 21 | printf "%s\n" \ 22 | 'cd ~' \ 23 | "node" \ 24 | > environment/entrypoint; \ 25 | chmod -R a+rx environment/ 26 | 27 | # export version info to file 28 | RUN cd /root; \ 29 | printf "%s\n" \ 30 | "" \ 31 | '[version]' \ 32 | "ldd = '$(ldd --version 2>&1 | head -n 2 | grep -vi copyright | sed ":a;N;s/\n/ /g;ta")'" \ 33 | "node = '$(node --version)'" \ 34 | "yarn = '$(yarn --version)'" \ 35 | "npm = '$(npm --version)'" \ 36 | > version.toml; \ 37 | cat version.toml 38 | 39 | # clean: apk -v cache clean 40 | RUN rm -rf \ 41 | /var/cache/apk/* \ 42 | ~/.cache/* \ 43 | 2>/dev/null 44 | 45 | CMD [ "node" ] 46 | -------------------------------------------------------------------------------- /docker/node/latest.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} node:latest 4 | COPY node.js /root/readme.js 5 | 6 | # set arg & env 7 | ARG DEBIAN_FRONTEND=noninteractive 8 | ENV TMOE_CHROOT=true \ 9 | TMOE_DOCKER=true \ 10 | TMOE_DIR="/usr/local/etc/tmoe-linux" 11 | 12 | # install dependencies 13 | COPY --chmod=755 install_deb_deps /tmp 14 | RUN . /tmp/install_deb_deps 15 | 16 | # set locale 17 | COPY --chmod=755 set_locale /tmp 18 | RUN . /tmp/set_locale 19 | ENV LANG en_US.UTF-8 20 | 21 | ARG OS 22 | ARG TAG 23 | ARG ARCH 24 | COPY --chmod=755 set_container_txt /tmp 25 | RUN . /tmp/set_container_txt 26 | 27 | # export env to file 28 | RUN cd "$TMOE_DIR"; \ 29 | mkdir -p environment; \ 30 | printf "%s\n" \ 31 | 'cd ~' \ 32 | "node" \ 33 | > environment/entrypoint; \ 34 | chmod -R a+rx environment/ 35 | 36 | # export version info to file 37 | RUN cd /root; \ 38 | printf "%s\n" \ 39 | "" \ 40 | '[version]' \ 41 | "ldd = '$(ldd --version 2>&1 | head -n 2 | grep -vi copyright | sed ":a;N;s/\n/ /g;ta")'" \ 42 | "node = '$(node --version)'" \ 43 | "yarn = '$(yarn --version)'" \ 44 | "npm = '$(npm --version)'" \ 45 | > version.toml; \ 46 | cat version.toml 47 | 48 | # clean 49 | COPY --chmod=755 clean_deb_cache /tmp 50 | RUN . /tmp/clean_deb_cache 51 | 52 | CMD [ "node" ] 53 | -------------------------------------------------------------------------------- /docker/oracle/base.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM oraclelinux:8 4 | 5 | ENV TMOE_CHROOT=true \ 6 | TMOE_DOCKER=true \ 7 | TMOE_DIR="/usr/local/etc/tmoe-linux" \ 8 | LANG="en_US.UTF-8" 9 | 10 | RUN if [ -z $(command -v dnf) ];then ln -svf $(command -v yum) /usr/bin/dnf; fi 11 | RUN yes | dnf update -y 12 | RUN yes | dnf install -y --skip-broken sudo tar xz newt glibc-all-langpacks passwd shadow-utils hostname ca-certificates 13 | RUN mkdir -p /run/dbus 14 | 15 | ARG OS 16 | ARG TAG 17 | ARG ARCH 18 | COPY --chmod=755 gen_tool /tmp 19 | RUN mkdir -p $TMOE_DIR/environment \ 20 | && cd $TMOE_DIR \ 21 | && printf "%s\n" \ 22 | "CONTAINER_TYPE=podman" \ 23 | "CONTAINER_NAME=${OS}_nogui-${TAG}" \ 24 | "ARCH=${ARCH}" \ 25 | >container.txt 26 | 27 | WORKDIR /root 28 | 29 | # clean 30 | RUN rm -rfv \ 31 | ~/.cache/* \ 32 | /tmp/* \ 33 | 2>/dev/null 34 | RUN dnf clean all 35 | 36 | CMD ["bash"] -------------------------------------------------------------------------------- /docker/php/alpine.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} php:alpine 4 | 5 | # WORKDIR /root 6 | ENV LANG="C.UTF-8" \ 7 | TMOE_CHROOT=true \ 8 | TMOE_DOCKER=true \ 9 | TMOE_DIR="/usr/local/etc/tmoe-linux" 10 | 11 | COPY --chmod=755 install_alpine_deps /tmp 12 | RUN . /tmp/install_alpine_deps 13 | 14 | ARG OS 15 | ARG TAG 16 | ARG ARCH 17 | COPY --chmod=755 set_container_txt /tmp 18 | RUN . /tmp/set_container_txt 19 | 20 | # export env to file 21 | RUN cd "$TMOE_DIR"; \ 22 | printf "%s\n" \ 23 | "export PHP_INI_DIR='${PHP_INI_DIR}'" \ 24 | > environment/container.env; \ 25 | printf "%s\n" \ 26 | 'cd ~' \ 27 | "php -a" \ 28 | > environment/entrypoint; \ 29 | chmod -R a+rx environment/ 30 | 31 | # export version info to file 32 | RUN cd /root; \ 33 | printf "%s\n" \ 34 | "" \ 35 | '[version]' \ 36 | "ldd = '$(ldd --version 2>&1 | head -n 2 | grep -vi copyright | sed ":a;N;s/\n/ /g;ta")'" \ 37 | "php = '''" \ 38 | "$(php --version)" \ 39 | "'''" \ 40 | "" \ 41 | '[other]' \ 42 | "phpize_deps = '${PHPIZE_DEPS}'" \ 43 | "php_extra_configure_args = '--enable-embed'" \ 44 | "php_cflags = '${PHP_CFLAGS}'" \ 45 | "php_cppflags = '${PHP_CPPFLAGS}'" \ 46 | "php_ldflags = '${PHP_LDFLAGS}'" \ 47 | "gpg_keys = '${GPG_KEYS}'" \ 48 | "php_url = '${PHP_URL}'" \ 49 | "php_src_url = '${PHP_ASC_URL}'" \ 50 | > version.toml; \ 51 | cat version.toml 52 | 53 | # clean: apk -v cache clean 54 | RUN rm -rf \ 55 | /var/cache/apk/* \ 56 | ~/.cache/* \ 57 | 2>/dev/null 58 | 59 | CMD [ "php","-a" ] 60 | -------------------------------------------------------------------------------- /docker/php/latest.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} php:latest 4 | 5 | # set arg & env 6 | ARG DEBIAN_FRONTEND=noninteractive 7 | ENV TMOE_CHROOT=true \ 8 | TMOE_DOCKER=true \ 9 | TMOE_DIR="/usr/local/etc/tmoe-linux" 10 | 11 | # install dependencies 12 | COPY --chmod=755 install_deb_deps /tmp 13 | RUN . /tmp/install_deb_deps 14 | 15 | # set locale 16 | COPY --chmod=755 set_locale /tmp 17 | RUN . /tmp/set_locale 18 | ENV LANG en_US.UTF-8 19 | 20 | ARG OS 21 | ARG TAG 22 | ARG ARCH 23 | COPY --chmod=755 set_container_txt /tmp 24 | RUN . /tmp/set_container_txt 25 | 26 | # export env to file 27 | RUN cd "$TMOE_DIR"; \ 28 | printf "%s\n" \ 29 | "export PHP_INI_DIR='${PHP_INI_DIR}'" \ 30 | > environment/container.env; \ 31 | printf "%s\n" \ 32 | 'cd ~' \ 33 | "php -a" \ 34 | > environment/entrypoint; \ 35 | chmod -R a+rx environment/ 36 | 37 | # export version info to file 38 | RUN cd /root; \ 39 | printf "%s\n" \ 40 | "" \ 41 | '[version]' \ 42 | "ldd = '$(ldd --version 2>&1 | head -n 2 | grep -vi copyright | sed ":a;N;s/\n/ /g;ta")'" \ 43 | "php = '''" \ 44 | "$(php --version)" \ 45 | "'''" \ 46 | "" \ 47 | '[other]' \ 48 | "phpize_deps = '${PHPIZE_DEPS}'" \ 49 | "php_extra_configure_args = '--enable-embed'" \ 50 | "php_cflags = '${PHP_CFLAGS}'" \ 51 | "php_cppflags = '${PHP_CPPFLAGS}'" \ 52 | "php_ldflags = '${PHP_LDFLAGS}'" \ 53 | "gpg_keys = '${GPG_KEYS}'" \ 54 | "php_url = '${PHP_URL}'" \ 55 | "php_src_url = '${PHP_ASC_URL}'" \ 56 | > version.toml; \ 57 | cat version.toml 58 | 59 | # clean 60 | COPY --chmod=755 clean_deb_cache /tmp 61 | RUN . /tmp/clean_deb_cache 62 | 63 | CMD [ "php","-a" ] 64 | -------------------------------------------------------------------------------- /docker/ruby/alpine.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} ruby:alpine 4 | 5 | # ENV PATH=/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ 6 | # GEM_HOME=/usr/local/bundle \ 7 | # BUNDLE_SILENCE_ROOT_WARNING=1 \ 8 | # BUNDLE_APP_CONFIG=/usr/local/bundle 9 | ENV LANG="C.UTF-8" \ 10 | TMOE_CHROOT=true \ 11 | TMOE_DOCKER=true \ 12 | TMOE_DIR="/usr/local/etc/tmoe-linux" 13 | 14 | COPY --chmod=755 install_alpine_deps /tmp 15 | RUN . /tmp/install_alpine_deps 16 | 17 | ARG OS 18 | ARG TAG 19 | ARG ARCH 20 | COPY --chmod=755 set_container_txt /tmp 21 | RUN . /tmp/set_container_txt 22 | 23 | # export env to file 24 | RUN cd "$TMOE_DIR"; \ 25 | printf "%s\n" \ 26 | 'export PATH="/usr/local/bundle/bin${PATH:+:${PATH}}"' \ 27 | "export GEM_HOME='/usr/local/bundle'" \ 28 | "export BUNDLE_SILENCE_ROOT_WARNING='1'"\ 29 | "export BUNDLE_APP_CONFIG='/usr/local/bundle'" \ 30 | > environment/container.env; \ 31 | printf "%s\n" \ 32 | 'cd ~' \ 33 | "irb" \ 34 | > environment/entrypoint; \ 35 | chmod -R a+rx environment/ 36 | 37 | RUN gem install webrick 38 | 39 | # export version info to file 40 | RUN cd /root; \ 41 | printf "%s\n" \ 42 | "" \ 43 | '[version]' \ 44 | "ldd = '$(ldd --version 2>&1 | head -n 2 | grep -vi copyright | sed ":a;N;s/\n/ /g;ta")'" \ 45 | "ruby = '$(ruby --version)'" \ 46 | "gem = '$(gem --version)'" \ 47 | "bundle = '$(bundle --version)'" \ 48 | > version.toml; \ 49 | cat version.toml 50 | 51 | # clean: apk -v cache clean 52 | RUN rm -rf \ 53 | /var/cache/apk/* \ 54 | ~/.cache/* \ 55 | 2>/dev/null 56 | 57 | CMD [ "irb" ] 58 | -------------------------------------------------------------------------------- /docker/ruby/latest.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} ruby:latest 4 | 5 | # set arg & env 6 | ARG DEBIAN_FRONTEND=noninteractive 7 | ENV TMOE_CHROOT=true \ 8 | TMOE_DOCKER=true \ 9 | TMOE_DIR="/usr/local/etc/tmoe-linux" 10 | 11 | # install dependencies 12 | COPY --chmod=755 install_deb_deps /tmp 13 | RUN . /tmp/install_deb_deps 14 | 15 | # set locale 16 | COPY --chmod=755 set_locale /tmp 17 | RUN . /tmp/set_locale 18 | ENV LANG en_US.UTF-8 19 | 20 | ARG OS 21 | ARG TAG 22 | ARG ARCH 23 | COPY --chmod=755 set_container_txt /tmp 24 | RUN . /tmp/set_container_txt 25 | 26 | # export env to file 27 | RUN cd "$TMOE_DIR"; \ 28 | printf "%s\n" \ 29 | 'export PATH="/usr/local/bundle/bin${PATH:+:${PATH}}"' \ 30 | "export GEM_HOME='/usr/local/bundle'" \ 31 | "export BUNDLE_SILENCE_ROOT_WARNING='1'"\ 32 | "export BUNDLE_APP_CONFIG='/usr/local/bundle'" \ 33 | > environment/container.env; \ 34 | printf "%s\n" \ 35 | 'cd ~' \ 36 | "irb" \ 37 | > environment/entrypoint; \ 38 | chmod -R a+rx environment/ 39 | 40 | RUN gem install webrick 41 | 42 | # export version info to file 43 | RUN cd /root; \ 44 | printf "%s\n" \ 45 | "" \ 46 | '[version]' \ 47 | "ldd = '$(ldd --version 2>&1 | head -n 2 | grep -vi copyright | sed ":a;N;s/\n/ /g;ta")'" \ 48 | "ruby = '$(ruby --version)'" \ 49 | "gem = '$(gem --version)'" \ 50 | "bundle = '$(bundle --version)'" \ 51 | > version.toml; \ 52 | cat version.toml 53 | 54 | # clean 55 | COPY --chmod=755 clean_deb_cache /tmp 56 | RUN . /tmp/clean_deb_cache 57 | 58 | CMD [ "irb" ] 59 | -------------------------------------------------------------------------------- /docker/rust/alpine.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} alpine:edge 4 | 5 | WORKDIR /root 6 | # PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 7 | ENV LANG="C.UTF-8" \ 8 | TMOE_CHROOT=true \ 9 | TMOE_DOCKER=true \ 10 | TMOE_DIR="/usr/local/etc/tmoe-linux" \ 11 | RUSTUP_HOME="/usr/local/rustup" \ 12 | CARGO_HOME="/usr/local/cargo" \ 13 | PATH="/usr/local/cargo/bin:$PATH" 14 | 15 | # install dependencies 16 | COPY --chmod=755 install_alpine_deps /tmp 17 | RUN . /tmp/install_alpine_deps 18 | 19 | # install musl-dev 20 | RUN apk add openssl-dev \ 21 | musl-dev \ 22 | gcc \ 23 | ca-certificates 24 | 25 | # minimal, default, complete 26 | ARG RUSTUP_PROFILE=minimal 27 | ARG MUSL_TARGET 28 | RUN export RUSTUP_URL="https://static.rust-lang.org/rustup/dist/${MUSL_TARGET}/rustup-init"; \ 29 | curl -LO ${RUSTUP_URL} || exit 1; \ 30 | chmod +x rustup-init \ 31 | && ./rustup-init \ 32 | -y \ 33 | --profile ${RUSTUP_PROFILE} \ 34 | --no-modify-path \ 35 | --default-toolchain \ 36 | nightly \ 37 | && rm rustup-init \ 38 | && chmod -Rv a+w ${RUSTUP_HOME} ${CARGO_HOME} 39 | # RUN rustup update 40 | 41 | ARG OS 42 | ARG TAG 43 | ARG ARCH 44 | COPY --chmod=755 set_container_txt /tmp 45 | RUN . /tmp/set_container_txt 46 | 47 | # export env to file 48 | RUN cd ${TMOE_DIR}; \ 49 | printf "%s\n" \ 50 | 'export PATH="/usr/local/cargo/bin${PATH:+:${PATH}}"' \ 51 | 'export RUSTUP_HOME="/usr/local/rustup"' \ 52 | 'export CARGO_HOME="/usr/local/cargo"' \ 53 | > environment/container.env; \ 54 | chmod -R a+rx environment/ 55 | 56 | # export version info to file 57 | RUN cd /root; \ 58 | printf "%s\n" \ 59 | "" \ 60 | '[version]' \ 61 | "ldd = '$(ldd --version 2>&1 | head -n 2 | grep -vi copyright | sed ":a;N;s/\n/ /g;ta")'" \ 62 | "rustup = '$(rustup --version)'" \ 63 | "cargo = '$(cargo --version)'" \ 64 | "rustc = '$(rustc --version)'" \ 65 | "cc = '$(cc --version | head -n 1)'" \ 66 | "cargo_verbose = '''" \ 67 | "$(cargo -Vv)" \ 68 | "'''" \ 69 | "rustc_verbose = '''" \ 70 | "$(rustc -Vv)" \ 71 | "'''" \ 72 | > version.toml; \ 73 | cat version.toml 74 | 75 | # clean: apk -v cache clean 76 | RUN rm -rf /var/cache/apk/* \ 77 | ~/.cache/* \ 78 | 2>/dev/null 79 | 80 | CMD ["bash"] 81 | -------------------------------------------------------------------------------- /docker/rust/latest.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} debian:unstable 4 | 5 | WORKDIR /root 6 | # set arg & env 7 | ARG DEBIAN_FRONTEND=noninteractive 8 | ENV TMOE_CHROOT=true \ 9 | TMOE_DOCKER=true \ 10 | TMOE_DIR="/usr/local/etc/tmoe-linux" \ 11 | RUSTUP_HOME="/usr/local/rustup" \ 12 | CARGO_HOME="/usr/local/cargo" \ 13 | PATH="/usr/local/cargo/bin:$PATH" 14 | 15 | # install dependencies 16 | COPY --chmod=755 install_deb_deps /tmp 17 | RUN . /tmp/install_deb_deps 18 | 19 | RUN apt install -y \ 20 | pkg-config \ 21 | libssl-dev 22 | 23 | RUN apt install \ 24 | -y \ 25 | --no-install-recommends \ 26 | gcc \ 27 | libc6-dev 28 | 29 | # minimal, default, complete 30 | ARG RUSTUP_PROFILE=default 31 | ARG GNU_TARGET 32 | # ARG MUSL_TARGET 33 | # x86_64-unknown-linux-gnu/rustup-init 34 | RUN export RUSTUP_URL="https://static.rust-lang.org/rustup/dist/${GNU_TARGET}/rustup-init"; \ 35 | curl -LO ${RUSTUP_URL} || exit 1; \ 36 | chmod +x rustup-init \ 37 | && ./rustup-init \ 38 | -y \ 39 | --profile ${RUSTUP_PROFILE} \ 40 | --no-modify-path \ 41 | --default-toolchain \ 42 | nightly \ 43 | && rm rustup-init \ 44 | && chmod -Rv a+w ${RUSTUP_HOME} ${CARGO_HOME} 45 | 46 | # set locale 47 | COPY --chmod=755 set_locale /tmp 48 | RUN . /tmp/set_locale 49 | ENV LANG en_US.UTF-8 50 | 51 | ARG OS 52 | ARG TAG 53 | ARG ARCH 54 | COPY --chmod=755 set_container_txt /tmp 55 | RUN . /tmp/set_container_txt 56 | 57 | # export env to file 58 | RUN cd "$TMOE_DIR"; \ 59 | printf "%s\n" \ 60 | 'export PATH="/usr/local/cargo/bin${PATH:+:${PATH}}"' \ 61 | 'export RUSTUP_HOME="/usr/local/rustup"' \ 62 | 'export CARGO_HOME="/usr/local/cargo"' \ 63 | > environment/container.env; \ 64 | chmod -R a+rx environment/ 65 | 66 | RUN cd /root; \ 67 | printf "%s\n" \ 68 | "" \ 69 | '[version]' \ 70 | "ldd = '$(ldd --version 2>&1 | head -n 2 | grep -vi copyright | sed ":a;N;s/\n/ /g;ta")'" \ 71 | "rustup = '$(rustup --version)'" \ 72 | "cargo = '$(cargo --version)'" \ 73 | "rustc = '$(rustc --version)'" \ 74 | "cc = '$(cc --version | head -n 1)'" \ 75 | "cargo_verbose = '''" \ 76 | "$(cargo -Vv)" \ 77 | "'''" \ 78 | "rustc_verbose = '''" \ 79 | "$(rustc -Vv)" \ 80 | "'''" \ 81 | > version.toml; \ 82 | cat version.toml 83 | 84 | # clean 85 | COPY --chmod=755 clean_deb_cache /tmp 86 | RUN . /tmp/clean_deb_cache 87 | 88 | CMD ["bash"] 89 | -------------------------------------------------------------------------------- /docker/scratch/zstd.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM busybox 4 | COPY rootfs.tar.zst /root 5 | -------------------------------------------------------------------------------- /docker/swift/latest.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | ARG SWIFT_PLATFORM=ubuntu 4 | ARG OS_MAJOR_VER=20 5 | ARG OS_MIN_VER=04 6 | 7 | FROM --platform=${TARGETPLATFORM} ${SWIFT_PLATFORM}:${OS_MAJOR_VER}.${OS_MIN_VER} 8 | 9 | # twice 10 | ARG SWIFT_PLATFORM=ubuntu 11 | ARG OS_MAJOR_VER=20 12 | ARG OS_MIN_VER=04 13 | 14 | ARG DEBIAN_FRONTEND=noninteractive 15 | ENV TMOE_CHROOT=true \ 16 | TMOE_DOCKER=true \ 17 | TMOE_DIR="/usr/local/etc/tmoe-linux" 18 | 19 | # https://wiki.ubuntu.com/Minimal 20 | # minimize -> unminimize 21 | RUN yes | unminimize; return 0 22 | 23 | # install dependencies 24 | COPY --chmod=755 install_deb_deps /tmp 25 | RUN . /tmp/install_deb_deps 26 | 27 | RUN apt-get install -y \ 28 | locales-all \ 29 | nano 30 | 31 | RUN apt-get install -y \ 32 | binutils \ 33 | git \ 34 | gnupg2 \ 35 | libc6-dev \ 36 | libcurl4-openssl-dev \ 37 | libedit2 \ 38 | libgcc-9-dev \ 39 | libpython3.8 \ 40 | libsqlite3-0 \ 41 | libstdc++-9-dev \ 42 | libxml2-dev \ 43 | libz3-dev \ 44 | pkg-config \ 45 | tzdata \ 46 | zlib1g-dev 47 | 48 | # set locale 49 | COPY --chmod=755 set_locale /tmp 50 | RUN . /tmp/set_locale 51 | ENV LANG en_US.UTF-8 52 | 53 | 54 | ARG SWIFT_WEBROOT=https://download.swift.org/development 55 | 56 | ARG OS 57 | ARG TAG 58 | ARG ARCH 59 | COPY --chmod=755 set_container_txt /tmp 60 | COPY --chmod=755 swift/download_swift /tmp 61 | RUN . /tmp/set_container_txt \ 62 | && . /tmp/download_swift 63 | 64 | # export version info to file 65 | RUN cd /root; \ 66 | printf "%s\n" \ 67 | "" \ 68 | '[version]' \ 69 | "ldd = '$(ldd --version 2>&1 | head -n 2 | grep -vi copyright | sed ":a;N;s/\n/ /g;ta")'" \ 70 | "git = '$(git --version 2>&1 | head -n 1)'" \ 71 | "swift = '''" \ 72 | "$(swift --version)" \ 73 | "'''" \ 74 | > version.toml 75 | # "" \ 76 | # '[other]' \ 77 | # 'dependencies = ["binutils", "git", "gnupg2", "libc6-dev", "libcurl4-openssl-dev", "libedit2", "libgcc-9-dev", "libpython3.8", "libsqlite3-0", "libstdc++-9-dev", "libxml2-dev", "libz3-dev", "pkg-config", "tzdata", "zlib1g-dev"]' \ 78 | 79 | # clean 80 | COPY --chmod=755 clean_deb_cache /tmp 81 | RUN . /tmp/clean_deb_cache 82 | 83 | CMD [ "swift" ] 84 | -------------------------------------------------------------------------------- /docker/test/hello.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | # DOCKER_BUILDKIT=1 docker build -t u2 -f ../arch/base.dockerfile --platform=linux/amd64 . 4 | # --build-arg ARCH amd64 5 | 6 | FROM --platform="$TARGETPLATFORM" alpine:edge 7 | 8 | RUN apk add bash \ 9 | && echo hello world 10 | 11 | CMD ["echo", "hello", "docker"] 12 | -------------------------------------------------------------------------------- /docker/tmp.dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | 3 | RUN uname -a \ 4 | && apk add curl zstd tar 5 | 6 | RUN curl -Lvo paru.tar.zst l.tmoe.me/paru-arm64-github; \ 7 | cat paru.tar.zst; \ 8 | curl -Lvo paru.tar.zst https://l.tmoe.me/paru-arm64-github; \ 9 | tar -xvf paru.tar.zst \ 10 | && ls -lah 11 | 12 | -------------------------------------------------------------------------------- /docker/ubuntu/cutefish.dockerfile: -------------------------------------------------------------------------------- 1 | FROM cake233/ubuntu-kde-${TARGETARCH}${TARGETVARIANT} AS builder 2 | 3 | ARG DEBIAN_FRONTEND=noninteractive 4 | ENV TMOE_CHROOT=true \ 5 | TMOE_DOCKER=true \ 6 | TMOE_DIR="/usr/local/etc/tmoe-linux" \ 7 | LANG="en_US.UTF-8" 8 | 9 | WORKDIR /root 10 | 11 | ARG OS 12 | ARG TAG 13 | ARG ARCH 14 | COPY --chmod=755 install_cutefish /tmp 15 | RUN . /tmp/install_cutefish 16 | 17 | RUN cd ~/cutefish \ 18 | && mkdir -pv ~/deb \ 19 | && mv -vf *.deb *.buildinfo *.changes *.ddeb ~/deb 20 | 21 | # clean 22 | COPY --chmod=755 clean_deb_cache /tmp 23 | RUN . /tmp/clean_deb_cache 24 | RUN rm -rfv \ 25 | ~/.vnc/*passwd \ 26 | /tmp/* \ 27 | 2>/dev/null 28 | 29 | EXPOSE 5902 36080 30 | 31 | FROM ubuntu:devel 32 | WORKDIR /root 33 | COPY --from=builder /root/deb . 34 | 35 | CMD ["bash"] 36 | 37 | -------------------------------------------------------------------------------- /docker/ubuntu/dde.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} ubuntu:21.10 4 | 5 | WORKDIR /root 6 | ARG DEBIAN_FRONTEND=noninteractive 7 | ENV TMOE_CHROOT=true \ 8 | TMOE_DOCKER=true \ 9 | TMOE_DIR="/usr/local/etc/tmoe-linux" 10 | 11 | # install dependencies 12 | COPY --chmod=755 install_deb_deps /tmp 13 | RUN . /tmp/install_deb_deps 14 | 15 | RUN apt install -y software-properties-common 16 | 17 | RUN apt install -y \ 18 | locales-all \ 19 | wget \ 20 | dialog \ 21 | aria2 \ 22 | zstd \ 23 | systemd \ 24 | aptitude 25 | 26 | RUN apt install -y \ 27 | --no-install-recommends \ 28 | lolcat \ 29 | unzip 30 | 31 | # set locale 32 | COPY --chmod=755 set_locale /tmp 33 | RUN . /tmp/set_locale 34 | ENV LANG en_US.UTF-8 35 | 36 | ARG OS 37 | ARG TAG 38 | ARG ARCH 39 | COPY --chmod=755 set_container_txt /tmp 40 | RUN . /tmp/set_container_txt 41 | 42 | # configure zsh 43 | COPY --chmod=755 configure_zsh /tmp 44 | RUN . /tmp/configure_zsh 45 | 46 | # clean 47 | COPY --chmod=755 clean_deb_cache /tmp 48 | RUN . /tmp/clean_deb_cache 49 | RUN rm -rfv /tmp/* 2>/dev/null 50 | 51 | ARG DEBIAN_FRONTEND=noninteractive 52 | ENV LANG="en_US.UTF-8" 53 | 54 | ARG OS 55 | ARG TAG 56 | ARG ARCH 57 | COPY --chmod=755 gen_tool /tmp 58 | RUN . /tmp/gen_tool 59 | 60 | ARG AUTO_INSTALL_GUI=true 61 | RUN bash /tmp/install-gui.sh 62 | 63 | WORKDIR /root 64 | 65 | # clean 66 | COPY --chmod=755 clean_deb_cache /tmp 67 | RUN . /tmp/clean_deb_cache 68 | RUN rm -rfv \ 69 | ~/.vnc/*passwd \ 70 | /tmp/* \ 71 | 2>/dev/null 72 | 73 | EXPOSE 5902 36080 74 | 75 | CMD ["zsh"] 76 | -------------------------------------------------------------------------------- /docker/ubuntu/gui.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | # FROM cake233/ubuntu-zsh-${TARGETARCH}${TARGETVARIANT} 4 | FROM scratch 5 | ADD rootfs.tar / 6 | 7 | ARG DEBIAN_FRONTEND=noninteractive 8 | ENV TMOE_CHROOT=true \ 9 | TMOE_DOCKER=true \ 10 | TMOE_DIR="/usr/local/etc/tmoe-linux" \ 11 | LANG="en_US.UTF-8" 12 | 13 | ARG OS 14 | ARG TAG 15 | ARG ARCH 16 | COPY --chmod=755 gen_tool /tmp 17 | RUN . /tmp/gen_tool 18 | 19 | ARG AUTO_INSTALL_GUI=true 20 | RUN bash /tmp/install-gui.sh 21 | 22 | WORKDIR /root 23 | 24 | # clean 25 | COPY --chmod=755 clean_deb_cache /tmp 26 | RUN . /tmp/clean_deb_cache 27 | RUN rm -rfv \ 28 | ~/.vnc/*passwd \ 29 | /tmp/* \ 30 | 2>/dev/null 31 | 32 | EXPOSE 5902 36080 33 | 34 | CMD ["zsh"] 35 | -------------------------------------------------------------------------------- /docker/ubuntu/kinetic.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} ubuntu:devel 4 | 5 | WORKDIR /root 6 | ARG DEBIAN_FRONTEND=noninteractive 7 | ENV TMOE_CHROOT=true \ 8 | TMOE_DOCKER=true \ 9 | TMOE_DIR="/usr/local/etc/tmoe-linux" 10 | 11 | # COPY --chmod=755 ubuntu/devel /tmp 12 | # RUN bash /tmp/devel 13 | 14 | # install dependencies 15 | COPY --chmod=755 install_deb_deps /tmp 16 | RUN . /tmp/install_deb_deps 17 | 18 | # RUN apt install -y software-properties-common 19 | 20 | RUN apt install -y \ 21 | locales-all \ 22 | systemd 23 | 24 | 25 | # set locale 26 | COPY --chmod=755 set_locale /tmp 27 | RUN . /tmp/set_locale 28 | ENV LANG en_US.UTF-8 29 | 30 | ARG OS 31 | ARG TAG 32 | ARG ARCH 33 | COPY --chmod=755 set_container_txt /tmp 34 | RUN . /tmp/set_container_txt 35 | 36 | # clean 37 | COPY --chmod=755 clean_deb_cache /tmp 38 | RUN . /tmp/clean_deb_cache 39 | RUN rm -rfv /tmp/* 2>/dev/null 40 | 41 | CMD ["bash"] -------------------------------------------------------------------------------- /docker/ubuntu/zsh.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | #--------------------------- 3 | FROM --platform=${TARGETPLATFORM} ubuntu:devel 4 | 5 | WORKDIR /root 6 | ARG DEBIAN_FRONTEND=noninteractive 7 | ENV TMOE_CHROOT=true \ 8 | TMOE_DOCKER=true \ 9 | TMOE_DIR="/usr/local/etc/tmoe-linux" 10 | 11 | # COPY --chmod=755 ubuntu/devel /tmp 12 | # RUN bash /tmp/devel 13 | 14 | RUN LIST=/etc/apt/sources.list.d/proposed.list \ 15 | && if [ -e $LIST ]; then mv -f $LIST ${LIST}.bak; fi 16 | 17 | # https://wiki.ubuntu.com/Minimal 18 | # minimize -> unminimize 19 | RUN yes | unminimize ; return 0 20 | 21 | # install dependencies 22 | COPY --chmod=755 install_deb_deps /tmp 23 | RUN . /tmp/install_deb_deps 24 | 25 | RUN apt install -y \ 26 | software-properties-common \ 27 | tzdata 28 | 29 | RUN apt install -y \ 30 | locales-all \ 31 | wget \ 32 | dialog \ 33 | aria2 \ 34 | zstd \ 35 | systemd \ 36 | aptitude \ 37 | whiptail 38 | 39 | RUN apt install -y \ 40 | --no-install-recommends \ 41 | lolcat \ 42 | unzip 43 | 44 | # set locale 45 | COPY --chmod=755 set_locale /tmp 46 | RUN . /tmp/set_locale 47 | ENV LANG en_US.UTF-8 48 | 49 | ARG OS 50 | ARG TAG 51 | ARG ARCH 52 | COPY --chmod=755 set_container_txt /tmp 53 | RUN . /tmp/set_container_txt 54 | 55 | # configure zsh 56 | COPY --chmod=755 configure_zsh /tmp 57 | RUN . /tmp/configure_zsh 58 | 59 | # clean 60 | COPY --chmod=755 clean_deb_cache /tmp 61 | RUN . /tmp/clean_deb_cache 62 | RUN rm -rfv /tmp/* 2>/dev/null 63 | 64 | CMD ["zsh"] 65 | --------------------------------------------------------------------------------