mirror of
https://github.com/docker/awesome-compose.git
synced 2025-04-26 10:43:35 +02:00
add configuration to use traefik-golang sample with Docker Dev Environments feature (#254)
* add configuration to use traefik-golang sample with Docker Dev Environments feature * use apt-get instead of apt and --no-install-recommends option Co-authored-by: Milas Bowman <milasb@gmail.com> Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
This commit is contained in:
parent
70b1d1f65f
commit
6ac068dfc6
3 changed files with 49 additions and 1 deletions
|
@ -1,9 +1,27 @@
|
|||
FROM golang:1.13 AS build
|
||||
# syntax=docker/dockerfile:1.4
|
||||
|
||||
FROM --platform=$BUILDPLATFORM golang:1.18 AS build
|
||||
|
||||
WORKDIR /compose/hello-docker
|
||||
COPY main.go main.go
|
||||
RUN CGO_ENABLED=0 go build -o backend main.go
|
||||
|
||||
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 scratch
|
||||
COPY --from=build /compose/hello-docker/backend /usr/local/bin/backend
|
||||
CMD ["/usr/local/bin/backend"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue