liuyuqi-dellpc 10 months ago
parent
commit
a8c95ef1d7

+ 31 - 0
docker/db/mariadb/Dockerfile

@@ -0,0 +1,31 @@
+FROM bitnami/mariadb:10.3
+
+USER root
+
+RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak
+COPY buster.sources.list /etc/apt/sources.list
+
+RUN apt-get update && \
+    apt-get install -y curl git unzip vim wget && \
+    apt-get install -y locales kde-l10n-zhcn && \
+    apt-get clean && \
+    rm -rf /var/lib/apt/lists/*
+
+RUN sed -i 's/# zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/g' /etc/locale.gen
+
+RUN locale && locale-gen "zh_CN.UTF-8"
+
+# Set environment variables.
+ENV LANG=zh_CN.UTF-8 \
+    LANGUAGE=zh_CN:zh:en_US:en \
+    LC_ALL=zh_CN.UTF-8 \
+    TZ=Asia/Shanghai \
+    DEBIAN_FRONTEND="noninteractive" \
+    TERM=xterm
+
+RUN ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && \
+    echo $TZ > /etc/timezone && \
+    dpkg-reconfigure --frontend noninteractive tzdata && \
+    dpkg-reconfigure --frontend noninteractive locales
+
+USER 1001

+ 9 - 0
docker/db/mariadb/buster.sources.list

@@ -0,0 +1,9 @@
+deb http://mirrors.163.com/debian/ buster main non-free contrib
+deb http://mirrors.163.com/debian/ buster-updates main non-free contrib
+deb http://mirrors.163.com/debian/ buster-backports main non-free contrib
+deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib
+
+deb-src http://mirrors.163.com/debian/ buster main non-free contrib
+deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib
+deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib
+deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib

+ 3 - 0
docker/db/mongo-express/Dockerfile

@@ -0,0 +1,3 @@
+FROM mongo-express
+
+EXPOSE 8081

+ 31 - 0
docker/db/mongo-express/docker-compose.debug.yml

@@ -0,0 +1,31 @@
+version: '3.4'
+
+services:
+
+  mongo:
+    image: registry.cn-hangzhou.aliyuncs.com/kennylee/mongo-express
+    container_name: "mongo-express"
+    restart: always
+    # env_file: .env
+    environment:
+      - MONGO_INITDB_ROOT_USERNAME=root
+      - MONGO_INITDB_ROOT_PASSWORD=example
+    volumes:
+      - mongo-data:/data/db
+    networks:
+      - infisical-dev
+    ports:
+      - "27017:27017"
+    logging:
+      driver: 'json-file'
+      options:
+        max-size: '30m'
+        max-file: '1'
+
+volumes:
+  mongo-data:
+
+
+networks:
+  infisical-dev:
+    driver: bridge

+ 36 - 0
docker/db/mongo/Dockerfile

@@ -0,0 +1,36 @@
+# see also: https://github.com/docker-library/mongo/blob/21869963911a74ccc13697c3ad50cdc23cc79b15/4.1/Dockerfil
+FROM mongo:4.1.1-xenial
+RUN sed -i 's/archive.ubuntu.com/mirrors.163.com/g' /etc/apt/sources.list
+
+# Install.
+RUN \
+    apt-get update && \
+    apt-get -y upgrade && \
+    apt-get install -y curl git unzip vim wget iputils-ping && \
+    apt-get install -y language-pack-zh-hans && \
+    apt-get install -y tzdata && \
+    rm -rf /var/lib/apt/lists/*
+
+RUN locale
+
+# Set environment variables.
+ENV HOME /root
+ENV LANG=zh_CN.UTF-8\
+    LANGUAGE=zh_CN:zh:en_US:en\
+    LC_ALL=zh_CN.UTF-8\
+    TZ=Asia/Shanghai\
+    TERM=xterm
+
+RUN ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && \
+    echo $TZ > /etc/timezone && \
+    dpkg-reconfigure --frontend noninteractive tzdata
+
+# Define working directory.
+WORKDIR $HOME
+
+VOLUME /data/db /data/configdb
+
+ENTRYPOINT ["docker-entrypoint.sh"]
+
+EXPOSE 27017
+CMD ["mongod"]

+ 8 - 1
docker/db/mongo/docker-compose.debug.yml

@@ -14,7 +14,14 @@ services:
       - mongo-data:/data/db
     networks:
       - infisical-dev
-
+    ports:
+      - "27017:27017"
+    logging:
+        driver: 'json-file'
+        options:
+            max-size: '30m'
+            max-file: '1'
+            
 volumes:
   mongo-data:
 

+ 32 - 0
docker/db/mysql/Dockerfile

@@ -0,0 +1,32 @@
+FROM mysql:5.7.33
+RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak
+COPY buster.sources.list /etc/apt/sources.list
+
+RUN apt-get update && \
+    apt-get install -y curl git unzip vim wget && \
+    apt-get install -y locales kde-l10n-zhcn && \ 
+    apt-get clean && \
+    rm -rf /var/lib/apt/lists/*
+
+RUN sed -i 's/# zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/g' /etc/locale.gen
+
+RUN locale && locale-gen "zh_CN.UTF-8"
+
+# Set environment variables.
+ENV LANG=zh_CN.UTF-8 \
+    LANGUAGE=zh_CN:zh:en_US:en \
+    LC_ALL=zh_CN.UTF-8 \
+    TZ=Asia/Shanghai \
+    DEBIAN_FRONTEND="noninteractive" \
+    TERM=xterm
+
+RUN ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && \
+    echo $TZ > /etc/timezone && \        
+    dpkg-reconfigure --frontend noninteractive tzdata && \
+    dpkg-reconfigure --frontend noninteractive locales
+
+COPY my.cnf /etc/mysql/my.cnf
+RUN mkdir -p /etc/mysql/mysql-my.conf.d/
+
+EXPOSE 3306
+CMD ["mysqld"]

+ 0 - 0
docker/db/mysql/my.cnf


+ 20 - 0
docker/db/oracle-xe-11g/docker-compose.yml

@@ -0,0 +1,20 @@
+version: '2'
+services:
+    app:
+        image: registry.cn-hangzhou.aliyuncs.com/kennylee/oracle-xe-11g
+        ports: 
+            - "1521:1521"
+            - "1522:22"
+        container_name: oracle-xe-11g
+        restart: always
+        environment:
+            - TZ=Asia/Shanghai
+            - ORACLE_ALLOW_REMOTE=true
+        shm_size: 2g
+        volumes:
+            - ./data/:/u01/data/:z
+        logging:
+            driver: 'json-file'
+            options:
+                max-size: '30m'
+                max-file: '1'

+ 19 - 0
docker/db/postgresql/docker-compose.yml

@@ -0,0 +1,19 @@
+version: '2'
+
+services:
+  postgresql:
+    image: 'registry.cn-hangzhou.aliyuncs.com/kennylee/postgresql:12.4'
+    container_name: "postgresql"
+    ports:
+      - '5432:5432'
+    volumes:
+      - './data/data:/bitnami/postgresql'
+      - './data/conf:/bitnami/postgresql/conf/'
+    environment:
+      - POSTGRESQL_PASSWORD=password123456
+    restart: on-failure
+    logging:
+      driver: 'json-file'
+      options:
+        max-size: '12m'
+        max-file: '5'

+ 6 - 1
docker/db/redis/docker-compose.debug.yml

@@ -13,7 +13,12 @@ services:
       - redis_data:/data
     networks:
       - infisical-dev
-
+    # command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
+    logging:
+      driver: 'json-file'
+      options:
+        max-size: '30m'
+        max-file: '1'
   redis-commander:
     container_name: infisical-dev-redis-commander
     image: rediscommander/redis-commander:latest

+ 46 - 87
flutter/.ide/Dockerfile-Allinone-flutter

@@ -1,21 +1,22 @@
-FROM ubuntu:24.04 as builder
+FROM openjdk:11 as builder
+
+ENV MAVEN_VERSION=3.9.5 \
+    GRADLE_VERSION=7.5
+ARG FLUTTER_VERSION="3.13.5"
 
-USER root
 # apt change to aliyun
-RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list.d/ubuntu.sources
-RUN sed -i s@/security.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list.d/ubuntu.sources
+RUN sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list
+RUN sed -i s@/security.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list
 
 RUN apt-get update && apt-get install -y \
-    curl zip unzip wget git vim build-essential
+    curl zip unzip wget git vim
 
-# install java
+RUN apt install build-essential -y
+
+# install java 21.0.1-ms
 RUN curl -s "https://get.sdkman.io" | bash
 RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && sdk install java 21.0.1-ms"
 ENV JAVA_HOME /root/.sdkman/candidates/java/21.0.1-ms
-ENV PATH=$PATH:$JAVA_HOME/bin
-
-ENV MAVEN_VERSION=3.9.5 \
-    GRADLE_VERSION=7.5
 
 # install gradle
 RUN wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -P /tmp
@@ -50,13 +51,12 @@ ENV PUB_HOSTED_URL=https://pub.flutter-io.cn
 ENV FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
 
 # install flutter
-ARG FLUTTER_VERSION="3.13.5"
 RUN git clone --branch ${FLUTTER_VERSION} https://github.com/flutter/flutter.git ${FLUTTER_HOME} \
     && cd ${FLUTTER_HOME} \
     && ./bin/flutter precache \
     && ./bin/flutter doctor
 
-# install python
+# install python 3.12.1
 RUN mkdir -p ~/.pip
 RUN echo '\n\
     [global] \n\
@@ -64,50 +64,29 @@ RUN echo '\n\
     index-url=https://mirrors.aliyun.com/pypi/simple/ \n\
     ' > ~/.pip/pip.conf
 
-ARG PYTHON_MAJ_VERSION=3.12
-ARG PYTHON_PATCH_VERSION=1
-ARG PYTHON_VERSION=${PYTHON_MAJ_VERSION}.${PYTHON_PATCH_VERSION}
-
-RUN apt-get update && \
-    apt-get install -y \
-    make \
-    build-essential \
-    libssl-dev \
-    zlib1g-dev \
-    libbz2-dev \
-    libreadline-dev \
-    libsqlite3-dev \
-    curl \
-    llvm \
-    libncurses5-dev \
-    libncursesw5-dev \
-    xz-utils \
-    tk-dev
-RUN curl -O https://mirrors.huaweicloud.com/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \
-    tar xzf Python-${PYTHON_VERSION}.tgz && \
-    rm Python-${PYTHON_VERSION}.tgz && \
-    cd Python-${PYTHON_VERSION} && \
-    ./configure --prefix=/opt/python/${PYTHON_VERSION}/ --enable-optimizations --with-lto --with-computed-gotos --with-system-ffi && \
-    make -j "$(nproc)" && \
-    make altinstall
-
-RUN /opt/python/${PYTHON_VERSION}/bin/python${PYTHON_MAJ_VERSION} -m pip install --upgrade pip setuptools wheel poetry && \
-    ln -s /opt/python/${PYTHON_VERSION}/bin/python${PYTHON_MAJ_VERSION}  /opt/python/${PYTHON_VERSION}/bin/python3 && \
-    ln -s /opt/python/${PYTHON_VERSION}/bin/python${PYTHON_MAJ_VERSION}  /opt/python/${PYTHON_VERSION}/bin/python && \
-    ln -s /opt/python/${PYTHON_VERSION}/bin/pydoc${PYTHON_MAJ_VERSION}   /opt/python/${PYTHON_VERSION}/bin/pydoc && \
-    ln -s /opt/python/${PYTHON_VERSION}/bin/idle${PYTHON_MAJ_VERSION}    /opt/python/${PYTHON_VERSION}/bin/idle && \
-    ln -s /opt/python/${PYTHON_VERSION}/bin/python${PYTHON_MAJ_VERSION}-config /opt/python/${PYTHON_VERSION}/bin/python-config
-ENV PATH=/opt/python/${PYTHON_VERSION}/bin:${PATH}
-
-RUN git clone --depth 1 https://github.com/pyenv/pyenv.git ~/.pyenv && \
-    echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc && \
-    echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc && \
-    echo 'eval "$(pyenv init -)"' >> ~/.bashrc
-
-ENV PATH=$PATH:/root/.pyenv/bin
-ENV PYTHON_BUILD_MIRROR_URL_SKIP_CHECKSUM=1
-ENV PYTHON_BUILD_MIRROR_URL=https://mirrors.huaweicloud.com/python/
-# RUN pyenv install ${PYTHON_VERSION} &&  pyenv global ${PYTHON_VERSION}
+# RUN apt-get install -y software-properties-common
+# RUN add-apt-repository -y ppa:deadsnakes/ppa
+# RUN apt update
+# RUN apt-get install -y python3.12 python3.12-distutils
+# RUN apt install make
+RUN \
+    apt-get update && \
+    apt-get install -y python3 python3-dev python-dev python-pip python3-pip python-virtualenv && \
+    rm -rf /var/lib/apt/lists/*
+# RUN wget http://npm.taobao.org/mirrors/python/3.12.1/Python-3.12.1.tgz
+# RUN tar -zxf Python-3.12.1.tgz && cd Python-3.12.1 && \
+#     mkdir -p /opt/python/3.12.1 && \
+#     ./configure --prefix=/opt/python/3.12.1 --enable-shared --with-ssl --enable-optimizations && \
+#     make && make install && \
+#     cd .. && rm -rf Python-3.12.1*
+# RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3
+
+# RUN curl http://fileshare.yoqi.me/d/DevFiles/Develop/Python/get-pip.py?sign=17C5fjx9l5VpBJ6FCHonje5nEEkylSINsPlKsASVkRc=:1702263152 -o get-pip.py && \
+#     python3 get-pip.py && \
+#     rm get-pip.py
+
+# RUN ln -s /usr/bin/python3.9 /usr/bin/python && \
+#     ln -s /usr/bin/pip3 /usr/bin/pip
 
 # install R
 RUN apt-get update && apt-get install -y \
@@ -118,44 +97,37 @@ RUN apt-get update && apt-get install -y \
     ruby-full rubygems ruby-dev
 
 # install rust
-ENV RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
-ENV RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
-ENV RUSTUP_DIST_ROOT=https://mirrors.ustc.edu.cn/rust-static
-
 RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
 
-# # install .net core 6.0
-# RUN wget http://ftp.us.debian.org/debian/pool/main/i/icu/libicu67_67.1-1_amd64.deb && \
-# dpkg -i libicu67_67.1-1_amd64.deb
-# RUN wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
+# install .net core 6.0
+# RUN wget https://packages.microsoft.com/config/ubuntu/21.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
 #     dpkg -i packages-microsoft-prod.deb && \
 #     rm packages-microsoft-prod.deb && \
 #     apt-get update && \
 #     apt-get install -y apt-transport-https && \
 #     apt-get update && \
-#     apt-get install -y dotnet-sdk-6.0 dotnet-runtime-deps-6.0
+#     apt-get install -y dotnet-sdk-6.0
 
 # install go1.21
 RUN wget https://go.dev/dl/go1.21.4.linux-amd64.tar.gz && \
     tar -C /usr/local -xzf go1.21.4.linux-amd64.tar.gz && \
     rm go1.21.4.linux-amd64.tar.gz
 ENV PATH=$PATH:/usr/local/go/bin
-ENV GOPROXY="https://goproxy.io,direct"
+RUN export GOPROXY="https://goproxy.io,direct"
 
 # install nodejs20
 RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
 RUN apt-get install -y nodejs
 RUN npm config set registry http://registry.npm.taobao.org --global
-# npm config set ELECTRON_MIRROR https://npmmirror.com/mirrors/electron/ --global &&\
-# npm config set ELECTRON_BUILDER_BINARIES_MIRROR https://npmmirror.com/mirrors/electron-builder-binaries/ --global
-RUN npm install -g yarn pnpm serve
+# RUN npm config set ELECTRON_MIRROR https://npmmirror.com/mirrors/electron/ --global
+# RUN npm config set ELECTRON_BUILDER_BINARIES_MIRROR https://npmmirror.com/mirrors/electron-builder-binaries/ --global
+RUN npm install -g yarn pnpm
 
 LABEL email="liuyuqi<liuyuqi.gov@msn.cn>"
 WORKDIR /workspaces
 
 RUN apt-get install -y openssh-server
-RUN apt-get clean && \
-    rm -rf /var/lib/apt/lists/*
+RUN rm -rf /var/lib/apt/lists/*
 
 # 指定字符集支持命令行输入中文(根据需要选择字符集)
 ENV LANG C.UTF-8
@@ -163,22 +135,10 @@ ENV LANGUAGE C.UTF-8
 
 # set path
 RUN echo '\n\
-    export JAVA_HOME=/root/.sdkman/candidates/java/21.0.1-ms \n\
-    export PATH=$PATH:$JAVA_HOME/bin \n\
-    export GRADLE_HOME=/opt/gradle/gradle-${GRADLE_VERSION} \n\
     export PATH=$PATH:$GRADLE_HOME/bin \n\
-    export MAVEN_HOME=/opt/maven/apache-maven-${MAVEN_VERSION} \n\
+    export JAVA_HOME=/usr/local/openjdk-11 \n\
+    export PATH=$PATH:$JAVA_HOME/bin \n\
     export PATH=$PATH:$MAVEN_HOME/bin \n\
-    export FLUTTER_HOME=/opt/flutter \n\
-    export PUB_HOSTED_URL=https://pub.flutter-io.cn \n\
-    export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn \n\
-    export PATH=$PATH:$FLUTTER_HOME/bin \n\
-    export PATH=$PATH:/opt/python/${PYTHON_VERSION}/bin \n\
-    export PYTHON_BUILD_MIRROR_URL_SKIP_CHECKSUM=1 \n\
-    export PYTHON_BUILD_MIRROR_URL=https://mirrors.huaweicloud.com/python/ \n\
-    export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static \n\
-    export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup \n\
-    export RUSTUP_DIST_ROOT=https://mirrors.ustc.edu.cn/rust-static \n\
     export PATH=$PATH:/usr/local/go/bin \n\
     export GOPROXY="https://goproxy.io,direct" \n\
     ' >> ~/.bashrc
@@ -189,6 +149,7 @@ RUN curl -fsSL https://code-server.dev/install.sh | sh &&\
     code-server --install-extension orta.vscode-jest &&\
     code-server --install-extension dbaeumer.vscode-eslint &&\
     code-server --install-extension ms-python.python &&\
+    code-server --install-extension ms-python.vscode-pylance &&\
     code-server --install-extension ms-azuretools.vscode-docker &&\
     code-server --install-extension mhutchie.git-graph &&\
     code-server --install-extension ardisaurus.gitflow-actions-sidebar &&\
@@ -204,9 +165,7 @@ RUN curl -fsSL https://code-server.dev/install.sh | sh &&\
     code-server --install-extension vscjava.vscode-spring-initializr &&\
     echo done
 
-# code-server --install-extension ms-python.vscode-pylance &&\
 # code-server --install-extension ms-dotnettools.csharp &&\
-COPY ./frp /opt/frp
 
 VOLUME [ "/workspaces" ]
 

+ 22 - 0
go/Dockerfile

@@ -1,4 +1,26 @@
 FROM golang:1.19 as builder
+
+
+RUN echo "deb http://mirrors.163.com/debian/ jessie main non-free contrib\n\
+    deb http://mirrors.163.com/debian/ jessie-updates main non-free contrib\n\
+    deb http://mirrors.163.com/debian/ jessie-backports main non-free contrib\n\
+    deb-src http://mirrors.163.com/debian/ jessie main non-free contrib\n\
+    deb-src http://mirrors.163.com/debian/ jessie-updates main non-free contrib\n\
+    deb-src http://mirrors.163.com/debian/ jessie-backports main non-free contrib\n\
+    deb http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib\n\
+    deb-src http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib\n\
+    deb http://ftp.cn.debian.org/debian jessie main" > /etc/apt/sources.list
+
+# install gcc
+RUN apt-get update && apt-get install -y --no-install-recommends \
+    g++ \
+    gcc \
+    libc6-dev \
+    make \
+    pkg-config \
+    && apt-get install -y curl git unzip vim iputils-ping wget \
+    && rm -rf /var/lib/apt/lists/*
+
 WORKDIR /workspaces
 COPY . ./
 ENV GOPROXY=https://goproxy.cn,direct

+ 5 - 0
go/docker-compose.debug.yml

@@ -11,3 +11,8 @@ services:
     ports:
       - 3000:3000
       - 5005:5005
+    logging:
+      driver: 'json-file'
+      options:
+        max-size: '10m'
+        max-file: '1'

+ 26 - 5
java/Dockerfile-build

@@ -1,18 +1,35 @@
 # FROM openjdk:11 as builder
 FROM openjdk:8 as builder
 
-ENV MAVEN_VERSION=3.9.5 \
+ARG MAVEN_VERSION=3.9.5 \
     GRADLE_VERSION=7.3.3
 
+ARG GRADLE_DOWNLOAD_SHA256=98bd5fd2b30e070517e03c51cbb32beee3e2ee1a84003a5a5d748996d4b1b915
+
 # # install gradle
-RUN wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -P /tmp
-RUN unzip -d /opt/gradle /tmp/gradle-*.zip && rm -rf /tmp/gradle-*.zip
+RUN set -o errexit -o nounset \
+    && echo "Downloading Gradle" \
+    && wget -q "https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip" -P /tmp/gradle.zip \
+    \
+    && echo "Checking download hash" \
+    && echo "${GRADLE_DOWNLOAD_SHA256} *gradle.zip" | sha256sum -c - \
+    \
+    && echo "Installing Gradle" \
+    && unzip -d /opt/gradle /tmp/gradle-*.zip && rm -rf /tmp/gradle-*.zip \
+    && ln -s "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle
+
 ENV GRADLE_HOME=/opt/gradle/gradle-${GRADLE_VERSION}
 ENV PATH=$PATH:$GRADLE_HOME/bin
 
 # install maven
-RUN wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.zip -P /tmp
-RUN unzip -d /opt/maven /tmp/apache-maven-*.zip
+RUN set -o errexit -o nounset \
+    && echo "Downloading Maven" \
+    && wget -q "https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.zip" -P /tmp \
+    \
+    && echo "Installing Maven" \
+    && unzip -d /opt/maven /tmp/apache-maven-*.zip && rm -rf /tmp/apache-maven-*.zip \
+    && ln -s "${MAVEN_HOME}/bin/mvn" /usr/bin/mvn
+
 ENV MAVEN_HOME=/opt/maven/apache-maven-${MAVEN_VERSION}
 ENV PATH=$PATH:$MAVEN_HOME/bin
 
@@ -20,4 +37,8 @@ LABEL email="liuyuqi<liuyuqi.gov@msn.cn>"
 WORKDIR /workspaces
 # RUN mvn package
 VOLUME [ "/workspaces" ]
+
+ENV USER_HOME_DIR="/home/gradle"
+ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"
+
 CMD [ "/bin/bash" ]

+ 29 - 0
java/README.md

@@ -0,0 +1,29 @@
+# Java
+
+Dockerfile-build 包含 maven,gradle,ant,java 等工具。
+
+Gradle本地库 `/home/gradle/.gradle`
+Maven本地仓库挂载 `/var/maven/repository`
+
+## Uage
+
+install java, gradle, maven, ant, etc.
+
+java version:
+- 8
+- 11
+- 14
+- 15
+- 16
+- 17
+
+gradle version:
+- 6.8.3
+- 7.0.2
+
+maven version:
+- 3.6.3
+
+ant version:
+- 1.10.9
+

+ 17 - 1
nodejs/Dockerfile

@@ -1,6 +1,22 @@
 FROM node:lts-alpine as base
-RUN apk add --no-cache tini
+
+RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
+
+RUN set -o errexit -o nounset \
+    echo "Installing base package" \
+    && apk --no-cache update && apk --no-cache upgrade \
+    && apk add --no-cache curl bash tzdata tar unzip xz procps wget git openssh \
+    && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
+    echo "Asia/Shanghai" > /etc/timezone \
+    && apk add --no-cache tini \
+    && rm -fr /tmp/* /var/cache/apk/*
+
 ENV NODE_ENV=production
+ENV LANG C.UTF-8
+ENV TZ Asia/Shanghai
+
+RUN npm install -g cnpm --registry=https://registry.npm.taobao.org
+
 USER  node
 WORKDIR /app
 COPY package*.json ./