|
| 1 | +# syntax=docker/dockerfile:1 |
| 2 | + |
| 3 | +# This image is based on the existing powershell-runtime image. |
| 4 | +# Set any of the arguments as needed in case you customized the image details. |
| 5 | +ARG REGISTRY=<account>.dkr.ecr.<region>.amazonaws.com |
| 6 | +ARG RUNTIME_IMAGE=${REGISTRY}/powershell-remoting |
| 7 | +ARG RUNTIME_TAG=latest |
| 8 | +ARG RUNTIME=${RUNTIME_IMAGE}:${RUNTIME_TAG} |
| 9 | + |
| 10 | +FROM ${RUNTIME} as build |
| 11 | + |
| 12 | +WORKDIR /tmp |
| 13 | + |
| 14 | +# These build dependencies are documented here: |
| 15 | +# https://github.com/gssapi/gss-ntlmssp/blob/main/contrib/gssntlmssp.spec.in#L13 |
| 16 | +RUN dnf install -y \ |
| 17 | + autoconf automake docbook-style-xsl doxygen findutils krb5-devel \ |
| 18 | + libtool libxml2 libxslt libunistring-devel m4 pkgconfig openssl-devel |
| 19 | + |
| 20 | +# These build dependencies are also needed but not in the spec file. |
| 21 | +# It's easier to iterate on these packages when they are in their own RUN step. |
| 22 | +RUN dnf install -y rpm-build gettext-devel libwbclient-devel zlib-devel |
| 23 | + |
| 24 | +# Build gssntlmssp |
| 25 | +RUN <<EOF |
| 26 | + git clone https://github.com/gssapi/gss-ntlmssp |
| 27 | + cd /tmp/gss-ntlmssp |
| 28 | + autoreconf -f -i |
| 29 | + ./configure |
| 30 | + make rpms |
| 31 | + mkdir -p /tmp/gssntlmssp |
| 32 | + mv /tmp/gss-ntlmssp/rpmbuild/RPMS/x86_64/gssntlmssp-[0-9]*.x86_64.rpm /tmp/gssntlmssp/gssntlmssp.rpm |
| 33 | + rm -rf /tmp/gss-ntlmssp |
| 34 | +EOF |
| 35 | + |
| 36 | +# Start a new build stage since we don't need all the build dependencies and intermediate build output. |
| 37 | +FROM ${RUNTIME} as target |
| 38 | + |
| 39 | +# Get the final RPM we built out of the build stage. |
| 40 | +COPY --from=build /tmp/gssntlmssp /tmp/ |
| 41 | + |
| 42 | +# libwbclient is required to install the RPM, but it does not seem to declare it as a runtime dependency |
| 43 | +# so it won't be installed automatically. |
| 44 | +RUN dnf install -y libwbclient |
| 45 | + |
| 46 | +# This RPM is quite small but it brings in around 45 other packages. |
| 47 | +RUN rpm --install /tmp/gssntlmssp.rpm |
0 commit comments