Skip to content

Commit

Permalink
Merge pull request #2 from rofrano/fix-user
Browse files Browse the repository at this point in the history
Forced root for use in build pipelines
  • Loading branch information
rofrano authored Feb 27, 2023
2 parents 73c3bb0 + f847387 commit 5b7600e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Docker image for Python Behavior Driven Development Pipeline
FROM rofrano/nyu-devops-base:sp23

RUN sudo apt-get update && \
sudo apt-get install -y chromium-driver python3-selenium
# This build image needs to be root
USER root

RUN apt-get update && \
apt-get install -y chromium-driver python3-selenium

WORKDIR /app

Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## ----------------------------------------------------------------------
## Builder for creating Docker images that behave similar to Virtual
## Machines for use with Vagrant. This takes advantage if the buildx
## builder in docker which can cross-compile images for other targets.
## Builder for creating Docker images on multiple platform architectures.
## This takes advantage if the buildx builder in docker which can
## cross-compile images for other targets.
## ----------------------------------------------------------------------

# These can be overidden with env vars.
Expand Down Expand Up @@ -42,9 +42,9 @@ build: ## Build all of the project Docker images
docker buildx build --pull --platform=$(PLATFORM) --tag $(IMAGE) --push .

.PHONY: run
run: ## Run a vagrant VM using this image
run: ## Run a container using this image
$(info Bringing up container with Docker...)
docker run --rm -v $(PWD)/app -w /app $(IMAGE) bash
docker run --rm -it -h nyu --user vscode -v $(PWD):/app -w /app $(IMAGE) bash

.PHONY: remove
remove: ## Stop and remove the buildx builder
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ Your test job should look something like this:
To run locally use:

```sh
docker run --rm -it -v $(pwd):/app -w /app rofrano/pipeline-selenium bash
docker run --rm -it -h nyu --user vscode -v $(pwd):/app -w /app rofrano/pipeline-selenium bash
```

That will leave you at a `bash` prompt in the `/app` folder shared with your current working directory so that you can `pip install` your dependencies and start your testing.
That will place you inside the container as the user `vscode` sitting at a `bash` prompt in the `/app` folder that has been shared with your current working directory so that you can `pip install` your dependencies and start your testing.

## License

Copyright (c) 2022, John Rofrano. All rights reserved.
Copyright (c) 2022, 2023 John Rofrano. All rights reserved.

Licensed under the Apache License. See [LICENSE](LICENSE)

This repo is part of the NYU masters class: **CSCI-GA.2820-001 DevOps and Agile Methodologies** created by *John Rofrano*
This repo is part of the NYU masters class: **CSCI-GA.2820-001 DevOps and Agile Methodologies** created by *John Rofrano*

0 comments on commit 5b7600e

Please sign in to comment.