Code Monkey home page Code Monkey logo

docker-spfx's Introduction

SharePoint Framework Docker images

A lightweight Docker image for running SharePoint Framework.

Usage

  • Create a folder for your SharePoint Framework project
cd [your project]
docker run -itd --rm --name docker-spfx -v ${PWD}:/home/spfx/app -p 5432:5432 -p 4321:4321 -p 35729:35729 luckyjc/spfx:1.4.1

Once the container started, execute the command below to create a new SPFx project in the container and follow the prompts:

yo @microsoft/sharepoint

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

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

**Note you will have a detached Docker process running this container after you close the terminal that you can stop by running docker stop <container-id>.

Versions

spfx:1.4.1 is the image used to develop against on-premise SharePoint Server 2019

Known issues

If you get a browser warning that the connection isn't private and localhost is untrusted; NET:ERR_CERT_AUTHORITY_INVALID

You need to run gulp trust-dev-cert within the container to create the certificate.

If you are using Visual Studio code for remote development, a Download command is available from the palette (Ctrl+Shift+P) or when right-clicking on a file. We need to include the .cer file in the explorer view. The following command will copy the .cer file from its generated location into the workspace folder.

cp /home/spfx/.gcb-serve-data/*.cer .

** This will put a copy of the certificate in the root project file. You will want to delete this file after you download it to prevent accidentally checking it into source.

If using Windows, you then need to trust the certificate

With the file on the local computer, we can add it to the correct certificate store using the same command as the SPFx toolchain.

For Windows, the command:

certutil -user -addstore root <path-to-cer-file>

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.

docker-spfx's People

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

robinbreman

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.