Skip to content

issue-71 update container build instructions #151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,22 @@ if you just want to build it run:
mvnw package
```

## Build container image from Dockerfile and run locally
To build the container image from Dockerfile and run locally using docker:
## Build and Run Docker Container Locally
### Build the project

```
docker build --platform=linux/amd64 -t openliberty-gettingstarted:<TAG> .
docker images --filter reference=openliberty-gettingstarted
sudo docker run --platform=linux/amd64 -t -i -p 127.0.0.1:9080:9080 openliberty-gettingstarted:<TAG>
./mvnw package
```

To build the container image from Dockerfile and run locally using podman:
### Build the Docker image

```
podman build --platform=linux/amd64 -t openliberty-gettingstarted:<TAG> .
podman images --filter reference=openliberty-gettingstarted
sudo podman run --platform=linux/amd64 -t -i -p 127.0.0.1:9080:9080 openliberty-gettingstarted:<TAG>
docker build -t openliberty-gettingstarted .
```
### Run the Docker container

```
docker run -p 9080:9080 openliberty-gettingstarted
```

### Access the application
Expand Down
Loading