From 9992a49f69b9d3abe8e1a848a0d6a7169d4ced6d Mon Sep 17 00:00:00 2001 From: Dustin Brewer Date: Sun, 1 Mar 2020 01:39:32 +0000 Subject: [PATCH] Go 1.14; Alpine 3.11 --- .devcontainer/Dockerfile | 7 +++++++ .devcontainer/devcontainer.json | 12 ++++-------- .github/workflows/main.yml | 2 +- Dockerfile.template | 4 ++-- 4 files changed, 14 insertions(+), 11 deletions(-) create mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..22a5ec6 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,7 @@ +# Base Build Image +FROM golang:1.14-alpine3.11 +WORKDIR /app +RUN apk add --no-cache --update build-base git mosquitto openssh && \ + git clone https://github.com/magefile/mage && \ + cd mage && go run bootstrap.go install && cd - && \ + rm -rf mage \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b30d15f..35c70f7 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,14 +2,12 @@ // https://github.com/microsoft/vscode-dev-containers/tree/master/containers/go { "name": "Go", - "image": "mannkind/twomqtt-dev", + "dockerFile": "Dockerfile", "runArgs": [ // Uncomment the next line to use a non-root user. On Linux, this will prevent // new files getting created as root, but you may need to update the USER_UID // and USER_GID in .devcontainer/Dockerfile to match your user if not 1000. // "-u", "vscode", - "-v", - "/Users/mannkind/Documents/Projects/homeautomation/twomqtt:/workspaces/twomqtt", "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined", @@ -19,7 +17,7 @@ // Use 'settings' to set *default* container specific settings.json values on container create. // You can edit these settings after create using File > Preferences > Settings > Remote. "settings": { - "terminal.integrated.shell.linux": "/bin/bash", + "terminal.integrated.shell.linux": "/bin/ash", "go.gopath": "/go" }, // Uncomment the next line if you want to publish any ports. @@ -27,9 +25,7 @@ // Uncomment the next line to run commands after the container is created. // "postCreateCommand": "go version", // Add the IDs of extensions you want installed when the container is created in the array below. - "extensions": [ - "ms-vscode.go" - ], + "extensions": ["ms-vscode.go"], // Copy the contents to the correct location and set permissions "postCreateCommand": "mkdir -p ~/.ssh && cp -r ~/.ssh-localhost/* ~/.ssh && chmod 700 ~/.ssh && chmod 600 ~/.ssh/*" -} \ No newline at end of file +} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 29790f2..d869db1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v1 with: - go-version: 1.13 + go-version: 1.14 - name: Install Mage run: | diff --git a/Dockerfile.template b/Dockerfile.template index bf1faf1..ca3253d 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -1,4 +1,4 @@ -FROM golang:1.13-alpine3.10 as build +FROM golang:1.14-alpine3.11 as build WORKDIR /app COPY . . RUN apk add --no-cache --update build-base git && \ @@ -7,7 +7,7 @@ RUN apk add --no-cache --update build-base git && \ rm -rf mage && \ GOOS=linux GOARCH=__GOLANG_ARCH__ mage go:build -FROM __BASEIMAGE_ARCH__/alpine:3.10 +FROM __BASEIMAGE_ARCH__/alpine:3.11 RUN apk add --no-cache --update ca-certificates COPY --from=build /app/__BINARY_NAME__ /usr/local/bin/__BINARY_NAME__ CMD ["__BINARY_NAME__"]