Skip to content

Commit

Permalink
add news
Browse files Browse the repository at this point in the history
  • Loading branch information
helight committed Dec 10, 2019
1 parent 3abcf26 commit 5b46f49
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 10 deletions.
20 changes: 11 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,28 @@ MAINTAINER helight "[email protected]"
#设置root用户为后续命令的执行者
USER root

# RUN rm -rf /etc/apt/sources.list
# RUN echo 'deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse' >> /etc/apt/sources.list
# RUN echo 'deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse' >> /etc/apt/sources.list
# RUN echo 'deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse' >> /etc/apt/sources.list
# RUN echo 'deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse' >> /etc/apt/sources.list
# RUN echo 'deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse' >> /etc/apt/sources.list
RUN rm -rf /etc/apt/sources.list
RUN echo 'deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse' >> /etc/apt/sources.list
RUN echo 'deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse' >> /etc/apt/sources.list
RUN echo 'deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse' >> /etc/apt/sources.list
RUN echo 'deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse' >> /etc/apt/sources.list
RUN echo 'deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse' >> /etc/apt/sources.list

#执行操作
RUN \
apt-get update && \
apt-get install -y build-essential && \
apt-get install -y mariadb-server mariadb-common && \
apt-get install -y git net-tools iputils-ping curl && \
apt-get install -y golang-1.10 golang && \
apt-get install -y nginx && \
apt-get install -y sqlite3 && \
apt-get install -y g++ make autoconf && \
apt-get install -y openssh-server && \
apt-get install -y php7.2 php7.2-common php7.2-json php7.2-readline php7.2-cli php-common
apt-get install -y python3 python3-pip && \
apt-get install -y vim
# apt-get install -y mariadb-server mariadb-common && \
# apt-get install -y php7.2 php7.2-common php7.2-json php7.2-readline php7.2-cli php-common
#对外暴露端口
EXPOSE 80 8080 3306

CMD ["/bin/bash"]
CMD ["/bin/bash"]
12 changes: 12 additions & 0 deletions go_code/go_test2/datacal.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package main
import (
"fmt"
"math"
"strings"
)

func show_data() {
Expand Down Expand Up @@ -40,6 +41,17 @@ func fib() func() int {
}
}

func Interfaces() ([]string, error) {
return nil, nil
}

func split(s string) []string {
/* if s == "" {
return nil
} */
return strings.Split(s, ",")
}

func main() {
fmt.Println("Hello World!")
}
17 changes: 16 additions & 1 deletion go_code/go_test2/datacal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

package main

import "testing"
import (
"fmt"
"testing"
)

func Test_add_num(t *testing.T) {
type args struct {
Expand All @@ -29,6 +32,18 @@ func Test_add_num(t *testing.T) {
}
}

func Test_Interfaces(t *testing.T) {
addrs, _ := Interfaces()
for _, addr := range addrs {
fmt.Println("test: " + addr)
}
}

func Test_split(t *testing.T) {
var tt = ""
te := split(tt)
fmt.Println("te: ", te)
}
func Benchmark_add_num(b *testing.B) {
sum := 0
for i := 0; i < b.N; i++ {
Expand Down

0 comments on commit 5b46f49

Please sign in to comment.