Skip to content

Commit

Permalink
Revert "Shrink uptermd Docker image by 5 MB, 20% (#225)" (#228)
Browse files Browse the repository at this point in the history
This reverts commit bb763d6.
  • Loading branch information
owenthereal committed Feb 3, 2024
1 parent 2e48f73 commit 29231fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 30 deletions.
3 changes: 0 additions & 3 deletions .dockerignore

This file was deleted.

34 changes: 7 additions & 27 deletions Dockerfile.uptermd
Original file line number Diff line number Diff line change
@@ -1,43 +1,23 @@
FROM golang:1.21 as builder

RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid 65532 \
noroot

WORKDIR /build

COPY go.mod .
COPY go.sum .

RUN go mod download
RUN go mod verify
FROM golang:alpine as builder

WORKDIR $GOPATH/src/github.com/owenthereal/upterm
COPY . .
ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64
RUN go build -o uptermd ./cmd/uptermd
RUN go install ./cmd/uptermd/...

# Prepare for image
FROM scratch
FROM alpine:latest

MAINTAINER Owen Ou
LABEL org.opencontainers.image.source https://github.com/owenthereal/upterm

RUN adduser -D uptermd
USER uptermd

WORKDIR /app
ENV PATH="/app:${PATH}"

COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /etc/group /etc/group
COPY --from=builder /build/uptermd .

USER noroot:noroot
COPY --from=builder /go/bin/* /app

# sshd
EXPOSE 2222
Expand Down

0 comments on commit 29231fc

Please sign in to comment.