Skip to content

Commit

Permalink
Adds image and tarball build commands to the READMEs
Browse files Browse the repository at this point in the history
Signed-off-by: Dennis Gove <[email protected]>
  • Loading branch information
dennisgove committed Jan 17, 2023
1 parent 45b501c commit fa1afc8
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 5 deletions.
24 changes: 22 additions & 2 deletions quickstart/docker_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

This Docker container is constructed specifically as an introductory quickstart for the Parsec service and client tool. It is not intended for use in any production system.

The container is started with the following command
The container is started with the following command. This assumes that your Docker system is configured to pull images from ghcr.io. If that's not the case, or if you'd like to build a local image, see section [Building Quickstart Image](#building-quickstart-image).

```bash
$> docker run --rm --name parsec -it parsec-quickstart bash
$> docker run --rm --name parsec -it parallaxsecond/parsec-quickstart bash
qs@319b139eb85e:/parsec/quickstart$
```

Expand Down Expand Up @@ -111,3 +111,23 @@ Testing Mbed Crypto provider
24 A1 19 DB 3F 3C A0 82 FE 63
....
```

## Building Quickstart Image

Building the Quickstart image locally can be accomplished by executing the `package.sh` script located in the `quickstart` directory. Running `package.sh` will also generate the Quickstart tarball and place it in the current directory.

```bash
$ quickstart > ./package.sh
Packaging started...
...
Finalizing packages
```

Alternatively, you can execute the Docker build command directly

```bash
# We use .. at the end so the entire parsec directory is available in the docker build context
$ quickstart > docker build --target runnable_image --tag parallaxsecond/parsec-quickstart -f quickstart.Dockerfile ..
```

Image construction requires cloning of https://github.com/parallaxsecond/parsec-tool in order to include the `parsec-tool` binary in the built image. This will be done automatically as part of the image construction process, but it does necessitate your system having access to Github.
6 changes: 3 additions & 3 deletions quickstart/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ check_release_tag() {
}

build_runnable_image() {
docker build --target runnable_image --tag parsec-quickstart -f quickstart.Dockerfile ${PARSEC_DIR}
docker build --target runnable_image --tag parallaxsecond/parsec-quickstart -f quickstart.Dockerfile ${PARSEC_DIR}
}

build_extract_tarball() {
docker build --target tarball_builder --tag parsec-quickstart-tarball -f quickstart.Dockerfile ${PARSEC_DIR}
docker build --target tarball_builder --tag parallaxsecond/parsec-quickstart-tarball -f quickstart.Dockerfile ${PARSEC_DIR}

# Extract the tarball out of the image used to construct it and place it in ${PACKAGE_PATH}
docker run -v ${PACKAGE_PATH}:/opt/mount --rm parsec-quickstart-tarball bash -c 'cp /parsec-tar/*.tar.gz /opt/mount/'
docker run -v ${PACKAGE_PATH}:/opt/mount --rm parallaxsecond/parsec-quickstart-tarball bash -c 'cp /parsec-tar/*.tar.gz /opt/mount/'
}

echo "Packaging started..."
Expand Down
26 changes: 26 additions & 0 deletions quickstart/tarball_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This tarball and content is constructed specifically as an introductory quicksta

These tools were built for a Linux-based `x86_64` system.

Please see section [Building Quickstart Tarball](#building-quickstart-tarball) if you'd like to generate the Quickstart tarball locally.

## Directory Layout

```
Expand Down Expand Up @@ -104,3 +106,27 @@ Testing Mbed Crypto provider
24 A1 19 DB 3F 3C A0 82 FE 63
....
```

## Building Quickstart Tarball

Building the Quickstart tarball locally can be accomplished by executing the `package.sh` script located in the `quickstart` directory. Default execution will place the generated tarball in the current directory. If you'd like it placed in a specific directory then use the `-o <path>` option. Running `package.sh` will also generate the Quickstart Docker image.

```bash
$ quickstart > ./package.sh
Packaging started...
...
Finalizing packages
```

Alternatively, you can execute the commands directly

```bash
# Use Docker to generate the tarball
# We use .. at the end so the entire parsec directory is available in the docker build context
$ quickstart > docker build --target tarball_builder --tag parallaxsecond/parsec-quickstart-tarball -f quickstart.Dockerfile ..

# Extract the tarball from the Docker image and place it in the currently directory
$ quickstart > docker run -v `pwd`:/opt/mount --rm parallaxsecond/parsec-quickstart-tarball bash -c 'cp /parsec-tar/*.tar.gz /opt/mount/'
```

Tarball generation requires cloning of https://github.com/parallaxsecond/parsec-tool in order to include the `parsec-tool` binary in the built image. This will be done automatically as part of the tarball construction process, but it does necessitate your system having access to Github.

0 comments on commit fa1afc8

Please sign in to comment.