Skip to content

Commit

Permalink
Removing non-root user
Browse files Browse the repository at this point in the history
  • Loading branch information
AnHeuermann committed Sep 6, 2023
1 parent d0e28cc commit 2cf7fc7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
9 changes: 0 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ LABEL org.opencontainers.image.authors="AnHeuermann"

ENV SHELL /bin/bash

# Non-root user
ARG USERNAME=openmodelica-user

# Ensure DEBIAN_FRONTEND is only set during build
ARG DEBIAN_FRONTEND=noninteractive

Expand Down Expand Up @@ -81,9 +78,3 @@ RUN rm -rf /var/lib/apt/lists/* \
&& apt-get clean \
&& rm -f control requirements.txt *.deb \
&& rm /openmodelica-build-deps_1.0_amd64.buildinfo /openmodelica-build-deps_1.0_amd64.changes

# Create non-root user
RUN useradd -m $USERNAME

ENV USER=$USERNAME
USER $USERNAME
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,33 @@ publish the Docker image to [https://hub.docker.com/repository/docker/anheuerman
## Build

```bash
export TAG=v1.22.0
export TAG=v1.22.1
docker build --pull --no-cache --tag build-deps:$TAG .
```

or

```bash
export TAG=v1.22.1
docker build --pull --no-cache --squash --tag build-deps:$TAG .
```

to reduce image size.

## Upload

The [publish.yml](./.github/workflows/publish.yml) workflow will build and upload the
Docker image to [https://hub.docker.com/repository/docker/anheuermann/openmodelica-build-deps](anheuermann/openmodelica-build-deps)
for each release.

To do it manually run:
To upload to docker.openmodelica.org (you'll need write access) run:

```bash
export REGISTRY=anheuermann
export TAG=v1.22.0
export REGISTRY=docker.openmodelica.org
export TAG=v1.22.1
docker login
docker image tag build-deps:$TAG $REGISTRY/openmodelica-build-deps:$TAG
docker push $REGISTRY/openmodelica-build-deps:$TAG
docker image tag build-deps:$TAG $REGISTRY/build-deps:$TAG
docker push $REGISTRY/build-deps:$TAG
```

## License
Expand Down

0 comments on commit 2cf7fc7

Please sign in to comment.