File: create-base-image

package info (click to toggle)
erlang 1%3A23.2.6%2Bdfsg-1%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 199,804 kB
  • sloc: erlang: 1,509,787; xml: 412,313; ansic: 393,504; cpp: 51,923; makefile: 18,193; sh: 13,051; lisp: 9,681; java: 8,061; python: 5,195; perl: 4,322; asm: 3,586; pascal: 3,435; javascript: 595; sed: 72; php: 2
file content (38 lines) | stat: -rwxr-xr-x 1,029 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

UBUNTU_VER=${1:-16.04}

USER=sshtester
PWD=foobar

docker build \
    -t ubuntubuildbase \
    --build-arg https_proxy=$HTTPS_PROXY \
    --build-arg http_proxy=$HTTP_PROXY \
    - <<EOF

    FROM ubuntu:$UBUNTU_VER
    WORKDIR /buildroot

    # Prepare for installing OpenSSH
    RUN apt-get update
    RUN apt-get upgrade -y
    RUN apt-get -y install apt-utils
    RUN apt-get -y install build-essential zlib1g-dev
    RUN apt-get -y install sudo iputils-ping tcptraceroute net-tools
    RUN apt-get -y install sshpass expect
    RUN apt-get -y install libpam0g-dev

    # A user for the tests
    RUN (echo $PWD; echo $PWD; echo; echo; echo; echo; echo; echo ) | adduser $USER
    RUN adduser $USER sudo

    # Prepare the privsep preauth environment for openssh
    RUN  mkdir -p /var/empty
    RUN  chown root:sys /var/empty
    RUN  chmod 755 /var/empty
    RUN  groupadd -f sshd
    RUN  ls /bin/false
    RUN  id -u sshd 2> /dev/null || useradd -g sshd -c 'sshd privsep' -d /var/empty -s /bin/false sshd

EOF