Skip to content

Commit

Permalink
Merge branch 'v2.0' (87 commits)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnovack committed Nov 25, 2020
2 parents c17afbb + a95642d commit 1cb6609
Show file tree
Hide file tree
Showing 22 changed files with 1,106 additions and 185 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
config/
manifest-tool*
qemu-*-static
2 changes: 1 addition & 1 deletion AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Authors

Justin J. Novack <jnovack@gmail.com> (@jnovack)
- [Justin J. Novack](https://github.com/jnovack)
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# jnovack/autossh

## v2.0.0

### Breaking Changes in v2.0.0

A number of breaking changes were made which requried a version bump.

- Renamed lots of confusing variables names to less confusing variable names
- `SSH_TUNNEL_HOST` to `SSH_TARGET_HOST`
- `SSH_TUNNEL_LOCAL` to `SSH_TARGET_PORT`
- `SSH_TUNNEL_REMOTE` to `SSH_TUNNEL_PORT`
- `SSH_HOSTUSER` to `SSH_REMOTE_USER`
- `SSH_HOSTNAME` to `SSH_REMOTE_HOST`
- `SSH_HOSTPORT` to `SSH_REMOTE_PORT`
- `SERVER_ALIVE_INTERVAL` to `SSH_SERVER_ALIVE_INTERVAL`
- `SERVER_ALIVE_COUNT_MAX` to `SSH_SERVER_ALIVE_COUNT_MAX`

- Docker Swarm compatibility
- Renamed `SSH_KNOWN_HOSTS` to `SSH_KNOWN_HOSTS_FILE`

## v1.2.0

- Image is now runnable as non-root user
- Allowed `autossh` variables to be configurable
- `AUTOSSH_PIDFILE`
- `AUTOSSH_POLL`
- `AUTOSSH_GATETIME`
- `AUTOSSH_FIRST_POLL`
- `AUTOSSH_LOGLEVEL`
- `AUTOSSH_LOGFILE`
- Allowed `ssh` variables to be configurable
- `SERVER_ALIVE_INTERVAL`
- `SERVER_ALIVE_COUNT_MAX`

## v1.0.0

- Actually works
11 changes: 9 additions & 2 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# Contributors

* [@ccremer](https://github.com/ccremer)
* Lukas Plevac <LukasPlevac@gmail.com>
- [@ccremer](https://github.com/ccremer)
- [Christian Gahlert](https://github.com/chrisgahlert)
- [Jan Piskvor Martinec](https://github.com/Piskvor)
- [Lukas Plevac](https://github.com/Lukas0025)
- [Shyam Sunder](https://github.com/sgsunder)

## Special Thanks

- [Alexandre Fayolle](https://github.com/gurneyalex)
43 changes: 27 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
FROM alpine:latest

ARG BUILD_RFC3339
ARG COMMIT
ARG VERSION
LABEL org.opencontainers.image.ref.name="jnovack/autossh" \
org.opencontainers.image.created=$BUILD_RFC3339 \
org.opencontainers.image.authors="Justin J. Novack <jnovack@gmail.com>" \
org.opencontainers.image.documentation="https://github.com/jnovack/docker-autossh/README.md" \
org.opencontainers.image.description="Highly customizable AutoSSH docker container." \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.source="https://github.com/jnovack/docker-autossh" \
org.opencontainers.image.revision=$COMMIT \
org.opencontainers.image.version=$VERSION \
org.opencontainers.image.url="https://hub.docker.com/r/jnovack/autossh/"
ARG APPLICATION="myapp"
ARG BUILD_RFC3339="1970-01-01T00:00:00Z"
ARG REVISION="local"
ARG DESCRIPTION="no description"
ARG PACKAGE="user/repo"
ARG VERSION="dirty"

LABEL org.opencontainers.image.ref.name="${PACKAGE}" \
org.opencontainers.image.created=$BUILD_RFC3339 \
org.opencontainers.image.authors="Justin J. Novack <jnovack@gmail.com>" \
org.opencontainers.image.documentation="https://github.com/${PACKAGE}/README.md" \
org.opencontainers.image.description="${DESCRIPTION}" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.source="https://github.com/${PACKAGE}" \
org.opencontainers.image.revision=$REVISION \
org.opencontainers.image.version=$VERSION \
org.opencontainers.image.url="https://hub.docker.com/r/${PACKAGE}/"

RUN \
apk --no-cache add \
autossh \
net-tools \
dumb-init && \
chmod g+w /etc/passwd

Expand All @@ -29,7 +32,15 @@ ENV \
AUTOSSH_LOGLEVEL=0 \
AUTOSSH_LOGFILE=/dev/stdout

COPY /entrypoint.sh /entrypoint.sh
COPY /version.sh /version.sh
ENV \
APPLICATION="${APPLICATION}" \
BUILD_RFC3339="${BUILD_RFC3339}" \
REVISION="${REVISION}" \
DESCRIPTION="${DESCRIPTION}" \
PACKAGE="${PACKAGE}" \
VERSION="${VERSION}"

COPY ./rootfs/entrypoint.sh /entrypoint.sh
COPY ./rootfs/version.sh /version.sh

ENTRYPOINT [ "/entrypoint.sh" ]
49 changes: 49 additions & 0 deletions Dockerfile.arm32v6
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
FROM arm32v6/alpine:latest

# Copy downloaded architecture emulation static binary
COPY qemu-arm-static /usr/bin/

ARG APPLICATION="myapp"
ARG BUILD_RFC3339="1970-01-01T00:00:00Z"
ARG REVISION="local"
ARG DESCRIPTION="no description"
ARG PACKAGE="user/repo"
ARG VERSION="dirty"

LABEL org.opencontainers.image.ref.name="${PACKAGE}" \
org.opencontainers.image.created=$BUILD_RFC3339 \
org.opencontainers.image.authors="Justin J. Novack <jnovack@gmail.com>" \
org.opencontainers.image.documentation="https://github.com/${PACKAGE}/README.md" \
org.opencontainers.image.description="${DESCRIPTION}" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.source="https://github.com/${PACKAGE}" \
org.opencontainers.image.revision=$REVISION \
org.opencontainers.image.version=$VERSION \
org.opencontainers.image.url="https://hub.docker.com/r/${PACKAGE}/"

RUN \
apk --no-cache add \
autossh \
dumb-init && \
chmod g+w /etc/passwd

ENV \
AUTOSSH_PIDFILE=/tmp/autossh.pid \
AUTOSSH_POLL=30 \
AUTOSSH_GATETIME=30 \
AUTOSSH_FIRST_POLL=30 \
AUTOSSH_LOGLEVEL=0 \
AUTOSSH_LOGFILE=/dev/stdout

ENV \
APPLICATION="${APPLICATION}" \
BUILD_RFC3339="${BUILD_RFC3339}" \
REVISION="${REVISION}" \
DESCRIPTION="${DESCRIPTION}" \
PACKAGE="${PACKAGE}" \
VERSION="${VERSION}"

COPY ./rootfs/entrypoint.sh /entrypoint.sh
COPY ./rootfs/version.sh /version.sh

ENTRYPOINT [ "/entrypoint.sh" ]
57 changes: 32 additions & 25 deletions Dockerfile.arm32v7
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
FROM alpine:latest AS builder

RUN apk --update --no-cache add curl tar && \
curl -L https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-arm.tar.gz | tar zxvf - -C . && mv qemu-3.0.0+resin-arm/qemu-arm-static .

FROM arm32v7/alpine:latest

# Copy across the qemu binary that was downloaded in the previous build step
COPY --from=builder /qemu-arm-static /usr/bin

ARG BUILD_RFC3339
ARG COMMIT
ARG VERSION
LABEL org.opencontainers.image.ref.name="jnovack/autossh" \
org.opencontainers.image.created=$BUILD_RFC3339 \
org.opencontainers.image.authors="Justin J. Novack <jnovack@gmail.com>" \
org.opencontainers.image.documentation="https://github.com/jnovack/docker-autossh/README.md" \
org.opencontainers.image.description="Highly customizable AutoSSH docker container." \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.source="https://github.com/jnovack/docker-autossh" \
org.opencontainers.image.revision=$COMMIT \
org.opencontainers.image.version=$VERSION \
org.opencontainers.image.url="https://hub.docker.com/r/jnovack/autossh/"
# Copy downloaded architecture emulation static binary
COPY qemu-arm-static /usr/bin/

ARG APPLICATION="myapp"
ARG BUILD_RFC3339="1970-01-01T00:00:00Z"
ARG REVISION="local"
ARG DESCRIPTION="no description"
ARG PACKAGE="user/repo"
ARG VERSION="dirty"

LABEL org.opencontainers.image.ref.name="${PACKAGE}" \
org.opencontainers.image.created=$BUILD_RFC3339 \
org.opencontainers.image.authors="Justin J. Novack <jnovack@gmail.com>" \
org.opencontainers.image.documentation="https://github.com/${PACKAGE}/README.md" \
org.opencontainers.image.description="${DESCRIPTION}" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.source="https://github.com/${PACKAGE}" \
org.opencontainers.image.revision=$REVISION \
org.opencontainers.image.version=$VERSION \
org.opencontainers.image.url="https://hub.docker.com/r/${PACKAGE}/"

RUN \
apk --no-cache add \
autossh \
net-tools \
dumb-init && \
autossh \
dumb-init && \
chmod g+w /etc/passwd

ENV \
Expand All @@ -37,6 +35,15 @@ ENV \
AUTOSSH_LOGLEVEL=0 \
AUTOSSH_LOGFILE=/dev/stdout

COPY /entrypoint.sh /entrypoint.sh
ENV \
APPLICATION="${APPLICATION}" \
BUILD_RFC3339="${BUILD_RFC3339}" \
REVISION="${REVISION}" \
DESCRIPTION="${DESCRIPTION}" \
PACKAGE="${PACKAGE}" \
VERSION="${VERSION}"

COPY ./rootfs/entrypoint.sh /entrypoint.sh
COPY ./rootfs/version.sh /version.sh

ENTRYPOINT [ "/entrypoint.sh" ]
49 changes: 49 additions & 0 deletions Dockerfile.arm64v8
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
FROM arm64v8/alpine:latest

# Copy downloaded architecture emulation static binary
COPY qemu-aarch64-static /usr/bin/

ARG APPLICATION="myapp"
ARG BUILD_RFC3339="1970-01-01T00:00:00Z"
ARG REVISION="local"
ARG DESCRIPTION="no description"
ARG PACKAGE="user/repo"
ARG VERSION="dirty"

LABEL org.opencontainers.image.ref.name="${PACKAGE}" \
org.opencontainers.image.created=$BUILD_RFC3339 \
org.opencontainers.image.authors="Justin J. Novack <jnovack@gmail.com>" \
org.opencontainers.image.documentation="https://github.com/${PACKAGE}/README.md" \
org.opencontainers.image.description="${DESCRIPTION}" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.source="https://github.com/${PACKAGE}" \
org.opencontainers.image.revision=$REVISION \
org.opencontainers.image.version=$VERSION \
org.opencontainers.image.url="https://hub.docker.com/r/${PACKAGE}/"

RUN \
apk --no-cache add \
autossh \
dumb-init && \
chmod g+w /etc/passwd

ENV \
AUTOSSH_PIDFILE=/tmp/autossh.pid \
AUTOSSH_POLL=30 \
AUTOSSH_GATETIME=30 \
AUTOSSH_FIRST_POLL=30 \
AUTOSSH_LOGLEVEL=0 \
AUTOSSH_LOGFILE=/dev/stdout

ENV \
APPLICATION="${APPLICATION}" \
BUILD_RFC3339="${BUILD_RFC3339}" \
REVISION="${REVISION}" \
DESCRIPTION="${DESCRIPTION}" \
PACKAGE="${PACKAGE}" \
VERSION="${VERSION}"

COPY ./rootfs/entrypoint.sh /entrypoint.sh
COPY ./rootfs/version.sh /version.sh

ENTRYPOINT [ "/entrypoint.sh" ]
27 changes: 22 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
.PHONY: build
include variables.mk

build:
IMAGE_NAME=jnovack/autossh:dev hooks/build
.PHONY: build all
.DEFAULT_GOAL := all

clean:
docker rmi jnovack/autossh:dev
all: build

test:
echo $(PACKAGE)

docker-nuke:
docker-compose -f docker-compose.test.yml down --rmi all --remove-orphans -v

docker-clean:
docker-compose -f docker-compose.test.yml down --remove-orphans -v

docker-down:
docker-compose -f docker-compose.test.yml down

docker-up:
docker-compose -f docker-compose.test.yml up

docker-test:
docker-compose -f docker-compose.test.yml up --exit-code-from sut
Loading

0 comments on commit 1cb6609

Please sign in to comment.