Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 04bba67

Browse files
chris-cronegtardif
authored andcommitted
aci-demo: Rework Dockerfiles
Signed-off-by: Chris Crone <[email protected]>
1 parent c0e5fbb commit 04bba67

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

aci/e2e/aci-demo/web/Dockerfile

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,12 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
# BUILD
15-
FROM ubuntu:latest
16-
17-
# Update and upgrade repo
18-
RUN apt-get update -y -q && apt-get upgrade -y -q
19-
20-
# Install tools we might need
21-
RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y -q curl build-essential ca-certificates git
22-
23-
# Download Go 1.2.2 and install it to /usr/local/go
24-
RUN curl -s https://storage.googleapis.com/golang/go1.2.2.linux-amd64.tar.gz| tar -v -C /usr/local -xz
25-
26-
# Let's people find our Go binaries
27-
ENV PATH $PATH:/usr/local/go/bin
28-
15+
FROM golang:1.16-alpine AS build
2916
COPY dispatcher.go .
30-
RUN go build dispatcher.go
17+
RUN mkdir -p /out && go build -o /out/dispatcher dispatcher.go
3118

19+
FROM alpine AS run
3220
EXPOSE 80
3321
CMD ["/dispatcher"]
34-
3522
COPY static /static/
23+
COPY --from=build /out/dispatcher /dispatcher

aci/e2e/aci_secrets_resources/web/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
FROM golang:1.16-alpine AS build
1919
COPY main.go .
2020
RUN --mount=type=cache,target=/go/pkg/mod \
21-
CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o server main.go
21+
go build -trimpath -ldflags="-s -w" -o server main.go
2222

2323
FROM alpine
2424
RUN apk --no-cache add curl

0 commit comments

Comments
 (0)