docfx icon indicating copy to clipboard operation
docfx copied to clipboard

docfx serve returns empty response on Debian

Open FLAMESpl opened this issue 4 years ago • 0 comments

Operating System: Debian GNU/Linux 10 (buster)

DocFX Version Used: 2.59.0

Template used: default

Steps to Reproduce:

  1. Create directory with following files:

Dockerfile

FROM alpine:latest as build

ARG DOCFX_VERSION=2.59.0

RUN apk add -U wget unzip && \
    mkdir -p /tmp/docfx && \
    wget https://github.com/dotnet/docfx/releases/download/v${DOCFX_VERSION}/docfx.zip -O /tmp/docfx.zip && \
    unzip /tmp/docfx.zip -d /tmp/docfx

FROM mono:6.8

ARG BUILD_DATE
ARG VCS_REF

RUN apt-get update && \
    apt-get install -y \
                    --no-install-recommends \
                    --no-install-suggests \
		    git && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* && \
    adduser \
        --home /nonexistent \
        --shell /bin/false \
        --no-create-home \
        --gecos "" \
        --disabled-password \
        --disabled-login \
        docfx

# Copy downloaded and extracted DocFX sources to runtime container
COPY --from=build --chown=docfx:docfx /tmp/docfx /opt/docfx

# set user-context to unpriviledged user
USER docfx

# Add script to mimic docfx executable
ADD docfx /usr/bin/docfx

# Default port for docfx serve
EXPOSE 8080

ENTRYPOINT ["/usr/bin/docfx"]

docfx

#!/usr/bin/env bash

/usr/bin/mono /opt/docfx/docfx.exe $@

docfx file must have unix-style line endings!

  1. build docker image (checkout to directory and run command docker build docfx-test .)

  2. run container: docker run -it -p 8080:8080 docfx-test serve

  3. open website localhost:8080

Expected Behavior: Webpage with directory listing

Actual Behavior: http error code ERR_EMPTY_RESPONSE (note this is different from having docfx server not running at all)

FLAMESpl avatar Feb 28 '22 14:02 FLAMESpl