Browse Source

add allinone dev

liuyuqi-dellpc 1 year ago
parent
commit
aefaa2cc28
4 changed files with 95 additions and 1 deletions
  1. 1 1
      go/README.md
  2. 65 0
      nodejs/.ide/Dockerfile-Allinone
  3. 25 0
      nodejs/.ide/Dockerfile-Allinone2
  4. 4 0
      nodejs/README.md

+ 1 - 1
go/README.md

@@ -10,7 +10,7 @@ alias go='docker run -it --rm -v /workspace/caddy:/workspaces jianboy/go-build:1
 
 # 构建项目
 git clone https://github.com/caddyserver/caddy
-docker run -it --rm -v /workspace/caddy:/workspaces jianboy/go-build:1.20
+docker run -it --rm -v /workspace:/workspaces jianboy/go-build:1.20
 cd caddy/cmd/caddy/
 go build -o caddy
 

+ 65 - 0
nodejs/.ide/Dockerfile-Allinone

@@ -0,0 +1,65 @@
+FROM openjdk:11 as builder
+
+ENV MAVEN_VERSION=3.9.5 \
+    GRADLE_VERSION=7.3.3
+
+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
+
+# 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
+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
+ENV MAVEN_HOME=/opt/maven/apache-maven-${MAVEN_VERSION}
+ENV PATH=$PATH:$MAVEN_HOME/bin
+
+# install python3.8
+# RUN apt-get update && \
+#     apt-get install -y python3.8
+RUN mkdir -p ~/.pip
+RUN echo '\n\
+    [global] \n\
+    trusted-host=mirrors.aliyun.com \n\
+    index-url=https://mirrors.aliyun.com/pypi/simple/ \n\
+    ' > ~/.pip/pip.conf
+
+# 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
+ENV PATH=$PATH:/usr/local/go/bin
+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
+
+LABEL email="liuyuqi<liuyuqi.gov@msn.cn>"
+WORKDIR /workspaces
+# RUN mvn package
+VOLUME [ "/workspaces" ]
+
+RUN apt-get install -y wget unzip openssh-server
+RUN ln -s /usr/bin/python3.9  /usr/bin/python
+
+# 指定字符集支持命令行输入中文(根据需要选择字符集)
+ENV LANG C.UTF-8
+ENV LANGUAGE C.UTF-8
+
+# set path
+RUN echo '\n\
+    export PATH=$PATH:$GRADLE_HOME/bin \n\
+    export JAVA_HOME=/usr/local/openjdk-11 \n\
+    export PATH=$PATH:$JAVA_HOME/bin \n\
+    export PATH=$PATH:$MAVEN_HOME/bin \n\
+    export PATH=$PATH:/usr/local/go/bin \n\
+    export GOPROXY="https://goproxy.io,direct" \n\
+    ' >> ~/.bashrc
+
+CMD [ "/bin/bash" ]

+ 25 - 0
nodejs/.ide/Dockerfile-Allinone2

@@ -0,0 +1,25 @@
+FROM sift-docker.pkg.coding.net/flutter-team/dev-container/dev-allinone:1.0.1
+
+# install vscode and extension
+RUN curl -fsSL https://code-server.dev/install.sh | sh &&\
+    code-server --install-extension redhat.vscode-yaml &&\
+    code-server --install-extension orta.vscode-jest &&\
+    code-server --install-extension dbaeumer.vscode-eslint &&\
+    code-server --install-extension eamodio.gitlens &&\
+    echo done
+
+# RUN apt-get update && apt-get install -y wget unzip openssh-server
+
+# 指定字符集支持命令行输入中文(根据需要选择字符集)
+ENV LANG C.UTF-8
+ENV LANGUAGE C.UTF-8
+
+# set path
+RUN echo '\n\
+    export PATH=$PATH:$GRADLE_HOME/bin \n\
+    export JAVA_HOME=/usr/local/openjdk-11 \n\
+    export PATH=$PATH:$JAVA_HOME/bin \n\
+    export PATH=$PATH:$MAVEN_HOME/bin \n\
+    export PATH=$PATH:/usr/local/go/bin \n\
+    export GOPROXY="https://goproxy.io,direct" \n\
+    ' >> ~/.bashrc

+ 4 - 0
nodejs/README.md

@@ -18,6 +18,7 @@
 # 构建镜像
 docker build -t jianboy/node-build:20 .
 
+docker build -t jianboy/dev-allinone:1.0.1 .
 
 # 构建项目
 git clone https://gitee.com/dromara/mayfly-go
@@ -25,4 +26,7 @@ docker run -it --rm -v /workspace:/workspaces jianboy/node-build:20
 
 yarn build
 
+
+docker build -t sift-docker.pkg.coding.net/flutter-team/dev-container/dev-allinone:1.0.3 .
+
 ```