Skip to content

Commit 5b7600e

Browse files
authored
Merge pull request #2 from rofrano/fix-user
Forced root for use in build pipelines
2 parents 73c3bb0 + f847387 commit 5b7600e

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# Docker image for Python Behavior Driven Development Pipeline
22
FROM rofrano/nyu-devops-base:sp23
33

4-
RUN sudo apt-get update && \
5-
sudo apt-get install -y chromium-driver python3-selenium
4+
# This build image needs to be root
5+
USER root
6+
7+
RUN apt-get update && \
8+
apt-get install -y chromium-driver python3-selenium
69

710
WORKDIR /app
811

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## ----------------------------------------------------------------------
2-
## Builder for creating Docker images that behave similar to Virtual
3-
## Machines for use with Vagrant. This takes advantage if the buildx
4-
## builder in docker which can cross-compile images for other targets.
2+
## Builder for creating Docker images on multiple platform architectures.
3+
## This takes advantage if the buildx builder in docker which can
4+
## cross-compile images for other targets.
55
## ----------------------------------------------------------------------
66

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

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

4949
.PHONY: remove
5050
remove: ## Stop and remove the buildx builder

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ Your test job should look something like this:
3737
To run locally use:
3838

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

43-
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.
43+
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.
4444

4545
## License
4646

47-
Copyright (c) 2022, John Rofrano. All rights reserved.
47+
Copyright (c) 2022, 2023 John Rofrano. All rights reserved.
4848

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

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

0 commit comments

Comments
 (0)