Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ _testmain.go

# main executable on linux
terraform-provider-ldap

# ignore the binary copied from docker build container
bin/terraform-provider-ldap
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM golang:1.11.3-stretch
COPY . /go/src/terraform-provider-ldap
WORKDIR /go/src/terraform-provider-ldap
RUN go get .
RUN CGO_ENABLED=0 GOOS=linux go install -a -ldflags '-s -w -extldflags "-static"' .
ENTRYPOINT ["/bin/cp", "-v", "/go/bin/terraform-provider-ldap", "/out"]
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,44 @@ Then merge this file into your existing ```.tf``` file(s).
## Limitations

This provider supports TLS, but certificate verification is not enabled yet; all
connections are through TCP, no UDP support yet.
connections are through TCP, no UDP support yet.

## Docker build image

You can build the final binary by calling the ```./build.sh``` which uses
Docker, and copies the resulting binary ```terraform-provider-ldap``` to the
```bin``` directory:

```
$ ./build.sh
================================================================
Building docker image...
================================================================
Sending build context to Docker daemon 172.5kB
Step 1/6 : FROM golang:1.11.3-stretch
---> bbf428bade77
Step 2/6 : COPY . /go/src/terraform-provider-ldap
---> 97272b52a9b6
Step 3/6 : WORKDIR /go/src/terraform-provider-ldap
---> Running in 3935be9d7ea3
Removing intermediate container 3935be9d7ea3
---> 72cc7041aec9
Step 4/6 : RUN go get .
---> Running in 5c00c77b9f91
Removing intermediate container 5c00c77b9f91
---> aeb8bb9c41b9
Step 5/6 : RUN CGO_ENABLED=0 GOOS=linux go install -a -ldflags '-extldflags "-static"' .
---> Running in df11c6d06069
Removing intermediate container df11c6d06069
---> 61bc6ebab4dd
Step 6/6 : ENTRYPOINT ["/bin/cp", "-v", "/go/bin/terraform-provider-ldap", "/out"]
---> Running in 7964106bed59
Removing intermediate container 7964106bed59
---> 807743cb8cef
Successfully built 807743cb8cef
Successfully tagged terraform-provider-ldap:latest
================================================================
Copying the binary...
================================================================
'/go/bin/terraform-provider-ldap' -> '/out/terraform-provider-ldap'
```
Empty file added bin/.gitkeepme
Empty file.
13 changes: 13 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -e

banner() {
echo "================================================================"
echo "$1"
echo "================================================================"
}

banner "Building docker image..."
docker build -t terraform-provider-ldap .
banner "Copying the binary..."
docker run -v ${PWD}/bin:/out:rw terraform-provider-ldap