Skip to content

Commit 9ce7256

Browse files
committed
Add convenience aliases to Docker image
Note that you will need to run a login shell so /etc/profile is loaded. If you are starting the image directly, use: docker run -it --rm sshkit-test-sshd /bin/sh -l The "-l" flag will make `sh` behave like a login shell.
1 parent b34c495 commit 9ce7256

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

test/support/docker/Dockerfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
FROM alpine:3.7
22

33
# Set up an Alpine Linux machine running an SSH server.
4-
# Autogenerate missing host keys.
5-
64
RUN apk add --update --no-cache openssh sudo
5+
6+
# Autogenerate missing host keys.
77
RUN ssh-keygen -A
88

99
# Create the skeleton directory, used for creating new users.
10-
1110
RUN mkdir -p /etc/skel/.ssh
1211
RUN chmod 700 /etc/skel/.ssh
13-
1412
RUN touch /etc/skel/.ssh/authorized_keys
1513
RUN chmod 600 /etc/skel/.ssh/authorized_keys
1614

1715
# Allow members of group "wheel" to execute any command.
18-
1916
RUN echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers.d/wheel
2017

2118
# Allow passwordless sudo for users in the "passwordless-sudoers" group.
2219
# Users in this group may run commands as any user in any group.
23-
2420
RUN addgroup -S passwordless-sudoers
2521
RUN echo "%passwordless-sudoers ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers.d/yolo
2622

27-
# Add fixture data for tests
23+
# Add configuration for a better developer experience.
24+
COPY etc/profile.d/* /etc/profile.d
25+
26+
# Add fixture data for tests.
2827
COPY fixtures /fixtures
2928

30-
# Set up a subsystem
29+
# Set up a subsystem.
3130
RUN echo "Subsystem greeting-subsystem echo Hello, who am I talking to?; while :; do read varname; echo It\'s nice to meet you \$varname; done" >> /etc/ssh/sshd_config
3231

33-
# Run SSH daemon and expose the standard SSH port.
32+
# Expose the standard SSH port.
3433
EXPOSE 22
3534

35+
# Run SSH daemon.
3636
CMD ["/usr/sbin/sshd", "-D", "-e"]
3737

3838
# For debugging, let sshd be more verbose:
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
alias la='ls -1A'
2+
alias ll='ls -al'
3+
alias l='ls -1'

0 commit comments

Comments
 (0)