mirror of
https://github.com/thegeeklab/wp-opentofu.git
synced 2024-11-24 13:20: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 build -t jmccann/drone-terraform:latest .
|
||||
FROM golang:1.10-alpine AS builder
|
||||
COPY ./*.go ./src/
|
||||
COPY ./vendor/ ./src/
|
||||
RUN set -ex \
|
||||
&& cd ./src \
|
||||
&& CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -o /go/bin/drone-terraform
|
||||
FROM golang:1.11-alpine AS builder
|
||||
|
||||
RUN apk add --no-cache git
|
||||
|
||||
RUN mkdir -p /tmp/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
|
||||
|
||||
|
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:
|
||||
|
||||
```
|
||||
go build
|
||||
export GO111MODULE=on
|
||||
go mod download
|
||||
go test
|
||||
go build
|
||||
```
|
||||
|
||||
## Docker
|
||||
@ -19,18 +21,9 @@ go test
|
||||
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 .
|
||||
```
|
||||
|
||||
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
|
||||
|
||||
Execute from the working directory:
|
||||
|
Loading…
Reference in New Issue
Block a user