Skip to content

Commit

Permalink
update dockerfile and add build step of frontend (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzhiwei authored and k8s-ci-robot committed Dec 26, 2018
1 parent e7af132 commit 3ac8df0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions developer_guide.md
Expand Up @@ -65,6 +65,15 @@ $ gcloud auth configure-docker
$ docker push gcr.io/<your-gcp-project>/persistenceagent:latest
```

To build the frontend image and upload it to GCR:
```bash
# Run in the repository root directory
$ docker build -t gcr.io/<your-gcp-project>/frontend:latest -f frontend/Dockerfile .
# Push to GCR
$ gcloud auth configure-docker
$ docker push gcr.io/<your-gcp-project>/frontend:latest
```

### Minikube
Minikube can pick your local Docker image so you don't need to upload to remote repository.

Expand Down
7 changes: 7 additions & 0 deletions frontend/Dockerfile
Expand Up @@ -9,6 +9,13 @@ COPY . .

WORKDIR ./frontend

# Workaround for ppc64le since phantomjs does not support ppc64le
RUN if [ "$(uname -m)" = "ppc64le" ]; then \
wget -O /tmp/phantomjs-2.1.1-linux-ppc64.tar.bz2 https://github.com/ibmsoe/phantomjs/releases/download/2.1.1/phantomjs-2.1.1-linux-ppc64.tar.bz2 \
&& tar xf /tmp/phantomjs-2.1.1-linux-ppc64.tar.bz2 -C /usr/local/ \
&& ln -s /usr/local/phantomjs-2.1.1-linux-ppc64/bin/phantomjs /usr/bin/phantomjs; \
fi

RUN npm install && npm run postinstall
RUN npm run build

Expand Down

0 comments on commit 3ac8df0

Please sign in to comment.