Dockerfile RUN command not working - command

I am trying to create IBM WAS image from my local binary but it is not working . i used the dockerfile and added below command but getting error :
Dockerfile:
FROM centos:centos6
RUN yum update -y
RUN "/docker/software/im/installc -acceptLicense -accessRights nonAdmin \
-installationDirectory /docker/IBM/InstallationManager -dataLocation /docker/var/ibm/InstallationManager -showProgress"
Error:
---> Running in 206e970b75c8 /bin/sh: /docker/software/im/installc -acceptLicense -accessRights nonAdmin -installationDirectory /docker/IBM/InstallationManager -dataLocation
/docker/var/ibm/InstallationManager -showProgress: No such file or
directory The command '/bin/sh -c "/docker/software/im/installc
-acceptLicense -accessRights nonAdmin -installationDirectory /docker/IBM/InstallationManager -dataLocation
/docker/var/ibm/InstallationManager -showProgress"' returned a
non-zero code: 127

Docker is trying to run installc from within the image. The image centos:centos6 image does not contain IBM Installation Manager.
I recommend taking a look at the WebSphere traditional Docker images published by IBM to Docker hub. If you wish to create something slightly different for example use centos instead of ubuntu then take a look at the instructions for building WebSphere traditional Docker images, they are Apache licensed so you are free to adapt them.

Docker build error :
/bin/sh: /tmp/im/installc: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
The command '/bin/sh -c unzip -qd /tmp/im /tmp/agent.installer.linux.gtk.x86_1.8.0.20140902_1503.zip && /tmp/im/installc -acceptLicense -show Progress -installationDirectory /usr/lib/im -dataLocation /var/im && rm -rf /tmp/agent.installer.linux.gtk.x86_1.8.0.20140902_1503.zip /tmp/i m' returned a non-zero code: 126
Linux version : AWS linux 3.10.0-514.10.2.el7.x86_64 #1 SMP Mon Feb 20 02:37:52 EST 2017 x86_64 x86_64 x86_64 GNU/Linux

Related

unable to create tcserver v4.1.x instance in centos

Problem
I am trying to create/setup pivotal tcserver instance in CentOS.
Execution of tcserver command with 'create' option, returns nothing other than a blank screen.
At least getting some response when I execute tcserver command with other available options though.
tool details
Java: RedHat OpenJDK 11.0.14
tc-server: pivotal-tc-server-standard-4.1.12.RELEASE.tar.gz
OS: CentOS 7
Steps followed to create/setup the instance
Create Groups and Users for tcServer:
groupadd pivotal
useradd tcserver -g pivotal
Extract tcserver:
mkdir -p /opt/pivotal/tcserver
cd /opt/pivotal/tcserver
copy the pivotal-tc-server-standard-4.1.12.RELEASE.tar.gz to /opt/pivotal/tcserver
tar -zxvf pivotal-tc-server-standard-4.1.12.RELEASE.tar.gz
Verify:
ls -ltr /opt/pivotal/tcserver/pivotal-tc-server
You should see 2 directories as below:
standard-4.1.12.RELEASE
runtimes
Change Ownership:
cd /opt
chown -R tcserver:pivotalpivotal/
Add tcserverto your PATH variable
cd /opt/pivotal/tcserver/pivotal-tc-server/standard-4.1.12.RELEASE/
execute pwd command and copy the path.
create a file named tcserver.sh under /etc/profile.d/ and add the following
export PATH=/opt/pivotal/tcserver/pivotal-tc-server/standard-4.1.12.RELEASE:$PATH
save the file
Create Instance:
su tcserver
cd /opt/pivotal/tcserver/pivotal-tc-server/standard-4.1.12.RELEASE
tcserver create my-instance --instances-directory /var/opt/pivotal/pivotal-tc-server-standard --java-home /usr/lib/jvm/java-11-openjdk-11.0.14.0.9-1.el7_9.x86_64

Problems with NVIDIA-Linux-x86_64-470.63.01-grid.run to Deploy to Cloud Run

I'm trying to deploy on google cloud. So, my Dockerfile :
FROM ubuntu:20.04
RUN apt update
RUN apt -y install sudo
RUN apt -y install curl
RUN sudo apt install -y build-essential
RUN curl -O https://storage.googleapis.com/nvidia-drivers-us-public/GRID/GRID13.0/NVIDIA-Linux-x86_64-470.63.01-grid.run
RUN chmod +x NVIDIA-Linux-x86_64-470.63.01-grid.run
RUN sudo /bin/bash NVIDIA-Linux-x86_64-470.63.01-grid.run
FROM python:3.8
RUN adduser meat
RUN passwd -d meat
USER meat
WORKDIR /home/meat
RUN python3 -m venv meat-env
RUN /bin/bash -c "source meat-env/bin/activate"
RUN /usr/local/bin/python -m pip install --upgrade pip
COPY requirements.txt .
RUN pip3 install -r requirements.txt
COPY . .
CMD ["python", "main.py"]
and I got this error:
Step 8/20 : RUN sudo /bin/bash NVIDIA-Linux-x86_64-470.63.01-grid.run
---> Running in 811998f9cea8
Verifying archive integrity...
OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 470.63.01
...............
and several dots(.) later
[91mError opening terminal: unknown.
[0m
unable to stream build output: The command '/bin/sh -c sudo /bin/bash NVIDIA-Linux-x86_64-470.63.01-grid.run' returned a non-zero code: 1
Failed to build the app. Error: unable to stream build output: The command '/bin/sh -c sudo /bin/bash NVIDIA-Linux-x86_64-470.63.01-grid.run' returned a non-zero code: 1
I made something wrong with my Dockerfile? Or is there a differente way to do the command?
#DazWilkin's comment is correct:
It's not possible to install graphics driver to Cloud Run fully managed because it doesn't expose any GPU.
You should deploy it in Cloud Run Anthos(GKE). But you'll need to configure your GKE Cluster to install your GPU, According to the documentation, you should follow the steps:
Add a GPU-enabled node pool to your GKE cluster.
In this step, you can enable Enable Virtual Workstation (NVIDIA GRID). Please choose a GPU such as NVIDIA Tesla T4, P4 or P100 to enable NVIDIA GRID.
Install NVIDIA's device drivers to the nodes.
You can now create a service that will consume GPUs and deploy the image to Cloud Run for Anthos:
Setting up your service to consume GPUs

Docker-compose: /usr/local/bin/docker-compose : line 1: Not: command not found

i'm trying to install Docker-compose on my Raspberry Pi 3+ which installed Raspbian buster.
I followed instruction on docker.com. After I entered command : sudo curl -L https://github.com/docker/compose/releases/download/1.20.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose.
It show a table for downloading
Result
It seems nothing downloaded, just have a file docker-compose saved in /usr/local/bin/docker-compose. When I opened it, it empty. Then I enter command docker-compose -v, it displayed error /usr/local/bin/docker-compose : line 1: Not: command not found.
Anyone have solution?
UPDATE:
Added the following command to my answer to download the LATEST version without specifying any version number at all so the download can be scripted.
curl -L "https://github.com/docker/compose/releases/download/$(curl https://github.com/docker/compose/releases | grep -m1 '<a href="/docker/compose/releases/download/' | grep -o 'v[0-9:].[0-9].[0-9]')/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
It's a bit untidy, but it works. If you have a more elegant way than mine, ping it to me in the comments and I'll update my answer.
Just need to set the perms on the file:
chmod +x /usr/local/bin/docker-compose
Use the file command to validate that you pulled the correct arch for your system.
Intro:
Although docker-compose can be installed from a repo per the accepted answer, apt-cache show docker-compose reveals that as of 20211201 the repo version is only v1.25; about 2 years behind the current v2.1.1 release. In order to take advantage of more modern docker file versions, I needed to get the Github download working.
Short Answer:
The Docker documentation for Docker-Compose is WRONG. They forgot to preface the version number in the command with a "v"; consequently the download fails. Apparently this has been wrong for ages...
Longer Answer:
I ran the below command from the Docker-Compose documentation, and substituted the version "2.1.1" for "1.29.1" per Docker's guidance:
To install a different version of Compose, substitute 1.29.2 with the
version of Compose you want to use.
sudo curl -L "https://github.com/docker/compose/releases/download/2.1.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
The resulting download was 9 KB for a 23 MB binary. Clearly the link was bogus. So I went to the root of the address used in the command "https://github.com/docker/compose/releases" and right-clicked on the version of Docker-Compose that I wanted and chose "Copy Link Address"
This revealed the link Docker was telling folks to use didn't have a "v" prefaced before the version number in the https:// address part of the command.
Solution:
Preface a "v" before the version number you want in the link as below and the command executes successfully:
sudo curl -L "https://github.com/docker/compose/releases/download/v2.1.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
BTW, I too was downloading docker-compose for a Raspberry Pi using the aarch64 binary for Ubuntu 20.04 LTS. However, the missing "v" fix for the broken download address should work for any platform.
This is because on a raspberry pi the url part of the command results in
https://github.com/docker/compose/releases/download/1.24.1/docker-compose-Linux-armv7l
Looking at the latest stable release at https://github.com/docker/compose/releases/tag/1.24.1 you can see there is no download for the armv7l architecture so the file is empty because there is nothing to download.
Will update answer once I figured out how to install docker-compose on Raspian.
Edit:
Via apt-get. Note: Currently (Nov. 8 2019) this installs version 1.21 which is not the latest available.
sudo apt-get install docker-compose
Via pip3. (Installs latest)
sudo apt-get install python3-pip
sudo pip3 install docker-compose
And then restart your system with
sudo shutdown -r

CentOS Mondo Rescue Error to Restore the iso: Kernel Panic

I am trying to create an image (.iso) of my installed CentOS 5.11 system, for this i am using the "Mondo Rescue" with the command:
mondoarchive -Oi -9 -L -d /tmp/centos_iso -I / -T /tmp/centos_iso -p centos_image -s 4480m -E "/tmp|/var/spool/squid|/var/log"
The image is generated, and apparently is functional.
To install the iso in other machine i'm using the option "Nuke", in initialization page of "Mondo Rescue", like is represented in below image
When attempting to perform the installation, the following error occurs during the process:
Kernel panic - not syncing: No init found. Try passing init= options to kernel.

How to install Grafana on Mac

I tied the following steps
cd $GOPATH/src/github.com/grafana/grafana
go run build.go setup
I got the following
Version: 2.5.0-pre1, Linux Version: 2.5.0, Package Iteration: pre1
go get -v github.com/tools/godep
github.com/tools/godep (download)
github.com/tools/godep/Godeps/_workspace/src/github.com/kr/fs
github.com/tools/godep/Godeps/_workspace/src/github.com/pmezard/go-difflib/difflib
github.com/tools/godep/Godeps/_workspace/src/golang.org/x/tools/go/vcs
github.com/tools/godep
go get -v github.com/blang/semver
github.com/blang/semver (download)
github.com/blang/semver
go get -v github.com/mattn/go-sqlite3
go install -v github.com/mattn/go-sqlite3
then i executed
$GOPATH/bin/godep restore
i got no putput but command got executed
then i ran the command
go run build.go build
Version: 2.5.0-pre1, Linux Version: 2.5.0, Package Iteration: pre1
rm -r bin
rm -r Godeps/_workspace/pkg
rm -r Godeps/_workspace/bin
rm -r dist
rm -r tmp
rm -r /Users/skhare/sk/go/pkg/darwin_amd64/github.com/grafana
rm -r ./bin/grafana-server
rm -r ./bin/grafana-server.md5
GOPATH=/Users/skhare/sk/go/src/github.com/grafana/grafana/Godeps/_workspace:/Users/skhare/sk/go
go build -ldflags -w -X main.version '2.5.0-pre1' -X main.commit 'v2.1.2+394- gfb767f5' -X main.buildstamp 1442671169 -o ./bin/grafana-server .
# github.com/grafana/grafana
link: warning: option -X main.version 2.5.0-pre1 may not work in future releases; use -X main.version=2.5.0-pre1
link: warning: option -X main.commit v2.1.2+394-gfb767f5 may not work in future releases; use -X main.commit=v2.1.2+394-gfb767f5
link: warning: option -X main.buildstamp 1442671169 may not work in future releases; use -X main.buildstamp=1442671169
then i executed
npm install
i had to install npm
>npm install -g grunt-cli
/usr/local/bin/grunt -> /usr/local/lib/node_modules/grunt-cli/bin/grunt
grunt-cli#0.1.13 /usr/local/lib/node_modules/grunt-cli
├── resolve#0.3.1
├── nopt#1.0.10 (abbrev#1.0.7)
└── findup-sync#0.1.3 (lodash#2.4.2, glob#3.2.11)
>grunt
Running "jscs:src" (jscs) task
>> 156 files without code style errors.
Running "jshint:source" (jshint) task
✔ No problems
Running "jshint:tests" (jshint) task
✔ No problems
Running "tslint:source" (tslint) task
>> 11 files lint free.
Running "clean:gen" (clean) task
Cleaning public_gen...OK
Running "copy:public_to_gen" (copy) task
Created 122 directories, copied 553 files
Running "less:src" (less) task
File public_gen/css/bootstrap.dark.min.css created.
File public_gen/css/bootstrap.light.min.css created.
File public_gen/css/bootstrap-responsive.min.css created.
Running "concat:cssDark" (concat) task
File public_gen/css/grafana.dark.min.css created.
Running "concat:cssLight" (concat) task
File public_gen/css/grafana.light.min.css created.
Running "typescript:build" (typescript) task
42 files created. js: 14 files, map: 14 files, declaration: 14 files (968ms)
Done, without errors.
>go get github.com/Unknwon/bra
the above command did not give any output, nor an error message
bra run
it says -bash: bra: command not found
i tried to look for the resolution, but i could not find it. Please help
Recompile backend on source change
To rebuild on source change (requires that you executed godep restore)
go get github.com/Unknwon/bra
bra run
Running Grafana Locally
You can run a local instance of Grafana by running:
./bin/grafana-server
You must have missed this step!
go get github.com/Unknwon/bra
You can install Grafana using home brew.
brew update
brew install grafana
This sounds like an issue where Go is just being installed to build something else (for me, it was Grafana). In which case $GOPATH/bin is not in your PATH. $GOPATH/bin/bra should work. It did for me.
I suggest you installing Grafana inside Docker. If you install Docker for Mac, the GUI (Kitematic) will allow you to install grafana as easily as one click. You will just need to create a new container with "+ New" button, search grafana through the exisiting image lists and click "Create"
Docker will download grafana and it will appear in the left sidebar: