Comments (3)
Hey Dan, made some edits -- thoughts?
I recently published a post on the Red Hat Developer Blog about the Atomic command that we've been working on for the last few months.
The Atomic command (/usr/bin/atomic) is a high-level, coherent entrypoint for Atomic Host systems, and aims to fill in the gaps in Linux container implementations.
One of the first questions I received was about environment substitution. The user wanted to have standard Bash substitutions working with /usr/bin/atomic. Specifically, he wanted to allow substitutions like $PWD/.foobar
and --user=$(id -u)
.
I decided to try this out by creating a simple Dockerfile.
from rhel7
LABEL RUN echo $PWD/.foobar --user=$(id -u)
Then I build the container
docker build -t test .
Then, I'll execute atomic run test
atomic run test
echo
Looking at the label using docker inspect
, I see that building the container dropped the $() content.
So, I'll change the Dockerfile to quote it.
from rhel7
LABEL RUN echo '$PWD/.foobar' '--user=$(id -u)'
Build the container
docker build -t test .
Let's run it again:
atomic run test
echo $PWD/.foobar --user=$(id -u)
/root/test1/.foobar --user=0
Success
Woohoo, it works! If you want to take advantage of environment variables in your LABEL RUN
statements, make sure to quote them so they're passed through appropriately.
Have more questions about the atomic
command? Leave a comment here, or ask on the [email protected].
from atomic-site.
Looks Awesome.
On 04/21/2015 04:25 PM, jzb wrote:
Hey Dan, made some edits -- thoughts?
I recently published a post on the Red Hat Developer Blog
http://developerblog.redhat.com/2015/04/21/introducing-the-atomic-command
about the Atomic command that we've been working on for the last few
months.The Atomic http://www.projectatomic.io/docs/usr-bin-atomic/ command
(/usr/bin/atomic) is a high-level, coherent entrypoint for Atomic Host
systems, and aims to fill in the gaps in Linux container implementations.One of the first questions I received was about environment
substitution. The user wanted to have standard Bash substitutions
working with /usr/bin/atomic. Specifically, he wanted to allow
substitutions like |$PWD/.foobar| and |--user=$(id -u)|.I decided to try this out by creating a simple Dockerfile.
|from rhel7
LABEL RUN echo$PWD/.foobar --user=$ (id -u)
|Then I build the container
|docker build -t test .
|Then, I'll execute atomic run test
|atomic run test
echo
|Looking at the label using |docker inspect|, I see that building the
container dropped the $() content.So, I'll change the Dockerfile to quote it.
|from rhel7
LABEL RUN echo '$PWD/.foobar' '--user=$(id -u)'
|Build the container
|docker build -t test .
|Let's run it again:
|atomic run test
echo$PWD/.foobar --user=$ (id -u)
/root/test1/.foobar --user=0
|Success
Woohoo, it works! If you want to take advantage of environment
variables in your |LABEL RUN| statements, make sure to quote them so
they're passed through appropriately.Have more questions about the |atomic| command? Leave a comment here,
or ask on the [email protected]
https://lists.projectatomic.io/mailman/listinfo/atomic.—
Reply to this email directly or view it on GitHub
#109 (comment).
from atomic-site.
Posted: http://www.projectatomic.io/blog/2015/04/using-environment-substitution-with-the-atomic-command/
from atomic-site.
Related Issues (20)
- Change middle section to point to container libraries HOT 5
- Run "rpm-ostree install kubernetes-master --reboot" fail. HOT 3
- Request for new Blog Posting: Buildah HOT 10
- How do you pronounce Buildah HOT 1
- Missing clear instructions to install atomic CLI
- In Fedora 26 Atomic, Docker 1.13 prevents Kubernetes Services from opening NodePort HOT 6
- Fedora Atomic Kubernetes install steps, missing internal SSL IP
- Make Docker image available from registry HOT 2
- Spam on http://ask.projectatomic.io/ HOT 7
- Use only s2i for building the website
- Remove Nulecule / Atomic App HOT 4
- Add announcement that Red Hat bought CoreOS? HOT 4
- Possible migration guides from Container Linux. HOT 3
- proxy setting of rpm-ostree doc needs updating HOT 3
- BLOG: How to sneak secrets into your containers, without leaving a trace HOT 1
- Getting started should mention how to add /run/flannel/docker to the docker
- Getting started guide uses deprecated --api-servers option HOT 1
- Download link points to webpage which is not available HOT 1
- wiki on the main page
- Site is down? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atomic-site.