Skip to content

Commit

Permalink
Varias etapas para contruir en base a golang:alpine #61
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroMFC committed Nov 19, 2020
1 parent 6dbff1c commit 31c6bf8
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Contenedor para ejecutar los tests tomando com base la imagen oficial del lenguaje de GO
# Es necesario instalar Task y curl (este lo eliminamos después)

FROM golang:alpine
LABEL maintainer="Pedro Flores <pedro_23_96@hotmail.com>"
LABEL version="0.1.1"
# PRIMERA ETAPA
FROM golang:alpine AS BUILD_IMAGE

# Move to working directory
WORKDIR ../
Expand All @@ -13,6 +12,16 @@ RUN apk --no-cache add curl \
&& sh -c "$(curl -ssL https://taskfile.dev/install.sh)" -- -d \
&& apk del curl


# SEGUNDA ETAPA
FROM golang:alpine
LABEL maintainer="Pedro Flores <pedro_23_96@hotmail.com>"
LABEL version="0.1.2"

# Copiamos la carpeta en la que se ha descargado el gestor de tareas
COPY --from=BUILD_IMAGE /bin/task ./bin


# Añadimos el nuevo usuario que será el que ejecute los tests
RUN adduser -D evaluaugr \
&& addgroup -S evaluaugr evaluaugr
Expand Down

0 comments on commit 31c6bf8

Please sign in to comment.