Skip to content

Commit

Permalink
Merge pull request #11 from mannkind/develop
Browse files Browse the repository at this point in the history
Go 1.14; Alpine 3.11
  • Loading branch information
mannkind authored Mar 1, 2020
2 parents 282414a + 9992a49 commit ab95a03
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
7 changes: 7 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
12 changes: 4 additions & 8 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -19,17 +17,15 @@
// 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.
// "appPort": [],
// 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/*"
}
}
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.template
Original file line number Diff line number Diff line change
@@ -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 && \
Expand All @@ -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__"]

0 comments on commit ab95a03

Please sign in to comment.