diff options
Diffstat (limited to '')
-rw-r--r-- | Dockerfile_i386 | 11 | ||||
-rw-r--r-- | Dockerfile_x86-64 | 11 | ||||
-rw-r--r-- | Makefile | 18 |
3 files changed, 40 insertions, 0 deletions
diff --git a/Dockerfile_i386 b/Dockerfile_i386 new file mode 100644 index 0000000..b5c6dd1 --- /dev/null +++ b/Dockerfile_i386 @@ -0,0 +1,11 @@ +FROM i386/centos:7 +ENV PATH $PATH:/usr/local/go/bin +RUN linux32 sh -c 'yum install -y gcc git pam-devel \ + && curl -o go1.10.3.linux-386.tar.gz https://dl.google.com/go/go1.10.3.linux-386.tar.gz \ + && tar -C /usr/local -xzf go1.10.3.linux-386.tar.gz \ + && go get github.com/msteinert/pam \ + && go get github.com/nmcclain/asn1-ber \ + && go get github.com/nmcclain/ldap' +COPY src /root/go/src +RUN linux32 sh -c 'cd /root/go/src \ + && go build -a pamldapd.go' diff --git a/Dockerfile_x86-64 b/Dockerfile_x86-64 new file mode 100644 index 0000000..0a1902d --- /dev/null +++ b/Dockerfile_x86-64 @@ -0,0 +1,11 @@ +FROM centos:7 +ENV PATH $PATH:/usr/local/go/bin +RUN yum install -y gcc git pam-devel \ + && curl -o go1.10.3.linux-amd64.tar.gz https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz \ + && tar -C /usr/local -xzf go1.10.3.linux-amd64.tar.gz \ + && go get github.com/msteinert/pam \ + && go get github.com/nmcclain/asn1-ber \ + && go get github.com/nmcclain/ldap +COPY src /root/go/src +RUN cd /root/go/src \ + && go build -a pamldapd.go diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cd9c983 --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +.DEFAULT_GOAL := default + +all: x86-64 i386 +default: x86-64 +x86-64: x86-64.build +i386: i386.build +%.build: src/pamldapd.go + @echo BUILD ARCH $(shell basename $@ .build) + docker build -t pamldapd-build-$(shell basename $@ .build)-tmp -f Dockerfile_$(shell basename $@ .build) . + docker run --name pamldapd-build-$(shell basename $@ .build)-tmp pamldapd-build-$(shell basename $@ .build)-tmp + docker wait pamldapd-build-$(shell basename $@ .build)-tmp + docker cp pamldapd-build-$(shell basename $@ .build)-tmp:/root/go/src/pamldapd pamldapd-$(shell basename $@ .build) + docker rm pamldapd-build-$(shell basename $@ .build)-tmp + +clean: x86-64.clean i386.clean +%.clean: + @echo CLEAN ARCH $(shell basename $@ .build) + docker rmi pamldapd-build-$(shell basename $@ .build)-tmp || true |