Skip to content

Commit

Permalink
Merge branch 'master' of ssh://github.com/vmware/photon
Browse files Browse the repository at this point in the history
  • Loading branch information
Sriram Nambakam committed Apr 24, 2015
2 parents 3d47a6a + 03fb82f commit 1942196
Show file tree
Hide file tree
Showing 10 changed files with 178 additions and 169 deletions.
101 changes: 12 additions & 89 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,96 +1,19 @@
# Welcome to the VMware Photon Linux Release!
![Photon](http://storage.googleapis.com/project-photon/vmw-logo-photon.svg "VMware Photon")

## Introduction
[ ![Download](https://api.bintray.com/packages/vmware/photon/iso/images/download.svg) ](https://bintray.com/vmware/photon/iso/_latestVersion)
VMware Photon: Minimal Linux Container Host
===========================================

Photon is a small RPM-based Linux distribution that is optimized for running containers. This repository is intended for developers wishing to modify Photon and build their own customized ISO images. For those interested in an ISO image that is ready to use, please download from the following location:
Photon is a technology preview of a minimal Linux container host. It is designed to have a small footprint and boot extremely quickly on VMware platforms. Photon is intended to invite collaboration around running containerized applications in a virtualized environment.

https://dl.bintray.com/vmware/photon/iso/1.0TP1/x86_64/
- Optimized for vSphere - Validated on VMware product and provider platforms.
- Container support - Supports Docker, rkt, and the Pivotal Garden container specifications.
- Efficient lifecycle management - contains a new, open-source, yum-compatible package manager that will help make the system as small as possible, but preserve the robust yum package management capabilities.

## Folder Layout
```
photon/
├── Makefile
├── README
├── SPECS # RPM SPEC files
├── cloud-init.md
├── gce.md
├── installer # Installer used at runtime
└── support
```
This repository is intended for developers wishing to modify Photon and build their own customized ISO images.

## How to build the ISO?
Official ISOs are available for download at [Bintray](https://bintray.com/vmware/photon/iso/view).

Assuming you checked out the workspace under `$HOME/workspaces/photon`.
```
cd $HOME/workspaces/photon
sudo make iso
```
Deliverable will be created at `$HOME/workspaces/photon/stage/photon.iso`
An official Vagrant box is available on Hashicorp Atlas, to get started: `vagrant init vmware/photon`. A plugin to support Photon guests in Vagrant is available at https://github.com/vmware/vagrant-guests-photon.

## How to use cached toolchain and RPMS?
```
mkdir $HOME/photon-cache
sudo make iso PHOTON_CACHE_PATH=$HOME/photon-cache
```
Directory format of `PHOTON_CACHE_PATH` is as follows.
```
photon-cache/
├──tools-build.tar.gz
├──RPMS/x86-64/*.rpm
└──RPMX/noarch/*.rpm
```
## How to use cached sources?
```
mkdir $HOME/photon-sources
sudo make iso PHOTON_SOURCES_PATH=$HOME/photon-sources
```
Directory format of `PHOTON_SOURCES_PATH` is as follows.
```
photon-sources/
├──src1.tar.gz
├──src2.tar.gz
└──...
```
## How to build the toolchain?

1. Check toolchain pre-requisites
```
$HOME/workspaces/photon/support/toolchain/version-check.sh
```
2. Make toolchain
```
$HOME/workspaces/photon
sudo make toolchain
```

Pre-requisites :

* Build O/S : Ubuntu 14.04 (or later) 64 bit
* Packages: bison, gawk, g++, createrepo, python-aptdaemon, genisoimage, texinfo, python-requests
```
sudo apt-get -y install bison gawk g++ createrepo python-aptdaemon genisoimage texinfo python-requests
```

### Settings:

Make sure `/bin/sh` is a symbolic link pointing to `/bin/bash`

If `/bin/sh` is pointing `/bin/dash`, execute the following:
```
rm -f /bin/sh
ln -s /bin/bash /bin/sh
```

## Where are the build logs?
```
$HOME/workspaces/photon/stage/LOGS
```

## Complete build environment using Vagrant
A `Vagrantfile` is available to ensure a quick standup of a development/build environment for Photon, this Vagrantfile uses a box called `photon-build-machine` box that is created through a [Packer](http://packer.io) template available under `support/packer-templates`, see the [README.md](https://github.com/vmware/photon/blob/master/support/packer-templates/README.md) for more information on how to build `photon-build-machine`.

## Photon Vagrant box
As with the build-machine a Packer template is available under `support/packer-templates` to build a Photon based Vagrant box running Docker, see the [README.md](https://github.com/vmware/photon/blob/master/support/packer-templates/README.md) for more information on how to build.

## Automated build environment and Vagrant boxes
Convenience make targets also exist to build both the `photon-build-machine` and the `photon` Packer templates as well as building a fresh ISO using the `photon-build-machine`. See the [README.md](https://github.com/vmware/photon/blob/master/support/packer-templates/README.md) for more details.
For up-to-date documentation, see the [Docs](docs/) folder.
21 changes: 0 additions & 21 deletions dockerfiles.md

This file was deleted.

88 changes: 88 additions & 0 deletions docs/build-photon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
## Folder Layout
```
photon/
├── Makefile
├── README
├── SPECS # RPM SPEC files
├── cloud-init.md
├── gce.md
├── installer # Installer used at runtime
└── support
```

## How to build the ISO?

Assuming you checked out the workspace under `$HOME/workspaces/photon`.
```
cd $HOME/workspaces/photon
sudo make iso
```
Deliverable will be created at `$HOME/workspaces/photon/stage/photon.iso`

## How to use cached toolchain and RPMS?
```
mkdir $HOME/photon-cache
sudo make iso PHOTON_CACHE_PATH=$HOME/photon-cache
```
Directory format of `PHOTON_CACHE_PATH` is as follows.
```
photon-cache/
├──tools-build.tar.gz
├──RPMS/x86-64/*.rpm
└──RPMX/noarch/*.rpm
```
## How to use cached sources?
```
mkdir $HOME/photon-sources
sudo make iso PHOTON_SOURCES_PATH=$HOME/photon-sources
```
Directory format of `PHOTON_SOURCES_PATH` is as follows.
```
photon-sources/
├──src1.tar.gz
├──src2.tar.gz
└──...
```
## How to build the toolchain?

1. Check toolchain pre-requisites
```
$HOME/workspaces/photon/support/toolchain/version-check.sh
```
2. Make toolchain
```
$HOME/workspaces/photon
sudo make toolchain
```

Pre-requisites :

* Build O/S : Ubuntu 14.04 (or later) 64 bit
* Packages: bison, gawk, g++, createrepo, python-aptdaemon, genisoimage, texinfo, python-requests
```
sudo apt-get -y install bison gawk g++ createrepo python-aptdaemon genisoimage texinfo python-requests
```

### Settings:

Make sure `/bin/sh` is a symbolic link pointing to `/bin/bash`

If `/bin/sh` is pointing `/bin/dash`, execute the following:
```
rm -f /bin/sh
ln -s /bin/bash /bin/sh
```

## Where are the build logs?
```
$HOME/workspaces/photon/stage/LOGS
```

## Complete build environment using Vagrant
A `Vagrantfile` is available to ensure a quick standup of a development/build environment for Photon, this Vagrantfile uses a box called `photon-build-machine` box that is created through a [Packer](http://packer.io) template available under `support/packer-templates`, see the [README.md](https://github.com/vmware/photon/blob/master/support/packer-templates/README.md) for more information on how to build `photon-build-machine`.

## Photon Vagrant box
As with the build-machine a Packer template is available under `support/packer-templates` to build a Photon based Vagrant box running Docker, see the [README.md](https://github.com/vmware/photon/blob/master/support/packer-templates/README.md) for more information on how to build.

## Automated build environment and Vagrant boxes
Convenience make targets also exist to build both the `photon-build-machine` and the `photon` Packer templates as well as building a fresh ISO using the `photon-build-machine`. See the [README.md](https://github.com/vmware/photon/blob/master/support/packer-templates/README.md) for more details.
File renamed without changes.
19 changes: 19 additions & 0 deletions docs/dockerfiles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Photon on Docker

To create a Docker container image we need a Dockerfile that describes the base image and packages to be installed on the image. A Dockerfile lets you define and then create an image that can then be used to create container instances.
A Photon Dockerfile is located at following location:

```$HOME/workspace/photon/support/dockerfiles/photon```

## Build new Photon Images
To build new images you should have built all Photon RPMS using ```make all``` or ```make iso```. Also, the docker service should be running in the background.

The ```./make-docker-image.sh``` command takes the path of the local repo and the type of image (i.e. minimal, micro or full) you want to create.

```cd $HOME/workspace/photon/support/dockerfiles/photon```

```./make-docker-image.sh $HOME/workspace minimal```

## Running the Photon Container

```docker run -it photon:minimal```
59 changes: 59 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#FAQ

#### Why can't I SSH in as root?

By default Photon does not permit root login to ssh. To make yourself login as root using
SSH set <code>PermitRootLogin yes</code> in /etc/ssh/sshd_config, and restart the sshd deamon.

#### Why is netstat not working?

netstat is deprecated, ss or ip (part of iproute2) should be used instead.

## How do I install new packages?
#### Why is the yum command not working in a Minimal installation of Photon?

To install packages from cdrom, mount cdrom using following command

```
mount /dev/cdrom /media/cdrom
```

Then you can use ```tdnf``` to install new pacakges

```
tdnf install vim
```

#### How do I build a new RPM package?

Assuming you have the Ubuntu development environment setup and got the latest code pull into /workspace.
Lets assume your package name is foo with version 1.0.

```
cp foo-1.0.tar.gz /workspace/photon/SOURCES
cp foo.spec /workspace/photon/SPECS/foo/
cd /workspace/photon/support/package-builder
sudo python ./build_package.py -i foo
```

#### I just booted into a freshly installed Photon, why is ```docker ps``` not working?

Make sure the docker daemon is running, which by design is not started at boot time.

#### What is the difference between the Micro/Minimal/Full installations of Photon?
Micro is the smallest version of Photon, under 220MB (as of 03/30) to be used as base for customization.

Minimal is Micro plus Docker and Cloud-init packages.

Full contains all the packages shipped with ISO.

#### What packages are included in Micro/Minimal?
See [package_list.json](installer/package_list.json)

#### Why is vi/vim is not working in a Minimal installation of Photon?

We have `nano` installed by default for file editing in Minimal. Use `tdnf` to install `vim`.

#### How do I transfer/share files between Photon and my host machine?

We are working on supporting some standard options. Currently we recommend using [sshfs](https://wiki.archlinux.org/index.php/sshfs) for file sharing between hosts and Photon.
File renamed without changes.
File renamed without changes.
File renamed without changes.
59 changes: 0 additions & 59 deletions faq.md

This file was deleted.

0 comments on commit 1942196

Please sign in to comment.