Run inside your project
docker run --rm -v $(pwd):/data adagio/swiftsdl2:4.2
The -v $(pwd):/data
parameter maps the current directory to the /data
volume
.build/x86_64-unknown-linux/debug/<target-name>
Yes, you can run the product in host 👌
Create a .build
folder inside your project
mkdir .build
Give useful permissions to your .build
folder
chmod u+s .build
WORKDIR /data
VOLUME /data
CMD sh -c "swift build -Xswiftc -static-stdlib"
The coomand will be executed on /data
directory, that maps to /data
volume.
Remember that current directory on the host was mapped to /data
volume with a parameter on docker run
command.