mirror of
https://github.com/thegeeklab/wp-opentofu.git
synced 2024-11-24 23:30:39 +00:00
chore: update instructions and Dockerbuild to work with modules
This commit is contained in:
parent
b9bfc74bcc
commit
a22d272a0b
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
.git
|
16
Dockerfile
16
Dockerfile
@ -1,12 +1,16 @@
|
|||||||
# Docker image for the Drone Terraform plugin
|
# Docker image for the Drone Terraform plugin
|
||||||
#
|
#
|
||||||
# docker build -t jmccann/drone-terraform:latest .
|
# docker build -t jmccann/drone-terraform:latest .
|
||||||
FROM golang:1.10-alpine AS builder
|
FROM golang:1.11-alpine AS builder
|
||||||
COPY ./*.go ./src/
|
|
||||||
COPY ./vendor/ ./src/
|
RUN apk add --no-cache git
|
||||||
RUN set -ex \
|
|
||||||
&& cd ./src \
|
RUN mkdir -p /tmp/drone-terraform
|
||||||
&& CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -o /go/bin/drone-terraform
|
WORKDIR /tmp/drone-terraform
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN go mod download
|
||||||
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -o /go/bin/drone-terraform
|
||||||
|
|
||||||
FROM alpine:3.7
|
FROM alpine:3.7
|
||||||
|
|
||||||
|
13
README.md
13
README.md
@ -10,8 +10,10 @@ a listing of the available options please take a look at [the docs](https://gith
|
|||||||
Build the binary with the following commands:
|
Build the binary with the following commands:
|
||||||
|
|
||||||
```
|
```
|
||||||
go build
|
export GO111MODULE=on
|
||||||
|
go mod download
|
||||||
go test
|
go test
|
||||||
|
go build
|
||||||
```
|
```
|
||||||
|
|
||||||
## Docker
|
## Docker
|
||||||
@ -19,18 +21,9 @@ go test
|
|||||||
Build the docker image with the following commands:
|
Build the docker image with the following commands:
|
||||||
|
|
||||||
```
|
```
|
||||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo
|
|
||||||
docker build --rm=true -t jmccann/drone-terraform .
|
docker build --rm=true -t jmccann/drone-terraform .
|
||||||
```
|
```
|
||||||
|
|
||||||
Please note incorrectly building the image for the correct x64 linux and with
|
|
||||||
GCO disabled will result in an error when running the Docker image:
|
|
||||||
|
|
||||||
```
|
|
||||||
docker: Error response from daemon: Container command
|
|
||||||
'/bin/drone-terraform' not found or does not exist.
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Execute from the working directory:
|
Execute from the working directory:
|
||||||
|
Loading…
Reference in New Issue
Block a user