I am working on a Swift project in a devcontainer. Recently, I wanted to add the swift-format
library to the devcontainer, to generate formatting reports. Until now, my Dockerfile looked like this:
FROM xxx/xxx-image:latest (based on swift:latest)
and this worked perfectly. When I open the devcontainer in VSCode everything works as it should, I am able to run commands in the terminal. Next, I wanted to add the swift-format
library to the project. I first tried to install it locally and everything was swell. However, I wanted to add this library to the dockerfile so I can run pipelines using it, so I modified the file like this:
FROM xxx/xxx-image:latest (based on swift:latest)
RUN apt-get update
RUN git clone -b release/5.9 https://github.com/apple/swift-format.git &&
cd swift-format &&
swift build -c release
ENV PATH="/swift-format/.build/release:${PATH}"
RUN swift-format --version
This results in the following output:
Port forwarding X > X > X stderr: Remote close
Port forwarding X > X > X terminated with code 0 and signal null.
Port forwarding X > X > X: Local close with error
and the devcontainer never opening properly. I have no idea what I am doing wrong. Please help!