add configuration to use nginx-golang-postgres sample with Docker Dev Environments feature

Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
This commit is contained in:
Guillaume Lours
2022-06-29 22:19:09 +02:00
parent 8784f95a69
commit d189dc884d
5 changed files with 78 additions and 6 deletions

View File

@@ -1,9 +1,29 @@
FROM golang:1.13-alpine AS build
# syntax=docker/dockerfile:1.4
FROM --platform=$BUILDPLATFORM golang:1.18 AS build
WORKDIR /go/src/github.com/org/repo
COPY go.* .
COPY . .
ENV CGO_ENABLED=0
RUN go build -o server .
FROM build as dev-envs
RUN <<EOF
apt-get update
apt-get install -y --no-install-recommends git
EOF
RUN <<EOF
useradd -s /bin/bash -m vscode
groupadd docker
usermod -aG docker vscode
EOF
# install Docker tools (cli, buildx, compose)
COPY --from=gloursdocker/docker / /
CMD ["go", "run", "main.go"]
FROM alpine:3.12
EXPOSE 8000
COPY --from=build /go/src/github.com/org/repo/server /server