Public Repository

Last pushed: 18 days ago
Short Description
Docker images for SharePoint Framework
Full Description

Docker images for running SharePoint Framework.

Usage

  • in Docker Settings > Shared Drives verify that the drive where you create your projects is shared
  • in the HOSTS file on your host add:
127.0.0.1    spfx
  • Create a folder for your SharePoint Framework project
  • In the command line (on macOS):
cd [your project]
docker run -h spfx -it --rm --name ${PWD##*/} -v $PWD:/usr/app/spfx -p 5432:5432 -p 4321:4321 -p 35729:35729 waldekm/spfx
  • In the command line (on Windows, assuming your project is located at c:\projects\spfx-helloworld):
cd c:\projects\spfx-helloworld
docker run -h spfx -it --rm --name spfx-helloworld -v /c/projects/spfx-helloworld:/usr/app/spfx -p 5432:5432 -p 4321:4321 -p 35729:35729 waldekm/spfx

After the container started you can work with it the same way you would work with SharePoint Framework installed on your host. To create a new SharePoint Framework project in the container command line execute:

yo @microsoft/sharepoint

To open the SharePoint workbench navigate in the browser to https://spfx:5432/workbench.

All files scaffolded by the generator will be stored in your project directory on your host from where you can commit them to source control.

To close the container in the container command line run:

exit

Available tags

  • latest: contains the SharePoint Framework Yeoman generator from the 1.3.2 release
  • online: contains the SharePoint Framework Yeoman generator from the 1.3.2 release
  • onprem: contains the SharePoint Framework Yeoman generator from the 1.3.2 release
  • 1.3.2: contains the SharePoint Framework Yeoman generator from the 1.3.2 release
  • 1.3.1: contains the SharePoint Framework Yeoman generator from the 1.3.1 release
  • 1.3.0: contains the SharePoint Framework Yeoman generator from the 1.3.0 release
  • 1.2.0: contains the SharePoint Framework Yeoman generator from the 1.2.0 release
  • 1.1.3: contains the SharePoint Framework Yeoman generator from the 1.1.3 release
  • 1.1.1: contains the SharePoint Framework Yeoman generator from the 1.1.1 release
  • 1.1.0: contains the SharePoint Framework Yeoman generator from the 1.1.0 release
  • 1.0.2: contains the SharePoint Framework Yeoman generator from the 1.0.2 release
  • ga: contains the SharePoint Framework Yeoman generator from the GA release
  • rc0: contains the SharePoint Framework Yeoman generator from the RC0 release
  • drop-6: contains the SharePoint Framework Yeoman generator from the developer preview drop 6
  • drop-5: contains the SharePoint Framework Yeoman generator from the developer preview drop 5
  • drop-4: contains the SharePoint Framework Yeoman generator from the developer preview drop 4

Known issues

When running yo @microsoft/sharepoint you get an error that the container is unable to write files to the disk. In most cases this is caused by the drive not being shared in Docker. Go to Docker > Settings > Sharing to enable sharing the drive where your project is located.

Limitations

Windows 10 Anniversary Update and Windows Server 2016 have native support for containers. At this moment Windows supports only containers built on Windows Server Core or Nano Server and you won't be able to run this container natively on Windows. Instead you should use Docker for Windows or Docker Toolbox.

Docker Pull Command
Owner
waldekm

Comments (1)
limam
9 months ago

Thanks Waldek! I am running it on my Mac Book Pro using Docker for Mac and it works beautifully. Cheers!