Browse Source

Merge branch 'master' into develop

# Conflicts:
#	flutter/.ide/Dockerfile-Allinone-flutter
liuyuqi-dellpc 10 months ago
parent
commit
908bdfb6da

+ 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

+ 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 ./