Browse Source

first commit

rubyangxg 4 years ago
commit
c799bf63bb
4 changed files with 124 additions and 0 deletions
  1. 7 0
      Dockerfile
  2. 46 0
      build.sh
  3. 3 0
      readme.txt
  4. 68 0
      settings.xml

+ 7 - 0
Dockerfile

@@ -0,0 +1,7 @@
+FROM java:8-alpine
+
+COPY . /container
+RUN /container/build.sh
+
+ENV LD_PRELOAD /usr/local/lib/faketime/libfaketime.so.1
+ENV FAKETIME_DONT_FAKE_MONOTONIC 1

+ 46 - 0
build.sh

@@ -0,0 +1,46 @@
+#!/bin/sh -ex
+
+#set aliyun source
+#sed -i 's/dl-cdn.alpinelinux.org/mirrors.cloud.tencent.com/g' /etc/apk/repositories
+sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
+
+apk add --update ca-certificates && rm -rf /var/cache/apk/* &&
+  find /usr/share/ca-certificates/mozilla/ -name "*.crt" -exec keytool -import -trustcacerts \
+    -keystore /usr/lib/jvm/java-1.8-openjdk/jre/lib/security/cacerts -storepass changeit -noprompt \
+    -file {} -alias {} \; &&
+  keytool -list -keystore /usr/lib/jvm/java-1.8-openjdk/jre/lib/security/cacerts --storepass changeit
+
+MAVEN_VERSION=3.5.4
+MAVEN_HOME=/usr/lib/mvn
+export PATH=$MAVEN_HOME/bin:$PATH
+
+wget http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz &&
+  tar -zxvf apache-maven-$MAVEN_VERSION-bin.tar.gz &&
+  rm apache-maven-$MAVEN_VERSION-bin.tar.gz &&
+  mv apache-maven-$MAVEN_VERSION /usr/lib/mvn
+
+#set easou private repository
+mv /usr/lib/mvn/conf/settings.xml /usr/lib/mvn/conf/settings.xml.bak
+mv /container/settings.xml /usr/lib/mvn/conf/
+
+#install svn
+apk add --update subversion
+
+#other
+apk add --update bash python3 py-yaml openssl curl net-tools iproute2 bash-completion bash-doc tzdata
+
+#install make env
+apk add --update alpine-sdk
+
+cp "/usr/share/zoneinfo/Asia/Shanghai" /etc/localtime
+echo "Asia/Shanghai" >/etc/timezone
+
+#添加改系统时间的库 https://github.com/wolfcw/libfaketime
+git clone https://github.com/wolfcw/libfaketime.git src
+cd src
+make install
+touch ~/.faketimerc
+#LD_PRELOAD=/usr/local/lib/faketime/libfaketime.so.1 FAKETIME="-15d" date
+
+rm -rf /var/cache/apk/*
+rm -rf /tmp/* /var/tmp/*

+ 3 - 0
readme.txt

@@ -0,0 +1,3 @@
+docker build -t hub.evbj.easou.com/pro/base-alpine:latest -t hub.evbj.easou.com/pro/base-alpine:v1.0 .
+docker push hub.evbj.easou.com/pro/base-alpine:v1.0
+docker push hub.evbj.easou.com/pro/base-alpine:latest

+ 68 - 0
settings.xml

@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
+    <mirrors>
+        <mirror>
+            <id>nexus</id>
+            <mirrorOf>central</mirrorOf>
+            <url>http://mvn2.evbj.easou.com/repository/public-repositories/</url>
+        </mirror>
+    </mirrors>
+
+
+    <servers>
+        <server>
+            <id>releases</id>
+            <username>alex</username>
+            <password>alex2011</password>
+        </server>
+        <server>
+            <id>Snapshots</id>
+            <username>alex</username>
+            <password>alex2011</password>
+        </server>
+        <server>
+            <id>nexus</id>
+            <username>alex</username>
+            <password>alex2011</password>
+        </server>
+    </servers>
+
+    <profiles>
+        <profile>
+            <id>nexus</id>
+            <!--Enable snapshots for the built in central repo to direct -->
+            <!--all requests to nexus via the mirror -->
+            <repositories>
+                <repository>
+                    <id>central</id>
+                    <url>http://mvn2.evbj.easou.com/repository/public-repositories</url>
+                    <releases>
+                        <enabled>true</enabled>
+                    </releases>
+                    <snapshots>
+                        <enabled>true</enabled>
+                    </snapshots>
+                </repository>
+            </repositories>
+            <pluginRepositories>
+                <pluginRepository>
+                    <id>centralplugin</id>
+                    <url>http://mvn2.evbj.easou.com/repository/public-repositories</url>
+                    <releases>
+                        <enabled>true</enabled>
+                    </releases>
+                    <snapshots>
+                        <enabled>true</enabled>
+                    </snapshots>
+                </pluginRepository>
+            </pluginRepositories>
+        </profile>
+    </profiles>
+    <activeProfiles>
+        <!--make the profile active all the time -->
+        <activeProfile>nexus</activeProfile>
+    </activeProfiles>
+</settings>
+