This commit is contained in:
parent
093371a39a
commit
7e1b593757
@ -4,10 +4,10 @@ FROM golang:1.12-alpine AS builder
|
|||||||
|
|
||||||
ENV MOLE_VERSION=0.4.0
|
ENV MOLE_VERSION=0.4.0
|
||||||
|
|
||||||
RUN apk add --no-cache git curl tar
|
RUN apk add --no-cache git=2.22.0-r0 curl=7.66.0-r0 tar=1.32-r0
|
||||||
|
|
||||||
RUN mkdir /app
|
RUN mkdir /app
|
||||||
RUN curl -L https://github.com/davrodpin/mole/archive/v${MOLE_VERSION}.tar.gz | tar zx -C /app
|
RUN curl -L "https://github.com/davrodpin/mole/archive/v${MOLE_VERSION}.tar.gz" | tar zx -C /app
|
||||||
WORKDIR /app/mole-${MOLE_VERSION}
|
WORKDIR /app/mole-${MOLE_VERSION}
|
||||||
|
|
||||||
# Download dependencies so they can be cached
|
# Download dependencies so they can be cached
|
||||||
@ -16,17 +16,18 @@ RUN go mod download
|
|||||||
# Build static
|
# Build static
|
||||||
ARG GOARCH=amd64
|
ARG GOARCH=amd64
|
||||||
ENV CGO_ENABLED=0 GOOS=linux
|
ENV CGO_ENABLED=0 GOOS=linux
|
||||||
RUN go build -a -ldflags '-X main.version=${MOLE_VERSION}-dockamole' -installsuffix nocgo -o /bin/mole github.com/davrodpin/mole/cmd/mole
|
RUN go build -a -ldflags "-X main.version=${MOLE_VERSION}-dockamole" -installsuffix nocgo -o /bin/mole github.com/davrodpin/mole/cmd/mole
|
||||||
|
|
||||||
# Build client image using target arch
|
# Build client image using target arch
|
||||||
FROM ${REPO}/alpine
|
FROM multiarch/qemu-user-static:4.1.0-1 as qemu-user-static
|
||||||
|
FROM ${REPO}/alpine:3.9
|
||||||
|
|
||||||
# Make multiarch capable
|
# Make multiarch capable
|
||||||
COPY --from=multiarch/qemu-user-static /usr/bin/qemu-* /usr/bin/
|
COPY --from=qemu-user-static /usr/bin/qemu-* /usr/bin/
|
||||||
# Copy mole from builder
|
# Copy mole from builder
|
||||||
COPY --from=builder /bin/mole /usr/bin/mole
|
COPY --from=builder /bin/mole /usr/bin/mole
|
||||||
|
|
||||||
RUN apk --no-cache add bash openssh-client
|
RUN apk --no-cache add bash=4.4.19-r1 openssh-client=7.9_p1-r6
|
||||||
|
|
||||||
RUN mkdir /mole
|
RUN mkdir /mole
|
||||||
RUN adduser -S -h /mole mole
|
RUN adduser -S -h /mole mole
|
||||||
@ -38,6 +39,7 @@ RUN touch /mole/.ssh/config
|
|||||||
# Make a volume to persist keys
|
# Make a volume to persist keys
|
||||||
VOLUME /mole/.ssh
|
VOLUME /mole/.ssh
|
||||||
|
|
||||||
|
# Generate known hosts on first connect
|
||||||
ENV GEN_KNOWN_HOSTS=1
|
ENV GEN_KNOWN_HOSTS=1
|
||||||
|
|
||||||
COPY ./start.sh ./
|
COPY ./start.sh ./
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
ARG REPO=library
|
ARG REPO=library
|
||||||
FROM ${REPO}/alpine
|
FROM multiarch/qemu-user-static:4.1.0-1 as qemu-user-static
|
||||||
|
FROM ${REPO}/alpine:3.9
|
||||||
|
|
||||||
COPY --from=multiarch/qemu-user-static /usr/bin/qemu-* /usr/bin/
|
COPY --from=qemu-user-static /usr/bin/qemu-* /usr/bin/
|
||||||
|
|
||||||
# Install SSH and set up basic config
|
# Install SSH and set up basic config
|
||||||
RUN apk add openssh-server augeas
|
RUN apk add --no-cache openssh-server=7.9_p1-r6 augeas=1.11.0-r0
|
||||||
|
|
||||||
# Create sshd configs
|
# Create sshd configs
|
||||||
RUN mkdir /var/run/sshd
|
RUN mkdir /var/run/sshd
|
||||||
|
Loading…
Reference in New Issue
Block a user